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:
  • Constructor Details

    • FastqRecord

      public FastqRecord(String readName, String readBases, String qualityHeader, String baseQualities)
      Default constructor
      Parameters:
      readName - the read name (without FastqConstants.SEQUENCE_HEADER)
      readBases - the read sequence bases
      qualityHeader - the quality header (without FastqConstants.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 (without FastqConstants.SEQUENCE_HEADER)
      readBases - the read sequence bases as ASCII bytes ACGTN=.
      qualityHeader - the quality header (without FastqConstants.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 Details

    • getReadHeader

      @Deprecated public String getReadHeader()
      Deprecated.
      since 02/2017. Use getReadName() 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_SEQUENCE if 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_QUALS if 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. Use getReadLength() instead
      shortcut to getReadString().length()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toFastQString

      public String toFastQString()
      Returns the record as the String FASTQ format.
      See Also:
    • toString

      public String toString()
      Returns toFastQString(). 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 use toFastQString().
      Overrides:
      toString in class Object