Skip to content

Commit

Permalink
Bug fix -- annotation tracks not searchable. See issue #1227
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Nov 19, 2020
1 parent 5fdaf8c commit e6a0555
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions js/bigwig/bwSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import pack from "../feature/featurePacker.js";

class BWSource {

constructor(config, genome) {
constructor(config, browser) {
this.reader = new BWReader(config, genome);
this.genome = genome;
this.genome = browser.genome;
this.format = config.format || "bigwig";
this.wgValues = {};
}
Expand Down
8 changes: 4 additions & 4 deletions js/feature/featureSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import BWSource from "../bigwig/bwSource.js"
import TDFSource from "../tdf/tdfSource.js"


function FeatureSource(config, genome) {
function FeatureSource(config, browser) {

const format = config.format ? config.format.toLowerCase() : undefined;
if ('bigwig' === format || 'bigbed' === format || 'bb' === format) {
return new BWSource(config, genome);
return new BWSource(config, browser);
} else if ("tdf" === format) {
return new TDFSource(config, genome);
return new TDFSource(config, browser);
} else {
return new TextFeatureSource(config, genome);
return new TextFeatureSource(config, browser);
}
}

Expand Down
9 changes: 4 additions & 5 deletions js/feature/featureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FeatureTrack extends TrackBase {
} else {
this.featureSource = config.featureSource ?
config.featureSource :
FeatureSource(config, browser.genome);
FeatureSource(config, browser);
}

// Set default heights
Expand Down Expand Up @@ -144,8 +144,7 @@ class FeatureTrack extends TrackBase {
async getFeatures(chr, start, end, bpPerPixel) {
const visibilityWindow = this.visibilityWindow;
return this.featureSource.getFeatures({chr, start, end, bpPerPixel, visibilityWindow});
};

}

/**
* The required height in pixels required for the track content. This is not the visible track height, which
Expand Down Expand Up @@ -175,7 +174,7 @@ class FeatureTrack extends TrackBase {

}

};
}

draw(options) {

Expand Down Expand Up @@ -237,7 +236,7 @@ class FeatureTrack extends TrackBase {
console.log("No feature list");
}

};
}

clickedFeatures(clickState) {

Expand Down
8 changes: 5 additions & 3 deletions js/feature/textFeatureSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ import pack from "../feature/featurePacker.js";
*/
class TextFeatureSource {

constructor(config, genome) {
constructor(config, browser) {

const genome = browser.genome;
this.config = config || {};
this.browser = browser;
this.genome = genome;
this.sourceType = (config.sourceType === undefined ? "file" : config.sourceType);
this.visibilityWindow = config.visibilityWindow;
Expand Down Expand Up @@ -232,10 +234,10 @@ class TextFeatureSource {
for (let feature of featureList) {
if (feature.name) {
//TODO igv.browser => igv.Globals or igv.FeatureDB
this.config.browser.featureDB[feature.name.toUpperCase()] = feature;
this.browser.featureDB[feature.name.toUpperCase()] = feature;
}
if (feature.gene && feature.gene.name) {
this.config.browser.featureDB[feature.gene.name.toUpperCase()] = feature;
this.browser.featureDB[feature.gene.name.toUpperCase()] = feature;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/tdf/tdfSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import GenomicInterval from "../genome/genomicInterval.js";

class TDFSource {

constructor(config, genome) {
constructor(config, browser) {

this.genome = genome;
this.genome = browser.genome;
this.windowFunction = config.windowFunction || "mean";
this.reader = new TDFReader(config, genome);
}
Expand Down

0 comments on commit e6a0555

Please sign in to comment.