Package htsjdk.samtools.fastq
Class FastqEncoder
java.lang.Object
htsjdk.samtools.fastq.FastqEncoder
Codec for encoding records into FASTQ format.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BiConsumer<FastqRecord,
SAMRecord> static final BiConsumer<FastqRecord,
SAMRecord> Encodes the quality header into the comment tag (use inasSAMRecord(FastqRecord, SAMFileHeader, BiConsumer)
. -
Method Summary
Modifier and TypeMethodDescriptionstatic FastqRecord
asFastqRecord
(SAMRecord record) Converts aSAMRecord
into aFastqRecord
.static SAMRecord
asSAMRecord
(FastqRecord record, SAMFileHeader header) Converts aFastqRecord
into a simple unmappedSAMRecord
.static SAMRecord
asSAMRecord
(FastqRecord record, SAMFileHeader header, BiConsumer<FastqRecord, SAMRecord> custom) Converts aFastqRecord
into a simple unmappedSAMRecord
.static String
encode
(FastqRecord record) Encodes a FastqRecord in the String FASTQ format.static String
Encodes a SAMRecord in the String FASTQ format.static Appendable
write
(Appendable out, FastqRecord record) Writes a FastqRecord into the Appendable output.
-
Field Details
-
QUALITY_HEADER_TO_COMMENT_TAG
Encodes the quality header into the comment tag (use inasSAMRecord(FastqRecord, SAMFileHeader, BiConsumer)
.Note that all tabs present in the quality header are replaced by spaces.
-
QUALITY_HEADER_PARSE_SAM_TAGS
-
-
Method Details
-
encode
Encodes a FastqRecord in the String FASTQ format. -
write
Writes a FastqRecord into the Appendable output.- Throws:
SAMException
- if any I/O error occurs.
-
encode
Encodes a SAMRecord in the String FASTQ format. -
asFastqRecord
Converts aSAMRecord
into aFastqRecord
. -
asSAMRecord
Converts aFastqRecord
into a simple unmappedSAMRecord
. -
asSAMRecord
public static SAMRecord asSAMRecord(FastqRecord record, SAMFileHeader header, BiConsumer<FastqRecord, SAMRecord> custom) Converts aFastqRecord
into a simple unmappedSAMRecord
.This method allows to pass a
BiConsumer
to add the information from the record in a customizable manner.- Parameters:
record
- object to encode.header
- header for the returned object.custom
- function to customize encoding. Note that default information might be overriden.
-