public class EndGapsManager extends Object
DefaultAlignmentDocuments may provide SequenceListOnDisk.AlignmentData
via
DefaultAlignmentDocument.getAlignmentDataForSequencesNotInMemory()
which in turn can provide a pre-built EndGapsManager via
AlignmentData.getEndGapsManager()| Modifier and Type | Class and Description |
|---|---|
static class |
EndGapsManager.Builder
Used for building an
EndGapsManager which is too large to fit in memory |
| Constructor and Description |
|---|
EndGapsManager(org.jdom.Element element,
SequenceListOnDisk<SequenceDocument> associatedSequences)
Recreates an EndGapsManager from XML.
|
EndGapsManager(EndGapsManager endGapsManager,
SequenceCharSequence referenceSequence)
Creates a new EndGapsManager identical to the provided one except for the addition of a reference sequence at index 0.
|
EndGapsManager(List<SequenceCharSequence> sequences,
int minimumHashSize,
int numberOfSequences) |
EndGapsManager(SequenceAlignmentDocument alignment,
int minimumHashSize)
Creates an EndGapsManager for the sequences in the given alignment.
|
EndGapsManager(SequenceCharSequence[] sequences,
int minimumHashSize) |
EndGapsManager(SequenceCharSequence[] sequences,
int minimumHashSize,
int numberOfSequences) |
| Modifier and Type | Method and Description |
|---|---|
int |
getHashSize()
Gets the hash size used for this manager.
|
int |
getNumberOfColumns() |
int[] |
getPotentialSequencesCoveringArray(int residueIndex)
Returns all sequences which contain the given index, excluding those sequences for which residueIndex is an end gap, however, the returned list may also include sequences that do not cover the given residueIndex.
|
int[] |
getPotentialSequencesCoveringArray(int residueIndex,
int circularAlignmentLength)
Returns all sequences which contain the given index, excluding those sequences for which residueIndex is an end gap, however, the returned list may also include sequences that do not cover the given residueIndex.
|
int |
getSamePotentialSequencesLowerBound(int residueIndex)
Gets a lower bound such that all calls to
getPotentialSequencesCoveringArray(int)
with an index between LowerBound and residueIndex inclusive would return the same array. |
int |
getSamePotentialSequencesUpperBoundExclusive(int residueIndex)
Gets an upper bounds such at all calls to
getPotentialSequencesCoveringArray(int)
with an index between residueIndex and this upper bound exclusive would return the same array. |
SequenceCharSequence |
getSequence(int index) |
int |
getSequenceCount() |
List<SequenceCharSequence> |
getSequences() |
int[] |
getSequencesCoveringArray(int residueIndex) |
Iterable<Integer> |
getSequencesCoveringIterable(int residueIndex) |
Iterator<Integer> |
getSequencesCoveringIterator(int residueIndex) |
Geneious.MajorVersion |
getVersionSupport(XMLSerializable.VersionSupportType versionType)
Like
XMLSerializable.OldVersionCompatible#getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)
but this class isn't really XML serialiable. |
org.jdom.Element |
toXmlExcludingSequences(Geneious.MajorVersion version,
ProgressListener progressListener)
Converts this EndGapsManager to XML, excluding the associated sequences, which must be stored independently and provided again during serialization using
EndGapsManager(org.jdom.Element, com.biomatters.geneious.publicapi.documents.sequence.SequenceListOnDisk) |
org.jdom.Element |
toXmlExcludingSequences(String elementName)
Converts this EndGapsManager to XML, excluding the associated sequences, which must be stored independently and provided again during serialization using
EndGapsManager(org.jdom.Element, com.biomatters.geneious.publicapi.documents.sequence.SequenceListOnDisk) |
public EndGapsManager(EndGapsManager endGapsManager, SequenceCharSequence referenceSequence)
toXmlExcludingSequences(String)endGapsManager - an end gaps managerreferenceSequence - the new reference sequence or null for no reference sequencepublic EndGapsManager(org.jdom.Element element,
SequenceListOnDisk<SequenceDocument> associatedSequences)
element - n element previously returned from toXmlExcludingSequences(String)associatedSequences - the sequence associated with the EndGapsManagerpublic EndGapsManager(SequenceCharSequence[] sequences, int minimumHashSize)
sequences - the sequences the consider end gaps on. This array is not copied and this class relies on the caller not changing the contents of this array after constructing this class.minimumHashSize - Suggested value of 256. This means that for every 256 residues we maintain an index of all possible sequences that could cover that range. Lower values make lookups faster, but lower values take longer to construct and uses more memory. The implementation of this class may use a higher hash size than the provided one and the size it selects will be returned from getHashSize()public EndGapsManager(SequenceCharSequence[] sequences, int minimumHashSize, int numberOfSequences)
sequences - the sequences to consider end gaps on. This array is not copied and this class relies on the caller not changing the contents of this array after constructing this class.minimumHashSize - Suggested value of 256. This means that for every 256 residues we maintain an index of all possible sequences that could cover that range. Lower values make lookups faster, but lower values take longer to construct and uses more memory. The implementation of this class may use a higher hash size than the provided one and the size it selects will be returned from getHashSize()numberOfSequences - usually this is sequences.length, but sometimes the caller may want to use a subset of the sequences.public EndGapsManager(List<SequenceCharSequence> sequences, int minimumHashSize, int numberOfSequences)
sequences - the sequences to consider end gaps on. This list is not copied and this class relies on the caller not changing the contents of this list after constructing this class.minimumHashSize - Suggested value of 256. This means that for every 256 residues we maintain an index of all possible sequences that could cover that range. Lower values make lookups faster, but lower values take longer to construct and uses more memory. The implementation of this class may use a higher hash size than the provided one and the size it selects will be returned from getHashSize()numberOfSequences - usually this is sequences.length, but sometimes the caller may want to use a subset of the sequences.public EndGapsManager(SequenceAlignmentDocument alignment, int minimumHashSize)
alignment - the alignment containing the sequences to create the EndGapsManager on.minimumHashSize - Suggested value of 256. This means that for every 256 residues we maintain an index of all possible sequences that could cover that range. Lower values make lookups faster, but lower values take longer to construct and uses more memory. The implementation of this class may use a higher hash size than the provided one and the size it selects will be returned from getHashSize()public Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
XMLSerializable.OldVersionCompatible#getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)
but this class isn't really XML serialiable. Instead it provides a partial XML serialization methodversionType - as defined by XMLSerializable.OldVersionCompatible#getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)XMLSerializable.OldVersionCompatible#getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)public org.jdom.Element toXmlExcludingSequences(String elementName) throws XMLSerializationException
EndGapsManager(org.jdom.Element, com.biomatters.geneious.publicapi.documents.sequence.SequenceListOnDisk)elementName - the name of the element to returnPluginDocument.FILE_DATA_ATTRIBUTE_NAMEXMLSerializationException - if it can't be serialized (e.g. can't write to disk)UnsupportedOperationException - if this EndGapsManager was created using EndGapsManager(EndGapsManager, com.biomatters.geneious.publicapi.documents.sequence.SequenceCharSequence)public org.jdom.Element toXmlExcludingSequences(Geneious.MajorVersion version, ProgressListener progressListener) throws XMLSerializationException
EndGapsManager(org.jdom.Element, com.biomatters.geneious.publicapi.documents.sequence.SequenceListOnDisk)version - progressListener - PluginDocument.FILE_DATA_ATTRIBUTE_NAMEXMLSerializationException - if it can't be serialized (e.g. can't write to disk)public int[] getSequencesCoveringArray(int residueIndex)
residueIndex - the 0-based index to get sequences indices forpublic int[] getPotentialSequencesCoveringArray(int residueIndex)
getSequencesCoveringArray(int) instead unless they are very concerned about performance and don't
want to allocate the extra array required to return the results.residueIndex - the 0-based index to get sequences indices forpublic int[] getPotentialSequencesCoveringArray(int residueIndex,
int circularAlignmentLength)
getSequencesCoveringArray(int) instead unless they are very concerned about performance and don't
want to allocate the extra array required to return the results.residueIndex - the 0-based index to get sequences indices forcircularAlignmentLength - the circular length of the alignment if it is circular, or 0 if it is not circular (as defined by SequenceAlignmentDocument.getCircularLength()public int getSamePotentialSequencesLowerBound(int residueIndex)
getPotentialSequencesCoveringArray(int)
with an index between LowerBound and residueIndex inclusive would return the same array.residueIndex - the residue index to get a lower bound for.getPotentialSequencesCoveringArray(int)
with an index between LowerBound and residueIndex inclusive would return the same array.(int),
getPotentialSequencesCoveringArray(int)public int getSamePotentialSequencesUpperBoundExclusive(int residueIndex)
getPotentialSequencesCoveringArray(int)
with an index between residueIndex and this upper bound exclusive would return the same array.residueIndex - the residue index to get an upper bound for.getPotentialSequencesCoveringArray(int)
with an index between residueIndex and this upper bound exclusive would return the same array.getSamePotentialSequencesLowerBound(int),
getPotentialSequencesCoveringArray(int)public int getHashSize()
public Iterable<Integer> getSequencesCoveringIterable(int residueIndex)
residueIndex - the 0-based index to get sequences indices forpublic Iterator<Integer> getSequencesCoveringIterator(int residueIndex)
residueIndex - the 0-based index to get sequences indices forpublic int getSequenceCount()
public int getNumberOfColumns()
CharSequence.length() of all sequences)public SequenceCharSequence getSequence(int index)
index - the index of the sequence to get in the range [0, getSequenceCount())public List<SequenceCharSequence> getSequences()
getSequenceCount() < than the returned list length) managed by this end gaps manager. The returned value is the stored internal list so any usage of this method must not modify the contents of this list.