Package htsjdk.samtools.fastq
Class FastqRecord
- java.lang.Object
-
- htsjdk.samtools.fastq.FastqRecord
-
- All Implemented Interfaces:
Serializable
public class FastqRecord extends Object implements Serializable
Simple representation of a FASTQ record, without any conversion- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FastqRecord(FastqRecord other)Copy constructorFastqRecord(String readName, byte[] readBases, String qualityHeader, byte[] baseQualities)Constructor for byte[] arraysFastqRecord(String readName, String readBases, String qualityHeader, String baseQualities)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)byte[]getBaseQualities()Get the base qualities as binary PHRED scores (not ASCII)StringgetBaseQualityHeader()Get the base quality headerStringgetBaseQualityString()Get the base qualities encoded as a FASTQ stringbyte[]getReadBases()Get the DNA sequence.StringgetReadHeader()Deprecated.since 02/2017.intgetReadLength()Get the read lengthStringgetReadName()Get the read nameStringgetReadString()Get the DNA sequenceinthashCode()intlength()Deprecated.since 02/2017.StringtoFastQString()Returns the record as the String FASTQ format.StringtoString()ReturnstoFastQString().
-
-
-
Constructor Detail
-
FastqRecord
public FastqRecord(String readName, String readBases, String qualityHeader, String baseQualities)
Default constructor- Parameters:
readName- the read name (withoutFastqConstants.SEQUENCE_HEADER)readBases- the read sequence basesqualityHeader- the quality header (withoutFastqConstants.SEQUENCE_HEADER)baseQualities- the base quality scores
-
FastqRecord
public FastqRecord(String readName, byte[] readBases, String qualityHeader, byte[] baseQualities)
Constructor for byte[] arrays- Parameters:
readName- the read name (withoutFastqConstants.SEQUENCE_HEADER)readBases- the read sequence bases as ASCII bytes ACGTN=.qualityHeader- the quality header (withoutFastqConstants.SEQUENCE_HEADER)baseQualities- the base qualities as binary PHRED scores (not ASCII)
-
FastqRecord
public FastqRecord(FastqRecord other)
Copy constructor- Parameters:
other- record to copy
-
-
Method Detail
-
getReadHeader
@Deprecated public String getReadHeader()
Deprecated.since 02/2017. UsegetReadName()instead- Returns:
- the read name
-
getReadName
public String getReadName()
Get the read name- Returns:
- the read name (may be
null).
-
getReadString
public String getReadString()
Get the DNA sequence- Returns:
- read sequence as a string of ACGTN= (may be
null).
-
getReadBases
public byte[] getReadBases()
Get the DNA sequence.- Returns:
- read sequence as ASCII bytes ACGTN=;
SAMRecord.NULL_SEQUENCEif no bases are present.
-
getBaseQualityString
public String getBaseQualityString()
Get the base qualities encoded as a FASTQ string- Returns:
- the quality string (may be
null).
-
getBaseQualities
public byte[] getBaseQualities()
Get the base qualities as binary PHRED scores (not ASCII)- Returns:
- the base quality;
SAMRecord.NULL_QUALSif no bases are present.
-
getReadLength
public int getReadLength()
Get the read length- Returns:
- number of bases in the read
-
getBaseQualityHeader
public String getBaseQualityHeader()
Get the base quality header- Returns:
- the base quality header (may be
null).
-
length
@Deprecated public int length()
Deprecated.since 02/2017. UsegetReadLength()insteadshortcut to getReadString().length()
-
toFastQString
public String toFastQString()
Returns the record as the String FASTQ format.- See Also:
FastqEncoder.encode(FastqRecord)
-
toString
public String toString()
ReturnstoFastQString(). WARNING: This method will be changed in the future for a simpler representation of the object. For code relying on the formatting as a FASTQ String, please refactor your code to usetoFastQString().
-
-