Package htsjdk.samtools
Class SAMTextHeaderCodec
- java.lang.Object
-
- htsjdk.samtools.SAMTextHeaderCodec
-
public class SAMTextHeaderCodec extends Object
Parser for a SAM text header, and a generator of SAM text header.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMENT_PREFIX
-
Constructor Summary
Constructors Constructor Description SAMTextHeaderCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SAMFileHeaderdecode(LineReader reader, String source)Reads text SAM header and converts to a SAMFileHeader object.voidencode(Writer writer, SAMFileHeader header)Convert SAMFileHeader from in-memory representation to text representation.voidencode(Writer writer, SAMFileHeader header, boolean keepExistingVersionNumber)Convert SAMFileHeader from in-memory representation to text representation.protected StringgetPGLine(SAMProgramRecord programRecord)protected StringgetRGLine(SAMReadGroupRecord readGroup)protected StringgetSQLine(SAMSequenceRecord sequenceRecord)voidsetValidationStringency(ValidationStringency validationStringency)
-
-
-
Field Detail
-
COMMENT_PREFIX
public static final String COMMENT_PREFIX
-
-
Method Detail
-
decode
public SAMFileHeader decode(LineReader reader, String source)
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
public void encode(Writer writer, SAMFileHeader header)
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
public void encode(Writer writer, SAMFileHeader header, boolean keepExistingVersionNumber)
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
protected String getPGLine(SAMProgramRecord programRecord)
-
getRGLine
protected String getRGLine(SAMReadGroupRecord readGroup)
-
getSQLine
protected String getSQLine(SAMSequenceRecord sequenceRecord)
-
setValidationStringency
public void setValidationStringency(ValidationStringency validationStringency)
-
-