Skip to content

Commit

Permalink
GA4GHDataSource only requests reads not in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
akmorrow13 committed Feb 12, 2017
1 parent ae44838 commit b71d626
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/sources/GA4GHDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,17 @@ function create(spec: GA4GHSpec): AlignmentDataSource {

interval = expandRange(interval);

// select only intervals not yet loaded into coveredRangesß
var intervals = interval.complementIntervals(coveredRanges);

// We "cover" the interval immediately (before the reads have arrived) to
// prevent duplicate network requests.
coveredRanges.push(interval);
coveredRanges = ContigInterval.coalesce(coveredRanges);
fetchAlignmentsForInterval(interval, null, 1 /* first request */);

intervals.forEach(i => {
fetchAlignmentsForInterval(i, null, 1 /* first request */);
});
}

function notifyFailure(message: string) {
Expand Down

0 comments on commit b71d626

Please sign in to comment.