Returns the sequence record associated with a specific contig name.
Returns the sequence record associated with a specific contig name.
Name to search for.
SequenceRecord associated with this record.
Throws assertion error if sequence corresponding to contig name is not found.
Returns true if this sequence dictionary contains a reference with the specified (integer) ID.
Returns true if this sequence dictionary contains a reference with the specified (integer) ID.
refId to look for
True if the refId is in this dictionary
Returns true if this sequence dictionary contains a reference with a specific name.
Returns true if this sequence dictionary contains a reference with a specific name.
Reference name to look for.
True if reference is in this dictionary.
Returns the reference names stored in this dictionary.
Returns the reference names stored in this dictionary.
Returns the reference names in this dictionary.
Tests whether two dictionaries are compatible, where "compatible" means that shared referenceName values are associated with the same referenceId, and shared referenceId values are associated with the same referenceName.
Tests whether two dictionaries are compatible, where "compatible" means that shared referenceName values are associated with the same referenceId, and shared referenceId values are associated with the same referenceName.
Roughly, two dictionaries are compatible if the ++ operator will succeed when called on them together.
The other dictionary with which to test compatibility
true if the dictionaries are compatible, false otherwise.
Produces a Map of Int -> Int which maps the referenceIds from this SequenceDictionary into referenceIds compatible with the argument SequenceDictionary ('dict').
Produces a Map of Int -> Int which maps the referenceIds from this SequenceDictionary into referenceIds compatible with the argument SequenceDictionary ('dict').
There are basically three cases that we have to handle here: (1) ids for the same sequence name which are different between the dictionaries. These are converted (from this.referenceId into dict.referenceId). (2) ids which are in use (for different sequences) between the two dictionaries. In this case, we mint a new identifier (using nonoverlappingHash) for the sequence in this dictionary that won't conflict with any sequence in either dictionary. (3) ids for sequences that aren't in the argument dict, and which don't conflict as in (2), can be carried over as-is.
(Note: if the source referenceId isn't in the Map produced by mapTo, we can assume that it can be used without change in the new dictionary. The method remap, below, actually implements this identity.)
The results of this mapTo should be useable by remap to produce a "compatible" dictionary, i.e. for all d1 and d2,
d1.remap(d1.mapTo(d2)).isCompatibleWith(d2)
should be true.
The target dictionary into whose referenceId space the ids of this dictionary should be mapped.
A Map whose values change the referenceIds in this dictionary; every referenceId in the source dictionary should be present in this Map
See the note to mapTo, above.
See the note to mapTo, above. The results of this remap and mapTo should be to produce a "compatible" dictionary, i.e. for all d1 and d2,
d1.remap(d1.mapTo(d2)).isCompatibleWith(d2)
should be true.
The Map[Int,Int] to transform the identifiers of this dictionary; e.g. the output of mapTo.
A new SequenceDictionary with just the referenceIds mapped through the given Map argument.
Converts this ADAM style sequence dictionary into a SAM style sequence dictionary.
Converts this ADAM style sequence dictionary into a SAM style sequence dictionary.
Returns a SAM formatted sequence dictionary.
SequenceDictionary contains the (bijective) map between Ints (the referenceId) and Strings (the referenceName) from the header of a BAM file, or the combined result of multiple such SequenceDictionaries.