Class SAMSequenceRecord

    • Constructor Detail

      • 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)
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String value)
      • getSequenceIndex

        public int getSequenceIndex()
        Returns:
        Index of this record in the sequence dictionary it lives in.
      • setSequenceIndex

        public void setSequenceIndex​(int value)
      • getAlternativeSequenceNames

        public Set<String> getAlternativeSequenceNames()
        Returns unmodifiable set with alternative sequence names.
      • addAlternativeSequenceName

        public void addAlternativeSequenceName​(String name)
        Adds an alternative sequence name if it is not the same as the sequence name or it is not present already.
      • setAlternativeSequenceName

        public void setAlternativeSequenceName​(Collection<String> alternativeSequences)
        Sets the alternative sequence names in the order provided by iteration, removing the previous values.
      • hasAlternativeSequenceNames

        public boolean hasAlternativeSequenceNames()
        Returns true if there are alternative sequence names; false otherwise.
      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.
      • getContig

        public final String getContig()
        always returns getSequenceName()
        Specified by:
        getContig in interface Locatable
        Returns:
        name of the contig this is mapped to, potentially null
        See Also:
        getSequenceName()
      • getStart

        public final int getStart()
        always returns 1
        Specified by:
        getStart in interface Locatable
        Returns:
        1-based start position, undefined if getContig() == null
      • getEnd

        public final int getEnd()
        always returns getSequenceLength()
        Specified by:
        getEnd in interface Locatable
        Returns:
        1-based closed-ended position, undefined if getContig() == null
        See Also:
        getSequenceLength()