Serializable
public class SAMSequenceDictionary extends Object implements Serializable
Modifier and Type | Field | Description |
---|---|---|
static List<String> |
DEFAULT_DICTIONARY_EQUAL_TAG |
|
static long |
serialVersionUID |
Constructor | Description |
---|---|
SAMSequenceDictionary() |
|
SAMSequenceDictionary(List<SAMSequenceRecord> list) |
Modifier and Type | Method | Description |
---|---|---|
void |
addSequence(SAMSequenceRecord sequenceRecord) |
|
SAMSequenceRecord |
addSequenceAlias(String originalName,
String altName) |
Add an alias to a SAMSequenceRecord.
|
void |
assertSameDictionary(SAMSequenceDictionary that) |
Non-comprehensive
equals(Object) -assertion: instead of calling SAMSequenceRecord.equals(Object) on constituent
SAMSequenceRecord s in this dictionary against its pair in the target dictionary, in order, call
SAMSequenceRecord.isSameSequence(SAMSequenceRecord) . |
boolean |
equals(Object o) |
returns true if the two dictionaries are the same, aliases are NOT considered
|
long |
getReferenceLength() |
|
SAMSequenceRecord |
getSequence(int sequenceIndex) |
|
SAMSequenceRecord |
getSequence(String name) |
|
int |
getSequenceIndex(String sequenceName) |
|
List<SAMSequenceRecord> |
getSequences() |
|
int |
hashCode() |
|
boolean |
isEmpty() |
|
boolean |
isSameDictionary(SAMSequenceDictionary that) |
Non-comprehensive
equals(Object) -validation: instead of calling SAMSequenceRecord.equals(Object) on constituent
SAMSequenceRecord s in this dictionary against its pair in the target dictionary, in order, call
SAMSequenceRecord.isSameSequence(SAMSequenceRecord) . |
String |
md5() |
return a MD5 sum for ths dictionary, the checksum is re-computed each
time this method is called.
|
static SAMSequenceDictionary |
mergeDictionaries(SAMSequenceDictionary dict1,
SAMSequenceDictionary dict2,
List<String> tagsToMatch) |
Will merge dictionaryTags from two dictionaries into one focusing on merging the tags rather than the sequences.
|
void |
setSequences(List<SAMSequenceRecord> list) |
Replaces the existing list of SAMSequenceRecords with the given list.
|
int |
size() |
|
String |
toString() |
public static final long serialVersionUID
public SAMSequenceDictionary()
public SAMSequenceDictionary(List<SAMSequenceRecord> list)
public List<SAMSequenceRecord> getSequences()
public SAMSequenceRecord getSequence(String name)
public void setSequences(List<SAMSequenceRecord> list)
list
- This value is used directly, rather than being copied.public void addSequence(SAMSequenceRecord sequenceRecord)
public SAMSequenceRecord getSequence(int sequenceIndex)
public int getSequenceIndex(String sequenceName)
public int size()
public long getReferenceLength()
public boolean isEmpty()
public void assertSameDictionary(SAMSequenceDictionary that)
equals(Object)
-assertion: instead of calling SAMSequenceRecord.equals(Object)
on constituent
SAMSequenceRecord
s in this dictionary against its pair in the target dictionary, in order, call
SAMSequenceRecord.isSameSequence(SAMSequenceRecord)
.
Aliases are ignored.AssertionError
- When the dictionaries are not the same, with some human-readable information as to whypublic boolean isSameDictionary(SAMSequenceDictionary that)
equals(Object)
-validation: instead of calling SAMSequenceRecord.equals(Object)
on constituent
SAMSequenceRecord
s in this dictionary against its pair in the target dictionary, in order, call
SAMSequenceRecord.isSameSequence(SAMSequenceRecord)
.that
- SAMSequenceDictionary
to compare againstpublic boolean equals(Object o)
public SAMSequenceRecord addSequenceAlias(String originalName, String altName)
1,chr1,chr01,01,CM000663,NC_000001.10
e.g:
MT,chrM
originalName
- existing contig namealtName
- new contig namepublic String md5()
md5( (seq1.md5_if_available) + ' '+(seq2.name+seq2.length) + ' '+...)
public static SAMSequenceDictionary mergeDictionaries(SAMSequenceDictionary dict1, SAMSequenceDictionary dict2, List<String> tagsToMatch)
dict1
- first dictionarydict2
- first dictionarytagsToMatch
- list of tags that must be equal if present in both sequence. Must contain MD, and LN