SAMFileSpan
, Serializable
, Cloneable
public class BAMFileSpan extends Object implements SAMFileSpan, Serializable
Constructor | Description |
---|---|
BAMFileSpan() |
Create a new empty list of chunks.
|
BAMFileSpan(Chunk chunk) |
Convenience constructor to construct a BAM file span from
a single chunk.
|
BAMFileSpan(List<Chunk> chunks) |
Create a new chunk list from the given list of chunks.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
add(BAMFileSpan span) |
Merge one span into another
|
protected void |
add(Chunk chunk) |
Adds a new chunk to this list.
|
BAMFileSpan |
clone() |
Deep clone the given chunk list.
|
List<Chunk> |
getChunks() |
Gets the constituent chunks stored in this span.
|
SAMFileSpan |
getContentsFollowing() |
Gets a file span over the data immediately following this span.
|
long |
getFirstOffset() |
Find the first offset in the chunk list
|
protected Chunk |
getSingleChunk() |
Checks that there is only a single chunk for this span and returns it.
|
boolean |
isEmpty() |
Does this chunk list map to any position within the BAM file?
|
static BAMFileSpan |
merge(BAMFileSpan[] spans) |
|
SAMFileSpan |
removeContentsAfter(SAMFileSpan fileSpan) |
Creates a new file span by removing all chunks after the given file span ends.
|
SAMFileSpan |
removeContentsBefore(SAMFileSpan fileSpan) |
Creates a new file span by removing all chunks before the given file span starts.
|
protected static SAMFileSpan |
toChunkList(long[] coordinateArray) |
The list of chunks is often represented as an array of
longs where every even-numbered index is a start coordinate
and every odd-numbered index is a stop coordinate.
|
long[] |
toCoordinateArray() |
Convert the chunk list to an array of offsets, paired in [start,end) format.
|
String |
toString() |
Creates a string representation of this chunk list.
|
public BAMFileSpan()
public BAMFileSpan(Chunk chunk)
chunk
- Chunk to use as the sole region in this span.public boolean isEmpty()
isEmpty
in interface SAMFileSpan
public BAMFileSpan clone()
public SAMFileSpan removeContentsBefore(SAMFileSpan fileSpan)
removeContentsBefore
in interface SAMFileSpan
fileSpan
- The filespan before which to eliminate.public SAMFileSpan removeContentsAfter(SAMFileSpan fileSpan)
fileSpan
- The filespan after which to eliminate.public SAMFileSpan getContentsFollowing()
getContentsFollowing
in interface SAMFileSpan
protected void add(BAMFileSpan span)
span
- - span with chunks to add to this oneprotected void add(Chunk chunk)
chunk
- Chunk to add.public long[] toCoordinateArray()
public long getFirstOffset()
public List<Chunk> getChunks()
protected Chunk getSingleChunk()
protected static SAMFileSpan toChunkList(long[] coordinateArray)
coordinateArray
- List of chunks to convert.public String toString()
public static BAMFileSpan merge(BAMFileSpan[] spans)