Serializable
public class SAMFileHeader extends AbstractSAMHeaderRecord
Modifier and Type | Class | Description |
---|---|---|
static class |
SAMFileHeader.GroupOrder |
|
static class |
SAMFileHeader.PgIdGenerator |
Little class to generate program group IDs
|
static class |
SAMFileHeader.SortOrder |
Ways in which a SAM or BAM may be sorted.
|
Modifier and Type | Field | Description |
---|---|---|
static Set<String> |
ACCEPTABLE_VERSIONS |
|
static String |
CURRENT_VERSION |
|
static String |
GROUP_ORDER_TAG |
|
static String |
SORT_ORDER_TAG |
|
static Set<String> |
STANDARD_TAGS |
These tags are of known type, so don't need a type field in the text representation.
|
static String |
VERSION_TAG |
serialVersionUID
Constructor | Description |
---|---|
SAMFileHeader() |
|
SAMFileHeader(SAMSequenceDictionary dict) |
Constructor that initializes the sequence dictionary with the provided one.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addComment(String comment) |
|
void |
addProgramRecord(SAMProgramRecord programRecord) |
|
void |
addReadGroup(SAMReadGroupRecord readGroup) |
|
void |
addSequence(SAMSequenceRecord sequenceRecord) |
|
void |
addValidationError(SAMValidationError error) |
|
SAMFileHeader |
clone() |
|
SAMProgramRecord |
createProgramRecord() |
|
boolean |
equals(Object o) |
|
List<String> |
getComments() |
|
String |
getCreator() |
|
SAMFileHeader.GroupOrder |
getGroupOrder() |
|
SAMProgramRecord |
getProgramRecord(String pgId) |
|
List<SAMProgramRecord> |
getProgramRecords() |
|
SAMReadGroupRecord |
getReadGroup(String name) |
Look up read group record by name.
|
List<SAMReadGroupRecord> |
getReadGroups() |
|
String |
getSAMString() |
Returns the record in the SAM line-based text format.
|
SAMSequenceRecord |
getSequence(int sequenceIndex) |
Look up a sequence record by index.
|
SAMSequenceRecord |
getSequence(String name) |
Look up sequence record by name.
|
SAMSequenceDictionary |
getSequenceDictionary() |
|
int |
getSequenceIndex(String sequenceName) |
|
SAMFileHeader.SortOrder |
getSortOrder() |
|
String |
getTextHeader() |
If this SAMHeader was read from a file, this property contains the header
as it appeared in the file, otherwise it is null.
|
List<SAMValidationError> |
getValidationErrors() |
|
String |
getVersion() |
|
int |
hashCode() |
|
void |
setAttribute(String key,
Object value) |
Deprecated.
Use
instead |
void |
setAttribute(String key,
String value) |
Set the given value for the attribute named 'key'.
|
void |
setComments(Collection<String> comments) |
Replace existing comments with the contents of the given collection.
|
void |
setGroupOrder(SAMFileHeader.GroupOrder go) |
|
void |
setProgramRecords(List<SAMProgramRecord> programRecords) |
Replace entire list of program records
|
void |
setReadGroups(List<SAMReadGroupRecord> readGroups) |
Replace entire list of read groups.
|
void |
setSequenceDictionary(SAMSequenceDictionary sequenceDictionary) |
Replace entire sequence dictionary.
|
void |
setSortOrder(SAMFileHeader.SortOrder so) |
|
void |
setTextHeader(String textHeader) |
|
void |
setValidationErrors(Collection<SAMValidationError> errors) |
Replace list of validation errors with the elements of the given list.
|
attributesEqual, attributesHashCode, getAttribute, getAttributes, getId, toString
public static final String VERSION_TAG
public static final String SORT_ORDER_TAG
public static final String GROUP_ORDER_TAG
public static final String CURRENT_VERSION
public SAMFileHeader()
public SAMFileHeader(SAMSequenceDictionary dict)
public String getVersion()
public String getCreator()
public SAMSequenceDictionary getSequenceDictionary()
public List<SAMReadGroupRecord> getReadGroups()
public SAMSequenceRecord getSequence(String name)
public SAMReadGroupRecord getReadGroup(String name)
public void setSequenceDictionary(SAMSequenceDictionary sequenceDictionary)
public void addSequence(SAMSequenceRecord sequenceRecord)
public SAMSequenceRecord getSequence(int sequenceIndex)
public int getSequenceIndex(String sequenceName)
public void setReadGroups(List<SAMReadGroupRecord> readGroups)
public void addReadGroup(SAMReadGroupRecord readGroup)
public List<SAMProgramRecord> getProgramRecords()
public void addProgramRecord(SAMProgramRecord programRecord)
public SAMProgramRecord getProgramRecord(String pgId)
public void setProgramRecords(List<SAMProgramRecord> programRecords)
programRecords
- This list is used directly, not copied.public SAMProgramRecord createProgramRecord()
public SAMFileHeader.SortOrder getSortOrder()
public void setSortOrder(SAMFileHeader.SortOrder so)
public SAMFileHeader.GroupOrder getGroupOrder()
public void setGroupOrder(SAMFileHeader.GroupOrder go)
@Deprecated public void setAttribute(String key, Object value)
instead
setAttribute
in class AbstractSAMHeaderRecord
key
- attribute namevalue
- attribute valuepublic void setAttribute(String key, String value)
setAttribute
in class AbstractSAMHeaderRecord
key
- attribute namevalue
- attribute valuepublic String getTextHeader()
public void setTextHeader(String textHeader)
public void addComment(String comment)
public void setComments(Collection<String> comments)
public List<SAMValidationError> getValidationErrors()
public void addValidationError(SAMValidationError error)
public void setValidationErrors(Collection<SAMValidationError> errors)
public final SAMFileHeader clone()
public String getSAMString()
AbstractSAMHeaderRecord
getSAMString
in class AbstractSAMHeaderRecord