Skip to content

Commit

Permalink
remove biobureau test code
Browse files Browse the repository at this point in the history
  • Loading branch information
haxiomic committed Feb 23, 2021
1 parent b2b18d8 commit 18b1b08
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoTranscriptComponentClass = exports.SoTranscriptClass = exports.SoGeneClass = exports.TranscriptComponentClass = exports.TranscriptClass = exports.GeneClass = exports.GenomeFeatureType = exports.Strand = void 0;
var Strand;
(function (Strand) {
Strand["None"] = ".";
Expand Down Expand Up @@ -50,8 +51,8 @@ class SoGeneClass {
this['pseudogene'] = GeneClass.Pseudo;
}
}
SoGeneClass.instance = new SoGeneClass();
exports.SoGeneClass = SoGeneClass;
SoGeneClass.instance = new SoGeneClass();
class SoTranscriptClass {
constructor() {
this['transcript'] = TranscriptClass.Unspecified;
Expand All @@ -66,8 +67,8 @@ class SoTranscriptClass {
this['snRNA'] = TranscriptClass.NonProteinCoding;
}
}
SoTranscriptClass.instance = new SoTranscriptClass();
exports.SoTranscriptClass = SoTranscriptClass;
SoTranscriptClass.instance = new SoTranscriptClass();
class SoTranscriptComponentClass {
constructor() {
this['CDS'] = TranscriptComponentClass.ProteinCodingSequence;
Expand All @@ -76,5 +77,5 @@ class SoTranscriptComponentClass {
this['three_prime_UTR'] = TranscriptComponentClass.Untranslated;
}
}
SoTranscriptComponentClass.instance = new SoTranscriptComponentClass();
exports.SoTranscriptComponentClass = SoTranscriptComponentClass;
SoTranscriptComponentClass.instance = new SoTranscriptComponentClass();
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteDirectory = void 0;
const Terminal_1 = require("./Terminal");
const fs = require("fs");
function deleteDirectory(directory) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Terminal = void 0;
const util = require("util");
const process = require("process");
class Terminal {
Expand Down Expand Up @@ -56,8 +57,8 @@ class Terminal {
}
}
}
Terminal.currentRewriteId = undefined;
exports.Terminal = Terminal;
Terminal.currentRewriteId = undefined;
exports.default = Terminal;
var FormatFlag;
(function (FormatFlag) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tileset = void 0;
class Tileset {
constructor(tileSize) {
this.tileSize = tileSize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnnotationTileset = void 0;
const AnnotationTypes_1 = require("../../../../src/track/annotation/AnnotationTypes");
class AnnotationTileset {
constructor(tileSize, topLevelOnly, onUnknownFeature, onError) {
Expand Down Expand Up @@ -40,17 +41,17 @@ class AnnotationTileset {
let isTranscript = AnnotationTypes_1.SoTranscriptClass.instance[c.type] !== undefined;
return isTranscript ? (p + 1) : p;
}, 0);
let gene = Object.assign({}, featureCommon, { type: AnnotationTypes_1.GenomeFeatureType.Gene, class: AnnotationTypes_1.SoGeneClass.instance[feature.type], strand: feature.strand, transcriptCount: transcriptCount });
let gene = Object.assign(Object.assign({}, featureCommon), { type: AnnotationTypes_1.GenomeFeatureType.Gene, class: AnnotationTypes_1.SoGeneClass.instance[feature.type], strand: feature.strand, transcriptCount: transcriptCount });
tile.content.push(gene);
}
else if (AnnotationTypes_1.SoTranscriptClass.instance[feature.type] !== undefined) {
// is transcript
let transcript = Object.assign({}, featureCommon, { type: AnnotationTypes_1.GenomeFeatureType.Transcript, class: AnnotationTypes_1.SoTranscriptClass.instance[feature.type] });
let transcript = Object.assign(Object.assign({}, featureCommon), { type: AnnotationTypes_1.GenomeFeatureType.Transcript, class: AnnotationTypes_1.SoTranscriptClass.instance[feature.type] });
tile.content.push(transcript);
}
else if (AnnotationTypes_1.SoTranscriptComponentClass.instance[feature.type] !== undefined) {
// is transcript component
let info = Object.assign({}, featureCommon, { type: AnnotationTypes_1.GenomeFeatureType.TranscriptComponent, class: AnnotationTypes_1.SoTranscriptComponentClass.instance[feature.type] });
let info = Object.assign(Object.assign({}, featureCommon), { type: AnnotationTypes_1.GenomeFeatureType.TranscriptComponent, class: AnnotationTypes_1.SoTranscriptComponentClass.instance[feature.type] });
if (feature.phase != null) {
info.phase = feature.phase;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* - A 'gene' by default is a protein-coding gene
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.gff3Convert = void 0;
const fs = require("fs");
const path = require("path");
const AnnotationTileset_1 = require("./AnnotationTileset");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBranches = exports.printSummary = void 0;
const Terminal_1 = require("../Terminal");
function printSummary(features) {
Terminal_1.default.log('Parsing complete\n');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.vcfConvert = void 0;
const fs = require("fs");
const path = require("path");
const Terminal_1 = require("../Terminal");
Expand Down Expand Up @@ -37,11 +38,10 @@ function vcfConvert(inputFilePath, outputDirectory) {
alts: feature.ALT.split('')
});
}
// @! temporary for demo
let species = 'l_fortunei';
saveSequence(tileset.sequences['main'] || [], `${outputDirectory}/${species.toLowerCase()}.vvariants-dir/${species.toLowerCase()}`);
let inputFilename = path.basename(inputFilePath);
saveSequence(tileset.sequences['main'] || [], `${outputDirectory}/${inputFilename.toLowerCase()}.vvariants-dir/${inputFilename.toLowerCase()}`);
// @! temporary, save out genes for biobureau demo
filesWritten = filesWritten.concat(biobureauGenerateGenes(inputFilePath, outputDirectory, vcf));
// filesWritten = filesWritten.concat(biobureauGenerateGenes(inputFilePath, outputDirectory, vcf));
resolve(filesWritten);
}
});
Expand Down Expand Up @@ -95,6 +95,7 @@ function saveSequence(sequence, directory) {
return filesWritten;
}
// @! temporary to generate genes from custom biobureau files
// @! not sure how this translates into files from other sources
function biobureauGenerateGenes(inputFilePath, outputDirectory, vcf) {
const lodLevel0TileSize = 1 << 20;
let biobureauFilenameMatch = /^LF_itr6_\d+_([^\.]+)/.exec(path.basename(inputFilePath));
Expand Down Expand Up @@ -255,7 +256,7 @@ class VCFParser {
}
this.callbacks.onComplete(this.output);
};
this.callbacks = Object.assign({}, this.callbacks, callbacks);
this.callbacks = Object.assign(Object.assign({}, this.callbacks), callbacks);
}
onMetaLine(line) {
if (line.trim() === '')
Expand Down
9 changes: 4 additions & 5 deletions tools/genome-preprocess/src/vcf/Convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ export function vcfConvert(inputFilePath: string, outputDirectory: string): Prom
});
}

// @! temporary for demo
let species = 'l_fortunei';
saveSequence(tileset.sequences['main'] || [], `${outputDirectory}/${species.toLowerCase()}.vvariants-dir/${species.toLowerCase()}`);
let inputFilename = path.basename(inputFilePath);
saveSequence(tileset.sequences['main'] || [], `${outputDirectory}/${inputFilename.toLowerCase()}.vvariants-dir/${inputFilename.toLowerCase()}`);

// @! temporary, save out genes for biobureau demo
filesWritten = filesWritten.concat(biobureauGenerateGenes(inputFilePath, outputDirectory, vcf));
// filesWritten = filesWritten.concat(biobureauGenerateGenes(inputFilePath, outputDirectory, vcf));

resolve(filesWritten);
}
Expand Down Expand Up @@ -130,7 +129,7 @@ function biobureauGenerateGenes(inputFilePath: string, outputDirectory: string,
throw `Biobureau demo: filename does not match (@! remove this)`;
}

let filesWritten = new Set();
let filesWritten = new Set<string>();

let biobureauGeneTileset = new AnnotationTileset(
lodLevel0TileSize, // ~1 million,
Expand Down

0 comments on commit 18b1b08

Please sign in to comment.