Class SAMFileHeader

    • Constructor Detail

      • SAMFileHeader

        public SAMFileHeader()
      • SAMFileHeader

        public SAMFileHeader​(SAMSequenceDictionary dict)
        Constructor that initializes the sequence dictionary with the provided one.
    • Method Detail

      • getVersion

        public String getVersion()
      • getCreator

        public String getCreator()
      • getSequence

        public SAMSequenceRecord getSequence​(String name)
        Look up sequence record by name.
        Returns:
        sequence record if it's found by name, or null if sequence dictionary is empty or if the sequence is not found in the dictionary.
      • setSequenceDictionary

        public void setSequenceDictionary​(SAMSequenceDictionary sequenceDictionary)
        Replace entire sequence dictionary. The given sequence dictionary is stored, not copied.
      • getSequence

        public SAMSequenceRecord getSequence​(int sequenceIndex)
        Look up a sequence record by index. First sequence in the header is the 0th.
        Returns:
        The corresponding sequence record, or null if the index is out of range.
      • getSequenceIndex

        public int getSequenceIndex​(String sequenceName)
        Returns:
        Sequence index for the given sequence name, or -1 if the name is not found.
      • setReadGroups

        public void setReadGroups​(List<SAMReadGroupRecord> readGroups)
        Replace entire list of read groups. The given list is stored, not copied.
      • addProgramRecord

        public void addProgramRecord​(SAMProgramRecord programRecord)
      • setProgramRecords

        public void setProgramRecords​(List<SAMProgramRecord> programRecords)
        Replace entire list of program records
        Parameters:
        programRecords - This list is used directly, not copied.
      • createProgramRecord

        public SAMProgramRecord createProgramRecord()
        Returns:
        a new SAMProgramRecord with an ID guaranteed to not exist in this SAMFileHeader
      • setAttribute

        @Deprecated
        public void setAttribute​(String key,
                                 Object value)
        Deprecated.
        Set the given value for the attribute named 'key'. Replaces an existing value, if any. If value is null, the attribute is removed. Otherwise, the value will be converted to a String with toString.
        Overrides:
        setAttribute in class AbstractSAMHeaderRecord
        Parameters:
        key - attribute name
        value - attribute value
      • setAttribute

        public void setAttribute​(String key,
                                 String value)
        Set the given value for the attribute named 'key'. Replaces an existing value, if any. If value is null, the attribute is removed.
        Overrides:
        setAttribute in class AbstractSAMHeaderRecord
        Parameters:
        key - attribute name
        value - attribute value
      • getTextHeader

        @Deprecated
        public String getTextHeader()
        Deprecated.
        since May 1st 2019 - text version of header is no longer stored.
      • setTextHeader

        @Deprecated
        public void setTextHeader​(String textHeader)
        Deprecated.
        since May 1st 2019 - text version of header is no longer stored.
      • addComment

        public void addComment​(String comment)
      • setComments

        public void setComments​(Collection<String> comments)
        Replace existing comments with the contents of the given collection.
      • setValidationErrors

        public void setValidationErrors​(Collection<SAMValidationError> errors)
        Replace list of validation errors with the elements of the given list.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object