public class ReferenceSource extends java.lang.Object implements CRAMReferenceSource
| Constructor and Description |
|---|
ReferenceSource(java.io.File file) |
ReferenceSource(java.nio.file.Path path) |
ReferenceSource(ReferenceSequenceFile rsFile) |
| Modifier and Type | Method and Description |
|---|---|
static CRAMReferenceSource |
getDefaultCRAMReferenceSource()
Attempts to construct a default CRAMReferenceSource for use with CRAM files when
one has not been explicitly provided.
|
int |
getDownloadTriesBeforeFailing() |
byte[] |
getReferenceBases(SAMSequenceRecord record,
boolean tryNameVariants)
Get the reference bases for an entire reference contig.
|
byte[] |
getReferenceBasesByRegion(SAMSequenceRecord sequenceRecord,
int zeroBasedStart,
int requestedRegionLength)
Get the reference bases for a region of a reference contig.
|
void |
setDownloadTriesBeforeFailing(int downloadTriesBeforeFailing) |
public ReferenceSource(java.io.File file)
public ReferenceSource(java.nio.file.Path path)
public ReferenceSource(ReferenceSequenceFile rsFile)
public static CRAMReferenceSource getDefaultCRAMReferenceSource()
java.lang.IllegalArgumentException - if the reference_fasta environment variable refers to a
a file that doesn't exist
Construct a default reference source to use when an explicit reference has not been provided by checking for fallback sources in this order:
public byte[] getReferenceBases(SAMSequenceRecord record, boolean tryNameVariants)
CRAMReferenceSourcegetReferenceBases in interface CRAMReferenceSourcerecord - the SAMSequenceRecord identifying the reference being requestedtryNameVariants - if true, attempt to match the requested sequence name against the reference by
using common name variations, such as adding or removing a leading "chr" prefix
from the requested name. if false, use exact matchUtils.normalizeBase(byte))
bases representing the requested sequence, or null if the sequence cannot be foundpublic byte[] getReferenceBasesByRegion(SAMSequenceRecord sequenceRecord, int zeroBasedStart, int requestedRegionLength)
CRAMReferenceSourcerequestedRegionLength. It is the caller's responsibility to detect and handle
this case.getReferenceBasesByRegion in interface CRAMReferenceSourcesequenceRecord - the SAMSequenceRecord for the reference contig being requestedzeroBasedStart - the zero based offset of the starting reference base, must be >= 0requestedRegionLength - the length of the requested reference regionpublic int getDownloadTriesBeforeFailing()
public void setDownloadTriesBeforeFailing(int downloadTriesBeforeFailing)