public final class ReadsContext extends java.lang.Object implements java.lang.Iterable<GATKRead>
hasBackingDataSource()
, and whether there is an interval via getInterval()
.Constructor and Description |
---|
ReadsContext()
Create an empty ReadsContext with no backing data source or interval.
|
ReadsContext(GATKDataSource<GATKRead> dataSource,
SimpleInterval interval)
Create a ReadsContext backed by the supplied source of reads.
|
ReadsContext(GATKDataSource<GATKRead> dataSource,
SimpleInterval interval,
ReadFilter readFilter)
Create a ReadsContext backed by the supplied source of reads.
|
Modifier and Type | Method and Description |
---|---|
SimpleInterval |
getInterval()
Gets the interval spanned by this context (returned reads will overlap this interval).
|
boolean |
hasBackingDataSource()
Does this context have a backing source of reads data?
|
java.util.Iterator<GATKRead> |
iterator()
Get an iterator over the reads in this context.
|
java.util.Iterator<GATKRead> |
iterator(SimpleInterval interval)
Get an iterator over the reads of the backing data source over a given interval.
|
public ReadsContext()
iterator()
on this context will always return an empty iterator.public ReadsContext(GATKDataSource<GATKRead> dataSource, SimpleInterval interval)
iterator()
will return reads overlapping the provided interval. The data source and/or interval
may be null, in which case all calls to iterator()
will return an empty iterator.dataSource
- backing source of reads data (may be null)interval
- interval over which to query (may be null)public ReadsContext(GATKDataSource<GATKRead> dataSource, SimpleInterval interval, ReadFilter readFilter)
iterator()
will return reads overlapping the provided interval, and passing the provided read filter (if non-null).
The data source and/or interval may be null, in which case all calls to iterator()
will return an
empty iterator.dataSource
- backing source of reads data (may be null)interval
- interval over which to query (may be null)readFilter
- read filter to be used to filter reads during iteration (may be null)public boolean hasBackingDataSource()
public SimpleInterval getInterval()
public java.util.Iterator<GATKRead> iterator()
iterator
in interface java.lang.Iterable<GATKRead>
public java.util.Iterator<GATKRead> iterator(SimpleInterval interval)