Class AlignmentLayout

    • Method Detail

      • toXML

        public org.jdom.Element toXML​(Geneious.MajorVersion majorVersion,
                                      jebl.util.ProgressListener progressListener)
        Description copied from interface: XMLSerializable.OldVersionCompatible
        Serializes this class to XML format, potentially to a format readable by an earlier version of Geneious. It is acceptable for the XML to include unnecessary tags that will be ignored by the earlier version. For example if the implementation has only extended the XML since the earlier version, then the XML returned may be identical to the XML returned for the current version.

        See 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.

        Specified by:
        toXML in interface XMLSerializable.OldVersionCompatible
        Parameters:
        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 cancelling
        Returns:
        object encoded as a JDOM element
      • getNumberOfColumnsInAlignment

        public int getNumberOfColumnsInAlignment()
        Returns the number of columns in the alignment
        Returns:
        the number of columns in the alignment
      • getNumberOfSequences

        public int getNumberOfSequences()
        Returns:
        the number of sequences in this layout
      • getNumberOfRows

        public int getNumberOfRows()
        Returns the total number of rows used for laying out sequences
        Returns:
        the total number of rows used for laying out sequences
      • isLinkPairedReadsInRow

        public boolean isLinkPairedReadsInRow​(int rowNumber)
        Returns true if pairs reads in the given row number are linked (i.e. nothing is laid out between them)
        Parameters:
        rowNumber - the 0-based row number (from 0 to getNumberOfRows()
        Returns:
        true if pairs reads in the given row number are linked (i.e. nothing is laid out between them)
        Throws:
        java.lang.IndexOutOfBoundsException - if rowNumber is not between 0 and getNumberOfRows()-1 inclusive.
      • getRowNumber

        public int getRowNumber​(int sequenceNumber)
        Get the row number that the given sequence has been lain out in.
        Parameters:
        sequenceNumber - the 0-based sequence number
        Returns:
        the 0-based row number (will be between 0 and getNumberOfRows()-1 inclusive)
        Throws:
        java.lang.IndexOutOfBoundsException - if sequenceNumber is not between 0 and getNumberOfSequences()-1 inclusive.
      • getSequenceInRowNearestToColumn

        public 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.
        Parameters:
        rowNumber - the 0-based row number
        columnIndex - the 0-based index of the column. If this is out of the range 0->getNumberOfColumnsInAlignment() it will be clipped to that range.
        Returns:
        the nearest sequence. Every row has at least 1 sequence so this method will always return a valid sequence number.
        Throws:
        java.lang.IndexOutOfBoundsException - if rowNumber is not between 0 and getNumberOfRows()-1 inclusive.
      • getSequencesInRowIntersectingRange

        public IntList getSequencesInRowIntersectingRange​(int rowNumber,
                                                          int firstColumn,
                                                          int lastColumnInclusive)
        Gets all sequences in the given row that intersect with the given range of columns
        Parameters:
        rowNumber - the 0-based row number
        firstColumn - 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 column
        Returns:
        all sequences that intersect the given range of columns.
        Throws:
        java.lang.IndexOutOfBoundsException - if rowNumber is not between 0 and getNumberOfRows()-1 inclusive.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getMaximumColumnsCached

        public static int getMaximumColumnsCached()
        Returns the maximum number of columns in the alignment which will be cached in memory at one time. A viewer on this data should not try viewing data when more than this many columns are visible or it will hit cache throttling performance issues.
        Returns:
        the maximum number of columns in the alignment which will be cached in memory at one time. A viewer on this data should not try viewing data when more than this many columns are visible or it will hit cache throttling performance issues