Package htsjdk.samtools
Class SAMSequenceRecord
java.lang.Object
htsjdk.samtools.AbstractSAMHeaderRecord
htsjdk.samtools.SAMSequenceRecord
- All Implemented Interfaces:
Locatable
,Serializable
,Cloneable
Header information about a reference sequence. Corresponds to @SQ header record in SAM text header.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Deprecated.static final String
This is not a valid sequence name, because it is reserved in the RNEXT field of SAM text format to mean "same reference as RNAME field."static final String
static final String
static final long
static final String
The standard tags are stored in text header without type information, because the type of these tags is known.static final int
static final int
If one sequence has this length, and another sequence had a different length, isSameSequence will not complain that they are different sequences.static final String
-
Constructor Summary
ConstructorsConstructorDescriptionSAMSequenceRecord
(String name) Deprecated.SAMSequenceRecord
(String name, int sequenceLength) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an alternative sequence name if it is not the same as the sequence name or it is not present already.final SAMSequenceRecord
clone()
boolean
Returns unmodifiable set with alternative sequence names.final String
always returnsgetSequenceName()
final int
getEnd()
always returnsgetSequenceLength()
getMd5()
Returns the record in the SAM line-based text format.int
int
final int
getStart()
always returns 1boolean
Returnstrue
if there are alternative sequence names;false
otherwise.int
hashCode()
boolean
Looser comparison than equals().setAlternativeSequenceName
(Collection<String> alternativeSequences) Sets the alternative sequence names in the order provided by iteration, removing the previous values.setAssembly
(String value) setDescription
(String value) setSequenceIndex
(int value) setSequenceLength
(int value) setSpecies
(String value) 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, setAttribute
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface htsjdk.samtools.util.Locatable
contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
UNAVAILABLE_SEQUENCE_INDEX
public static final int UNAVAILABLE_SEQUENCE_INDEX- See Also:
-
SEQUENCE_NAME_TAG
- See Also:
-
ALTERNATIVE_SEQUENCE_NAME_TAG
- See Also:
-
SEQUENCE_LENGTH_TAG
- See Also:
-
MD5_TAG
- See Also:
-
ASSEMBLY_TAG
- See Also:
-
URI_TAG
- See Also:
-
SPECIES_TAG
- See Also:
-
DESCRIPTION_TAG
- See Also:
-
UNKNOWN_SEQUENCE_LENGTH
public static final int UNKNOWN_SEQUENCE_LENGTHIf one sequence has this length, and another sequence had a different length, isSameSequence will not complain that they are different sequences.- See Also:
-
RESERVED_RNEXT_SEQUENCE_NAME
This is not a valid sequence name, because it is reserved in the RNEXT field of SAM text format to mean "same reference as RNAME field."- See Also:
-
RESERVED_MRNM_SEQUENCE_NAME
Deprecated.- See Also:
-
STANDARD_TAGS
The standard tags are stored in text header without type information, because the type of these tags is known.
-
-
Constructor Details
-
SAMSequenceRecord
Deprecated.UseSAMSequenceRecord(String, int)
instead. sequenceLength is required for the object to be considered valid. -
SAMSequenceRecord
-
-
Method Details
-
getSequenceName
-
getSequenceLength
public int getSequenceLength() -
setSequenceLength
-
getAssembly
-
setAssembly
-
getSpecies
-
setSpecies
-
getMd5
-
setMd5
-
getDescription
-
setDescription
-
getSequenceIndex
public int getSequenceIndex()- Returns:
- Index of this record in the sequence dictionary it lives in.
-
setSequenceIndex
-
getAlternativeSequenceNames
Returns unmodifiable set with alternative sequence names. -
addAlternativeSequenceName
Adds an alternative sequence name if it is not the same as the sequence name or it is not present already. -
setAlternativeSequenceName
Sets the alternative sequence names in the order provided by iteration, removing the previous values. -
hasAlternativeSequenceNames
public boolean hasAlternativeSequenceNames()Returnstrue
if there are alternative sequence names;false
otherwise. -
isSameSequence
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. -
equals
-
hashCode
public int hashCode() -
clone
-
truncateSequenceName
Truncate sequence name at first whitespace. -
validateSequenceName
Throw an exception if the sequence name is not valid. -
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
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
-
getContig
always returnsgetSequenceName()
-
getStart
public final int getStart()always returns 1 -
getEnd
public final int getEnd()always returnsgetSequenceLength()
-
SAMSequenceRecord(String, int)
instead.