Skip to content

Commit

Permalink
Wrap uncached sequence object!
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Nov 29, 2023
1 parent f716e13 commit b55f23b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/org/broad/igv/feature/genome/Genome.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,24 @@ public Genome(GenomeConfig config) throws IOException {

// Load the sequence object. Some configurations will specify both 2bit and fasta references. The 2 bit
// has preference
Sequence uncachedSequence;
if (config.sequence != null) {
sequence = config.sequence;
uncachedSequence = config.sequence;
} else if (config.twoBitURL != null) {
sequence = (config.twoBitBptURL != null) ?
uncachedSequence = (config.twoBitBptURL != null) ?
new TwoBitSequence(config.twoBitURL, config.twoBitBptURL) :
new TwoBitSequence(config.twoBitURL);
} else if (config.fastaURL != null) {
String fastaPath = config.fastaURL;
String indexPath = config.indexURL;
String gziIndexPath = config.gziIndexURL;
sequence = fastaPath.endsWith(".gz") ?
uncachedSequence = fastaPath.endsWith(".gz") ?
new FastaBlockCompressedSequence(fastaPath, gziIndexPath, indexPath) :
new FastaIndexedSequence(fastaPath, indexPath);
} else {
throw new RuntimeException("Genomes require either a .2bit or fasta reference ");
}
sequence = new SequenceWrapper(uncachedSequence);

// Search for chromosomes. Chromosome names are required to support the chromosome pulldown, names and
// lengths are required to support whole genome view. Both can be obtained from fasta index files, but
Expand Down

0 comments on commit b55f23b

Please sign in to comment.