public final class LocusIteratorByState extends java.lang.Object implements java.util.Iterator<AlignmentContext>
Modifier and Type | Field and Description |
---|---|
static LIBSDownsamplingInfo |
NO_DOWNSAMPLING
Indicates that we shouldn't do any downsampling
|
Constructor and Description |
---|
LocusIteratorByState(java.util.Iterator<GATKRead> samIterator,
DownsamplingMethod downsamplingMethod,
boolean keepUniqueReadListInLIBS,
java.util.Collection<java.lang.String> samples,
htsjdk.samtools.SAMFileHeader header,
boolean includeReadsWithDeletionAtLoci)
Create a new LocusIteratorByState
|
LocusIteratorByState(java.util.Iterator<GATKRead> samIterator,
DownsamplingMethod downsamplingMethod,
boolean keepUniqueReadListInLIBS,
java.util.Collection<java.lang.String> samples,
htsjdk.samtools.SAMFileHeader header,
boolean includeReadsWithDeletionAtLoci,
boolean includeReadsWithNsAtLoci)
Create a new LocusIteratorByState
|
LocusIteratorByState(java.util.Iterator<GATKRead> samIterator,
LIBSDownsamplingInfo downsamplingInfo,
boolean keepUniqueReadListInLIBS,
java.util.Collection<java.lang.String> samples,
htsjdk.samtools.SAMFileHeader header,
boolean includeReadsWithDeletionAtLoci)
Create a new LocusIteratorByState
|
LocusIteratorByState(java.util.Iterator<GATKRead> samIterator,
LIBSDownsamplingInfo downsamplingInfo,
boolean keepUniqueReadListInLIBS,
java.util.Collection<java.lang.String> samples,
htsjdk.samtools.SAMFileHeader header,
boolean includeReadsWithDeletionAtLoci,
boolean includeReadsWithNsAtLoci)
Create a new LocusIteratorByState
|
Modifier and Type | Method and Description |
---|---|
AlignmentContext |
advanceToLocus(int position,
boolean stopAtFirstNonEmptySiteAfterPosition)
Move this LIBS until we are over position
Will return null if cannot reach position (because we run out of data in the locus)
|
boolean |
hasNext()
Is there another pileup available?
|
AlignmentContext |
next()
Get the next AlignmentContext available from the reads.
|
java.util.List<GATKRead> |
transferReadsFromAllPreviousPileups()
Transfer current list of all unique reads that have ever been used in any pileup, clearing old list
This list is guaranteed to only contain unique reads, even across calls to the this function.
|
public static final LIBSDownsamplingInfo NO_DOWNSAMPLING
public LocusIteratorByState(java.util.Iterator<GATKRead> samIterator, DownsamplingMethod downsamplingMethod, boolean keepUniqueReadListInLIBS, java.util.Collection<java.lang.String> samples, htsjdk.samtools.SAMFileHeader header, boolean includeReadsWithDeletionAtLoci)
samIterator
- the iterator of reads to process into pileups. Reads must be ordered
according to standard coordinate-sorted BAM conventionsdownsamplingMethod
- information about how to downsample the readskeepUniqueReadListInLIBS
- if true, we will keep the unique reads from the samIterator and make them
available via the transferReadsFromAllPreviousPileups interfacesamples
- a complete list of samples present in the read groups for the reads coming from samIterator.
This is generally just the set of read group sample fields in the SAMFileHeader. This
list of samples may contain a null element, and all reads without read groups will
be mapped to this null sampleheader
- header from the readsincludeReadsWithDeletionAtLoci
- Include reads with deletion at locipublic LocusIteratorByState(java.util.Iterator<GATKRead> samIterator, DownsamplingMethod downsamplingMethod, boolean keepUniqueReadListInLIBS, java.util.Collection<java.lang.String> samples, htsjdk.samtools.SAMFileHeader header, boolean includeReadsWithDeletionAtLoci, boolean includeReadsWithNsAtLoci)
samIterator
- the iterator of reads to process into pileups. Reads must be ordered
according to standard coordinate-sorted BAM conventionsdownsamplingMethod
- information about how to downsample the readskeepUniqueReadListInLIBS
- if true, we will keep the unique reads from the samIterator and make them
available via the transferReadsFromAllPreviousPileups interfacesamples
- a complete list of samples present in the read groups for the reads coming from samIterator.
This is generally just the set of read group sample fields in the SAMFileHeader. This
list of samples may contain a null element, and all reads without read groups will
be mapped to this null sampleheader
- header from the readsincludeReadsWithDeletionAtLoci
- Include reads with deletion at lociincludeReadsWithNsAtLoci
- Include reads with Ns at loci (usually it is not needed)public LocusIteratorByState(java.util.Iterator<GATKRead> samIterator, LIBSDownsamplingInfo downsamplingInfo, boolean keepUniqueReadListInLIBS, java.util.Collection<java.lang.String> samples, htsjdk.samtools.SAMFileHeader header, boolean includeReadsWithDeletionAtLoci)
samIterator
- the iterator of reads to process into pileups. Reads must be ordered
according to standard coordinate-sorted BAM conventionsdownsamplingInfo
- meta-information about how to downsample the readskeepUniqueReadListInLIBS
- if true, we will keep the unique reads from the samIterator and make them
available via the transferReadsFromAllPreviousPileups interfacesamples
- a complete list of samples present in the read groups for the reads coming from samIterator.
This is generally just the set of read group sample fields in the SAMFileHeader. This
list of samples may contain a null element, and all reads without read groups will
be mapped to this null sampleheader
- header from the readsincludeReadsWithDeletionAtLoci
- Include reads with deletion at locipublic LocusIteratorByState(java.util.Iterator<GATKRead> samIterator, LIBSDownsamplingInfo downsamplingInfo, boolean keepUniqueReadListInLIBS, java.util.Collection<java.lang.String> samples, htsjdk.samtools.SAMFileHeader header, boolean includeReadsWithDeletionAtLoci, boolean includeReadsWithNsAtLoci)
samIterator
- the iterator of reads to process into pileups. Reads must be ordered
according to standard coordinate-sorted BAM conventionsdownsamplingInfo
- meta-information about how to downsample the readskeepUniqueReadListInLIBS
- if true, we will keep the unique reads from the samIterator and make them
available via the transferReadsFromAllPreviousPileups interfacesamples
- a complete list of samples present in the read groups for the reads coming from samIterator.
This is generally just the set of read group sample fields in the SAMFileHeader. This
list of samples may contain a null element, and all reads without read groups will
be mapped to this null sampleheader
- header from the readsincludeReadsWithDeletionAtLoci
- Include reads with deletion at lociincludeReadsWithNsAtLoci
- Include reads with Ns at loci (usually it is not needed)public boolean hasNext()
hasNext
in interface java.util.Iterator<AlignmentContext>
public AlignmentContext next()
next
in interface java.util.Iterator<AlignmentContext>
public AlignmentContext advanceToLocus(int position, boolean stopAtFirstNonEmptySiteAfterPosition)
position
- the start position of the AlignmentContext we want backstopAtFirstNonEmptySiteAfterPosition
- if true, we will stop as soon as we find a context with data with
position >= position, otherwise we will return a null value
and consume the data for the next position. This means that without
specifying this value the LIBS will be in an indeterminate state
after calling this function, and should be reconstructed from scratch
for subsequent usepublic java.util.List<GATKRead> transferReadsFromAllPreviousPileups()
java.lang.UnsupportedOperationException
- if called when keepingSubmittedReads is false