Package htsjdk.samtools
Class SAMTextHeaderCodec
java.lang.Object
htsjdk.samtools.SAMTextHeaderCodec
Parser for a SAM text header, and a generator of SAM text header.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode
(LineReader reader, String source) Reads text SAM header and converts to a SAMFileHeader object.void
encode
(Writer writer, SAMFileHeader header) Convert SAMFileHeader from in-memory representation to text representation.void
encode
(Writer writer, SAMFileHeader header, boolean keepExistingVersionNumber) Convert SAMFileHeader from in-memory representation to text representation.protected String
getPGLine
(SAMProgramRecord programRecord) protected String
getRGLine
(SAMReadGroupRecord readGroup) protected String
getSQLine
(SAMSequenceRecord sequenceRecord) void
setValidationStringency
(ValidationStringency validationStringency)
-
Field Details
-
COMMENT_PREFIX
-
-
Constructor Details
-
SAMTextHeaderCodec
public SAMTextHeaderCodec()
-
-
Method Details
-
decode
Reads text SAM header and converts to a SAMFileHeader object.- Parameters:
reader
- Where to get header text from.source
- Name of the input file, for error messages. May be null.- Returns:
- complete header object.
-
encode
Convert SAMFileHeader from in-memory representation to text representation. Always writes SAMFileHeader.CURRENT_VERSION as the version in the header.- Parameters:
writer
- where to write the header text.header
- object to be converted to text.
-
encode
Convert SAMFileHeader from in-memory representation to text representation.- Parameters:
writer
- where to write the header text.header
- object to be converted to text.keepExistingVersionNumber
- If true, writes whatever version # was in the header. If false, writes SAMFileHeader.CURRENT_VERSION.
-
getPGLine
-
getRGLine
-
getSQLine
-
setValidationStringency
-