public abstract class AbstractLocusIterator<T extends AbstractRecordAndOffset,K extends AbstractLocusInfo<T>> extends Object implements Iterable<K>, CloseableIterator<K>
Modifier and Type | Field and Description |
---|---|
protected boolean |
includeIndels
If true, include indels in the LocusInfo
|
Constructor and Description |
---|
AbstractLocusIterator(SamReader samReader,
IntervalList intervalList,
boolean useIndex)
Prepare to iterate through the given SAM records, skipping non-primary alignments
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes inner
SamIterator>. |
protected Interval |
getCurrentInterval() |
protected List<Interval> |
getIntervals() |
int |
getMappingQualityScoreCutoff() |
int |
getMaxReadsToAccumulatePerLocus() |
int |
getQualityScoreCutoff() |
protected SAMSequenceRecord |
getReferenceSequence(int referenceSequenceIndex) |
boolean |
hasNext()
Returns true if there are more AbstractLocusInfo
|
boolean |
isEmitUncoveredLoci() |
boolean |
isIncludeIndels() |
boolean |
isIncludeNonPfReads() |
Iterator<K> |
iterator() |
K |
next()
hasNext() has been fixed so that if it returns true, next() is now guaranteed not to return null.
|
void |
remove() |
void |
setEmitUncoveredLoci(boolean emitUncoveredLoci) |
void |
setIncludeIndels(boolean includeIndels) |
void |
setIncludeNonPfReads(boolean includeNonPfReads) |
void |
setMappingQualityScoreCutoff(int mappingQualityScoreCutoff) |
void |
setMaxReadsToAccumulatePerLocus(int maxReadsToAccumulatePerLocus)
If set, this will cap the number of reads we accumulate for any given position.
|
void |
setQualityScoreCutoff(int qualityScoreCutoff) |
void |
setSamFilters(List<SamRecordFilter> samFilters)
Controls which, if any, SAMRecords are filtered.
|
protected static boolean |
startWithInsertion(Cigar cigar)
Check if cigar start with an insertion, ignoring other operators that do not consume references bases
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
stream, toList
forEachRemaining
public AbstractLocusIterator(SamReader samReader, IntervalList intervalList, boolean useIndex)
samReader
- must be coordinate sortedintervalList
- Either the list of desired intervals, or null. Note that if an intervalList is
passed in that is not coordinate sorted, it will eventually be coordinated sorted by this class.useIndex
- If true, do indexed lookup to improve performance. Not relevant if intervalList == null.
It is no longer the case the useIndex==true can make performance worse. It should always perform at least
as well as useIndex==false, and generally will be much faster.public Iterator<K> iterator()
iterator
in interface Iterable<K extends AbstractLocusInfo<T>>
emitUncoveredLoci
value.public void close()
SamIterator>.
close
in interface CloseableIterator<K extends AbstractLocusInfo<T>>
close
in interface Closeable
close
in interface AutoCloseable
public boolean hasNext()
hasNext
in interface Iterator<K extends AbstractLocusInfo<T>>
public K next()
next
in interface Iterator<K extends AbstractLocusInfo<T>>
protected SAMSequenceRecord getReferenceSequence(int referenceSequenceIndex)
public void remove()
remove
in interface Iterator<K extends AbstractLocusInfo<T>>
protected static boolean startWithInsertion(Cigar cigar)
cigar
- the cigartrue
if the first operator to consume reference bases or be an insertion, is an insertion; false
otherwisepublic void setSamFilters(List<SamRecordFilter> samFilters)
samFilters
- list of filters, or null if no filtering is desired.public int getQualityScoreCutoff()
public void setQualityScoreCutoff(int qualityScoreCutoff)
public int getMappingQualityScoreCutoff()
public void setMappingQualityScoreCutoff(int mappingQualityScoreCutoff)
public boolean isIncludeNonPfReads()
public void setIncludeNonPfReads(boolean includeNonPfReads)
public boolean isEmitUncoveredLoci()
public void setEmitUncoveredLoci(boolean emitUncoveredLoci)
public int getMaxReadsToAccumulatePerLocus()
public void setMaxReadsToAccumulatePerLocus(int maxReadsToAccumulatePerLocus)
protected Interval getCurrentInterval()
public boolean isIncludeIndels()
public void setIncludeIndels(boolean includeIndels)