Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/sources/CoverageDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function keyFunction(p: PositionCount): string {
}

function filterFunction(range: ContigInterval<string>, p: PositionCount): boolean {
return range.chrContainsLocus(p.contig, p.start);
return range.chrIntersects(new ContigInterval(p.contig, p.start, p.end));
}

function createFromCoverageUrl(remoteSource: RemoteRequest): CoverageDataSource {
Expand Down
10 changes: 9 additions & 1 deletion src/main/sources/VariantDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function keyFunction(vc: VariantContext): string {
}

function filterFunction(range: ContigInterval<string>, vc: VariantContext): boolean {
return range.chrContainsLocus(vc.variant.contig, vc.variant.position);
return range.chrIntersects(new ContigInterval(vc.variant.contig, vc.variant.position, vc.variant.end));
}

function createFromVariantUrl(remoteSource: RemoteRequest,
Expand Down Expand Up @@ -79,6 +79,14 @@ function createFromVariantUrl(remoteSource: RemoteRequest,
if (response !== null) {
// parse VariantContexts
var variants = _.map(response, v => JSON.parse(v));

// GA4GH schemas are 0-based, so we adjust the variant position
// by 1 to display correctly
variants = _.map(variants, v => {
v.variant.position += 1;
v.variant.end += 1;
return v;
});
variants.forEach(v => cache.put(v, resolution));
}
console.info(`Fetched variants from server:", ${new Date().getTime() - startTimeMilliseconds}`);
Expand Down