public final class AlignmentLayout extends Object implements XMLSerializable.OldVersionCompatible
DefaultAlignmentDocument
via
DefaultAlignmentDocument.getAlignmentDataForSequencesNotInMemory()
.getLinkAllPairsLayout()
or
DefaultAlignmentDocument.getAlignmentDataForSequencesNotInMemory()
.getLinkNearbyPairsLayout()
or
DefaultAlignmentDocument.getAlignmentDataForSequencesNotInMemory()
.getLinkNoPairsLayout()
Code should not construct an AlignmentLayout directly. Instead, AlignmentLayouts are constructed as part of creating an alignment via a SequenceListOnDisk.Builder
Unless you are writing your own contig viewer, you can probably ignore this class.Constructor and Description |
---|
AlignmentLayout(org.jdom.Element element)
Recreates an AlignmentLayout from XML.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
static int |
getMaximumColumnsCached()
Returns the maximum number of columns in the alignment which will be cached in memory at one time.
|
int |
getNumberOfColumnsInAlignment()
Returns the number of columns in the alignment
|
int |
getNumberOfRows()
Returns the total number of rows used for laying out sequences
|
int |
getNumberOfSequences() |
int |
getRowNumber(int sequenceNumber)
Get the row number that the given sequence has been lain out in.
|
int |
getSequenceInRowNearestToColumn(int rowNumber,
int columnIndex)
For a given row, gets the sequence covering this column index, or if there isn't a sequence
covering this column, returns the nearest sequence to it.
|
IntList |
getSequencesInRowIntersectingRange(int rowNumber,
int firstColumn,
int lastColumnInclusive)
Gets all sequences in the given row that intersect with the given range of columns
|
Geneious.MajorVersion |
getVersionSupport(XMLSerializable.VersionSupportType versionType)
Gets either the latest version this class can serialize to via
XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed. |
boolean |
isLinkPairedReadsInRow(int rowNumber)
Returns true if pairs reads in the given row number are linked (i.e.
|
org.jdom.Element |
toXML(Geneious.MajorVersion majorVersion,
ProgressListener progressListener)
Serializes this class to XML format, potentially to a format readable by an earlier version of Geneious.
|
org.jdom.Element |
toXML(String elementName)
Converts this layout to XML for use with
AlignmentLayout(org.jdom.Element) |
public AlignmentLayout(org.jdom.Element element) throws XMLSerializationException
element
- an element returned from toXML(String)
XMLSerializationException
- if we can't deserialize because the XML is invalidpublic Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
XMLSerializable.OldVersionCompatible
XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
last changed.getVersionSupport
in interface XMLSerializable.OldVersionCompatible
versionType
- specifies which version property to returnpublic org.jdom.Element toXML(String elementName)
AlignmentLayout(org.jdom.Element)
elementName
- the name of the element to returnPluginDocument.FILE_DATA_ATTRIBUTE_NAME
public org.jdom.Element toXML(Geneious.MajorVersion majorVersion, ProgressListener progressListener)
XMLSerializable.OldVersionCompatible
XMLSerializable.toXML()
for a more
detailed description of what it means to serialize to XML.
All classes that implement this method must also implement XMLSerializable.toXML()
and should delegate back to
this method using Geneious.getMajorVersion()
and ProgressListener.EMPTY
as parameters.toXML
in interface XMLSerializable.OldVersionCompatible
majorVersion
- the major version of Geneious to serialize to XML for. For example "6.0" but not "6.0.0". This must be a version
returned greater or equal to a version returned from
getVersionSupport
(VersionSupportType.OldestVersionSerializableTo
)
and must never be greater than the current version (Geneious.getMajorVersion()
)progressListener
- for reporting progress and cancellingpublic int getNumberOfColumnsInAlignment()
public int getNumberOfSequences()
public int getNumberOfRows()
public boolean isLinkPairedReadsInRow(int rowNumber)
rowNumber
- the 0-based row number (from 0 to getNumberOfRows()
IndexOutOfBoundsException
- if rowNumber is not between 0 and getNumberOfRows()
-1 inclusive.public int getRowNumber(int sequenceNumber)
sequenceNumber
- the 0-based sequence numbergetNumberOfRows()
-1 inclusive)IndexOutOfBoundsException
- if sequenceNumber is not between 0 and getNumberOfSequences()
-1 inclusive.public int getSequenceInRowNearestToColumn(int rowNumber, int columnIndex)
rowNumber
- the 0-based row numbercolumnIndex
- the 0-based index of the column. If this is out of the range 0->getNumberOfColumnsInAlignment()
it will be clipped to that range.IndexOutOfBoundsException
- if rowNumber is not between 0 and getNumberOfRows()
-1 inclusive.public IntList getSequencesInRowIntersectingRange(int rowNumber, int firstColumn, int lastColumnInclusive)
rowNumber
- the 0-based row numberfirstColumn
- the 0-based index of the first column. If this is out of the range 0->getNumberOfColumnsInAlignment()
it will be clipped to that range.lastColumnInclusive
- the 0-based index (inclusive) of the last columnIndexOutOfBoundsException
- if rowNumber is not between 0 and getNumberOfRows()
-1 inclusive.protected void finalize() throws Throwable
public static int getMaximumColumnsCached()