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 Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final StringThis 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 Stringstatic final Stringstatic final longstatic final StringThe standard tags are stored in text header without type information, because the type of these tags is known.static final intstatic final intIf 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 TypeMethodDescriptionvoidAdds an alternative sequence name if it is not the same as the sequence name or it is not present already.final SAMSequenceRecordclone()booleanReturns unmodifiable set with alternative sequence names.final Stringalways returnsgetSequenceName()final intgetEnd()always returnsgetSequenceLength()getMd5()Returns the record in the SAM line-based text format.intintfinal intgetStart()always returns 1booleanReturnstrueif there are alternative sequence names;falseotherwise.inthashCode()booleanLooser 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 StringtruncateSequenceName(String sequenceName) Truncate sequence name at first whitespace.static voidvalidateSequenceName(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, setAttributeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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()Returnstrueif there are alternative sequence names;falseotherwise. -
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:AbstractSAMHeaderRecordSimple to String that outputs the concrete class name and the set of attributes stored.- Overrides:
toStringin classAbstractSAMHeaderRecord
-
getSAMString
Description copied from class:AbstractSAMHeaderRecordReturns the record in the SAM line-based text format. Fields are separated by '\t' characters. The String is NOT terminated by '\n'.- Specified by:
getSAMStringin classAbstractSAMHeaderRecord
-
getContig
always returnsgetSequenceName() -
getStart
public final int getStart()always returns 1 -
getEnd
public final int getEnd()always returnsgetSequenceLength()
-
SAMSequenceRecord(String, int)instead.