use of com.milaboratory.core.sequence.provider.SequenceProviderFactory in project repseqio by repseqio.
the class AbstractRAFastaResolver method resolve.
@Override
public CachedSequenceProvider<NucleotideSequence> resolve(final SequenceAddress address) {
final URI uri = address.getUri();
CachedSequenceProvider<NucleotideSequence> provider = records.get(uri);
if (provider == null) {
final String recordId = resolveRecordId(uri);
records.put(uri, provider = new CachedSequenceProvider<>(NucleotideSequence.ALPHABET, SequenceProviderUtils.lazyProvider(new SequenceProviderFactory<NucleotideSequence>() {
@Override
public SequenceProvider<NucleotideSequence> create() {
RandomAccessFastaReader<NucleotideSequence> fasta = resolveReader(address);
return fasta.getSequenceProvider(recordId);
}
})));
}
return provider;
}
Aggregations