Package htsjdk.samtools.reference
Class FastaSequenceIndexEntry
- java.lang.Object
-
- htsjdk.samtools.reference.FastaSequenceIndexEntry
-
public class FastaSequenceIndexEntry extends Object
Hold an individual entry in a fasta sequence index file.
-
-
Constructor Summary
Constructors Constructor Description FastaSequenceIndexEntry(String contig, long location, long size, int basesPerLine, int bytesPerLine, int sequenceIndex)Create a new entry with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Compare this index entry to another index entry.intgetBasesPerLine()Gets the number of bases in a given line.intgetBytesPerLine()How many bytes (bases + whitespace) are consumed by the given line?StringgetContig()Gets the contig associated with this entry.longgetLocation()Gets the location of this contig within the fasta.intgetSequenceIndex()longgetSize()Gets the size, in bytes, of the data in the contig.inthashCode()In general, we expect one entry per contig, so compute the hash based only on the contig.protected voidsetContig(String contig)Sometimes contigs need to be adjusted on-the-fly to match sequence dictionary entries.StringtoString()For debugging.
-
-
-
Constructor Detail
-
FastaSequenceIndexEntry
public FastaSequenceIndexEntry(String contig, long location, long size, int basesPerLine, int bytesPerLine, int sequenceIndex)
Create a new entry with the given parameters.- Parameters:
contig- Contig this entry represents.location- Location (byte coordinate) in the fasta file.size- The number of bases in the contig.basesPerLine- How many bases are on each line.bytesPerLine- How many bytes are on each line (includes newline characters).
-
-
Method Detail
-
getContig
public String getContig()
Gets the contig associated with this entry.- Returns:
- String representation of the contig.
-
setContig
protected void setContig(String contig)
Sometimes contigs need to be adjusted on-the-fly to match sequence dictionary entries. Provide that capability to other classes w/i the package.- Parameters:
contig- New value for the contig.
-
getLocation
public long getLocation()
Gets the location of this contig within the fasta.- Returns:
- seek position within the fasta.
-
getSize
public long getSize()
Gets the size, in bytes, of the data in the contig.- Returns:
- size of the contig bases in bytes.
-
getBasesPerLine
public int getBasesPerLine()
Gets the number of bases in a given line.- Returns:
- Number of bases in the fasta line.
-
getBytesPerLine
public int getBytesPerLine()
How many bytes (bases + whitespace) are consumed by the given line?- Returns:
- Number of bytes in a line.
-
getSequenceIndex
public int getSequenceIndex()
-
toString
public String toString()
For debugging. Emit the contents of each contig line.
-
equals
public boolean equals(Object other)
Compare this index entry to another index entry.
-
-