Class FastqBuilder
java.lang.Object
org.biojava.nbio.sequencing.io.fastq.FastqBuilder
Fluent builder API for creating FASTQ formatted sequences.
- Since:
- 3.0.3
-
Field Summary
Modifier and TypeFieldDescriptionstatic final FastqVariant
Default FASTQ sequence format variant,FastqVariant.FASTQ_SANGER
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendQuality
(String quality) Return this FASTQ formatted sequence builder configured with the specified quality scores appended to its current quality scores.appendSequence
(String sequence) Return this FASTQ formatted sequence builder configured with the specified sequence appended to its current sequence.build()
Build and return a new FASTQ formatted sequence configured from the properties of this builder.Return the description for this FASTQ formatted sequence builder.boolean
Return true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length.withDescription
(String description) Return this FASTQ formatted sequence builder configured with the specified description.withQuality
(String quality) Return this FASTQ formatted sequence builder configured with the specified quality scores.withSequence
(String sequence) Return this FASTQ formatted sequence builder configured with the specified sequence.withVariant
(FastqVariant variant) Return this FASTQ formatted sequence builder configured with the specified FASTQ sequence format variant.
-
Field Details
-
DEFAULT_VARIANT
Default FASTQ sequence format variant,FastqVariant.FASTQ_SANGER
.
-
-
Constructor Details
-
FastqBuilder
public FastqBuilder()Create a new FASTQ formatted sequence builder.
-
-
Method Details
-
getDescription
Return the description for this FASTQ formatted sequence builder.- Returns:
- the description for this FASTQ formatted sequence builder
-
withDescription
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
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
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
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
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
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
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:
IllegalStateException
- if the configuration of this builder results in an illegal state
-