public class SAMFileHeader extends AbstractSAMHeaderRecord
| Modifier and Type | Class and 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 and Description |
|---|---|
static java.util.Set<java.lang.String> |
ACCEPTABLE_VERSIONS |
static java.lang.String |
CURRENT_VERSION |
static java.lang.String |
GROUP_ORDER_TAG |
static java.lang.String |
SORT_ORDER_TAG |
static java.util.Set<java.lang.String> |
STANDARD_TAGS
These tags are of known type, so don't need a type field in the text representation.
|
static java.lang.String |
VERSION_TAG |
serialVersionUID| Constructor and Description |
|---|
SAMFileHeader() |
SAMFileHeader(SAMSequenceDictionary dict)
Constructor that initializes the sequence dictionary with the provided one.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComment(java.lang.String comment) |
void |
addProgramRecord(SAMProgramRecord programRecord) |
void |
addReadGroup(SAMReadGroupRecord readGroup) |
void |
addSequence(SAMSequenceRecord sequenceRecord) |
void |
addValidationError(SAMValidationError error) |
SAMFileHeader |
clone() |
SAMProgramRecord |
createProgramRecord() |
boolean |
equals(java.lang.Object o) |
java.util.List<java.lang.String> |
getComments() |
java.lang.String |
getCreator() |
SAMFileHeader.GroupOrder |
getGroupOrder() |
SAMProgramRecord |
getProgramRecord(java.lang.String pgId) |
java.util.List<SAMProgramRecord> |
getProgramRecords() |
SAMReadGroupRecord |
getReadGroup(java.lang.String name)
Look up read group record by name.
|
java.util.List<SAMReadGroupRecord> |
getReadGroups() |
java.lang.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(java.lang.String name)
Look up sequence record by name.
|
SAMSequenceDictionary |
getSequenceDictionary() |
int |
getSequenceIndex(java.lang.String sequenceName) |
SAMFileHeader.SortOrder |
getSortOrder() |
java.lang.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.
|
java.util.List<SAMValidationError> |
getValidationErrors() |
java.lang.String |
getVersion() |
int |
hashCode() |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Deprecated.
Use {@link #setAttribute(String, String) instead
|
void |
setAttribute(java.lang.String key,
java.lang.String value)
Set the given value for the attribute named 'key'.
|
void |
setComments(java.util.Collection<java.lang.String> comments)
Replace existing comments with the contents of the given collection.
|
void |
setGroupOrder(SAMFileHeader.GroupOrder go) |
void |
setProgramRecords(java.util.List<SAMProgramRecord> programRecords)
Replace entire list of program records
|
void |
setReadGroups(java.util.List<SAMReadGroupRecord> readGroups)
Replace entire list of read groups.
|
void |
setSequenceDictionary(SAMSequenceDictionary sequenceDictionary)
Replace entire sequence dictionary.
|
void |
setSortOrder(SAMFileHeader.SortOrder so) |
void |
setTextHeader(java.lang.String textHeader) |
void |
setValidationErrors(java.util.Collection<SAMValidationError> errors)
Replace list of validation errors with the elements of the given list.
|
attributesEqual, attributesHashCode, getAttribute, getAttributes, getId, toStringpublic static final java.lang.String VERSION_TAG
public static final java.lang.String SORT_ORDER_TAG
public static final java.lang.String GROUP_ORDER_TAG
public static final java.lang.String CURRENT_VERSION
public static final java.util.Set<java.lang.String> ACCEPTABLE_VERSIONS
public static final java.util.Set<java.lang.String> STANDARD_TAGS
public SAMFileHeader()
public SAMFileHeader(SAMSequenceDictionary dict)
public java.lang.String getVersion()
public java.lang.String getCreator()
public SAMSequenceDictionary getSequenceDictionary()
public java.util.List<SAMReadGroupRecord> getReadGroups()
public SAMSequenceRecord getSequence(java.lang.String name)
public SAMReadGroupRecord getReadGroup(java.lang.String name)
public void setSequenceDictionary(SAMSequenceDictionary sequenceDictionary)
public void addSequence(SAMSequenceRecord sequenceRecord)
public SAMSequenceRecord getSequence(int sequenceIndex)
public int getSequenceIndex(java.lang.String sequenceName)
public void setReadGroups(java.util.List<SAMReadGroupRecord> readGroups)
public void addReadGroup(SAMReadGroupRecord readGroup)
public java.util.List<SAMProgramRecord> getProgramRecords()
public void addProgramRecord(SAMProgramRecord programRecord)
public SAMProgramRecord getProgramRecord(java.lang.String pgId)
public void setProgramRecords(java.util.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(java.lang.String key,
java.lang.Object value)
setAttribute in class AbstractSAMHeaderRecordkey - attribute namevalue - attribute valuepublic void setAttribute(java.lang.String key,
java.lang.String value)
setAttribute in class AbstractSAMHeaderRecordkey - attribute namevalue - attribute valuepublic java.lang.String getTextHeader()
public void setTextHeader(java.lang.String textHeader)
public java.util.List<java.lang.String> getComments()
public void addComment(java.lang.String comment)
public void setComments(java.util.Collection<java.lang.String> comments)
public java.util.List<SAMValidationError> getValidationErrors()
public void addValidationError(SAMValidationError error)
public void setValidationErrors(java.util.Collection<SAMValidationError> errors)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic final SAMFileHeader clone()
clone in class java.lang.Objectpublic java.lang.String getSAMString()
AbstractSAMHeaderRecordgetSAMString in class AbstractSAMHeaderRecord