Package htsjdk.samtools
Class SAMSequenceRecord
- java.lang.Object
-
- htsjdk.samtools.AbstractSAMHeaderRecord
-
- htsjdk.samtools.SAMSequenceRecord
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class SAMSequenceRecord extends AbstractSAMHeaderRecord implements Cloneable
Header information about a reference sequence. Corresponds to @SQ header record in SAM text header.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASSEMBLY_TAG
static String
MD5_TAG
static String
RESERVED_MRNM_SEQUENCE_NAME
This is not a valid sequence name, because it is reserved in the MRNM field of SAM text format to mean "same reference as RNAME field."static String
SEQUENCE_LENGTH_TAG
static String
SEQUENCE_NAME_TAG
static long
serialVersionUID
static String
SPECIES_TAG
static Set<String>
STANDARD_TAGS
The standard tags are stored in text header without type information, because the type of these tags is known.static int
UNKNOWN_SEQUENCE_LENGTH
If one sequence has this length, and another sequence had a different length, isSameSequence will not complain that they are different sequences.static String
URI_TAG
-
Constructor Summary
Constructors Constructor Description SAMSequenceRecord(String name)
Deprecated.UseSAMSequenceRecord(String, int)
instead.SAMSequenceRecord(String name, int sequenceLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SAMSequenceRecord
clone()
boolean
equals(Object o)
String
getAssembly()
String
getMd5()
String
getSAMString()
Returns the record in the SAM line-based text format.int
getSequenceIndex()
int
getSequenceLength()
String
getSequenceName()
String
getSpecies()
int
hashCode()
boolean
isSameSequence(SAMSequenceRecord that)
Looser comparison than equals().void
setAssembly(String value)
void
setMd5(String value)
void
setSequenceIndex(int value)
void
setSequenceLength(int value)
void
setSpecies(String value)
String
toString()
Simple to String that outputs the concrete class name and the set of attributes stored.static String
truncateSequenceName(String sequenceName)
Truncate sequence name at first whitespace.static void
validateSequenceName(String name)
Throw an exception if the sequence name is not valid.-
Methods inherited from class htsjdk.samtools.AbstractSAMHeaderRecord
attributesEqual, attributesHashCode, getAttribute, getAttributes, getId, setAttribute, setAttribute
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
SEQUENCE_NAME_TAG
public static final String SEQUENCE_NAME_TAG
- See Also:
- Constant Field Values
-
SEQUENCE_LENGTH_TAG
public static final String SEQUENCE_LENGTH_TAG
- See Also:
- Constant Field Values
-
MD5_TAG
public static final String MD5_TAG
- See Also:
- Constant Field Values
-
ASSEMBLY_TAG
public static final String ASSEMBLY_TAG
- See Also:
- Constant Field Values
-
URI_TAG
public static final String URI_TAG
- See Also:
- Constant Field Values
-
SPECIES_TAG
public static final String SPECIES_TAG
- See Also:
- Constant Field Values
-
UNKNOWN_SEQUENCE_LENGTH
public static final int UNKNOWN_SEQUENCE_LENGTH
If one sequence has this length, and another sequence had a different length, isSameSequence will not complain that they are different sequences.- See Also:
- Constant Field Values
-
RESERVED_MRNM_SEQUENCE_NAME
public static final String RESERVED_MRNM_SEQUENCE_NAME
This is not a valid sequence name, because it is reserved in the MRNM field of SAM text format to mean "same reference as RNAME field."- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SAMSequenceRecord
@Deprecated public SAMSequenceRecord(String name)
Deprecated.UseSAMSequenceRecord(String, int)
instead. sequenceLength is required for the object to be considered valid.
-
SAMSequenceRecord
public SAMSequenceRecord(String name, int sequenceLength)
-
-
Method Detail
-
getSequenceName
public String getSequenceName()
-
getSequenceLength
public int getSequenceLength()
-
setSequenceLength
public void setSequenceLength(int value)
-
getAssembly
public String getAssembly()
-
setAssembly
public void setAssembly(String value)
-
getSpecies
public String getSpecies()
-
setSpecies
public void setSpecies(String value)
-
getMd5
public String getMd5()
-
setMd5
public void setMd5(String value)
-
getSequenceIndex
public int getSequenceIndex()
- Returns:
- Index of this record in the sequence dictionary it lives in.
-
setSequenceIndex
public void setSequenceIndex(int value)
-
isSameSequence
public boolean isSameSequence(SAMSequenceRecord that)
Looser comparison than equals(). We look only at sequence index, sequence length, and MD5 tag value (or sequence names, if there is no MD5 tag in either record.
-
clone
public final SAMSequenceRecord clone()
-
truncateSequenceName
public static String truncateSequenceName(String sequenceName)
Truncate sequence name at first whitespace.
-
validateSequenceName
public static void validateSequenceName(String name)
Throw an exception if the sequence name is not valid.
-
toString
public String toString()
Description copied from class:AbstractSAMHeaderRecord
Simple to String that outputs the concrete class name and the set of attributes stored.- Overrides:
toString
in classAbstractSAMHeaderRecord
-
getSAMString
public String getSAMString()
Description copied from class:AbstractSAMHeaderRecord
Returns the record in the SAM line-based text format. Fields are separated by '\t' characters. The String is NOT terminated by '\n'.- Specified by:
getSAMString
in classAbstractSAMHeaderRecord
-
-