Class FastqBuilder


  • public final class FastqBuilder
    extends java.lang.Object
    Fluent builder API for creating FASTQ formatted sequences.
    Since:
    1.7.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static FastqVariant DEFAULT_VARIANT
      Default FASTQ sequence format variant, FastqVariant.FASTQ_SANGER.
    • Constructor Summary

      Constructors 
      Constructor Description
      FastqBuilder()
      Create a new FASTQ formatted sequence builder.
      FastqBuilder​(Fastq fastq)
      Create a new FASTQ formatted sequence builder configured from the specified FASTQ formatted sequence.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FastqBuilder appendQuality​(java.lang.String quality)
      Return this FASTQ formatted sequence builder configured with the specified quality scores appended to its current quality scores.
      FastqBuilder appendSequence​(java.lang.String sequence)
      Return this FASTQ formatted sequence builder configured with the specified sequence appended to its current sequence.
      Fastq build()
      Build and return a new FASTQ formatted sequence configured from the properties of this builder.
      java.lang.String getDescription()
      Return the description for this FASTQ formatted sequence builder.
      boolean sequenceAndQualityLengthsMatch()
      Return true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length.
      FastqBuilder withDescription​(java.lang.String description)
      Return this FASTQ formatted sequence builder configured with the specified description.
      FastqBuilder withQuality​(java.lang.String quality)
      Return this FASTQ formatted sequence builder configured with the specified quality scores.
      FastqBuilder withSequence​(java.lang.String sequence)
      Return this FASTQ formatted sequence builder configured with the specified sequence.
      FastqBuilder withVariant​(FastqVariant variant)
      Return this FASTQ formatted sequence builder configured with the specified FASTQ sequence format variant.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • FastqBuilder

        public FastqBuilder()
        Create a new FASTQ formatted sequence builder.
      • FastqBuilder

        public FastqBuilder​(Fastq fastq)
        Create a new FASTQ formatted sequence builder configured from the specified FASTQ formatted sequence.
        Parameters:
        fastq - FASTQ formatted sequence, must not be null
        Since:
        1.9.5
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Return the description for this FASTQ formatted sequence builder.
        Returns:
        the description for this FASTQ formatted sequence builder
      • withDescription

        public FastqBuilder withDescription​(java.lang.String description)
        Return this FASTQ formatted sequence builder configured with the specified description.
        Parameters:
        description - description for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified description
      • withSequence

        public FastqBuilder withSequence​(java.lang.String sequence)
        Return this FASTQ formatted sequence builder configured with the specified sequence.
        Parameters:
        sequence - sequence for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified sequence
      • appendSequence

        public FastqBuilder appendSequence​(java.lang.String sequence)
        Return this FASTQ formatted sequence builder configured with the specified sequence appended to its current sequence.
        Parameters:
        sequence - sequence to append to the sequence for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified sequence appended to its current sequence
      • withQuality

        public FastqBuilder withQuality​(java.lang.String quality)
        Return this FASTQ formatted sequence builder configured with the specified quality scores.
        Parameters:
        quality - quality scores for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified quality scores
      • appendQuality

        public FastqBuilder appendQuality​(java.lang.String quality)
        Return this FASTQ formatted sequence builder configured with the specified quality scores appended to its current quality scores.
        Parameters:
        quality - quality scores to append to the quality scores for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified quality scores appended to its current quality scores
      • sequenceAndQualityLengthsMatch

        public boolean sequenceAndQualityLengthsMatch()
        Return true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length.
        Returns:
        true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length
      • withVariant

        public FastqBuilder withVariant​(FastqVariant variant)
        Return this FASTQ formatted sequence builder configured with the specified FASTQ sequence format variant.
        Parameters:
        variant - FASTQ sequence format variant for this FASTQ formatted sequence builder, must not be null
        Returns:
        this FASTQ formatted sequence builder configured with the specified FASTQ sequence format variant
      • build

        public Fastq build()
        Build and return a new FASTQ formatted sequence configured from the properties of this builder.
        Returns:
        a new FASTQ formatted sequence configured from the properties of this builder
        Throws:
        java.lang.IllegalStateException - if the configuration of this builder results in an illegal state