Class BlockSetImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, BlockSet, ScoresCache

    public class BlockSetImpl
    extends AbstractScoresCache
    implements java.io.Serializable, BlockSet, java.lang.Cloneable
    A general implementation of a BlockSet to store a flexible part of a multiple alignment.
    Since:
    4.1.0
    Author:
    Aleix Lafita
    See Also:
    Serialized Form
    • Constructor Detail

      • BlockSetImpl

        public BlockSetImpl​(MultipleAlignment alignment)
        Constructor. Links also the parent to this instance by adding the BlockSet to the parent's List.
        Parameters:
        alignment - MultipleAlignment parent of the BlockSet.
      • BlockSetImpl

        public BlockSetImpl​(BlockSetImpl bs)
        Copy constructor. Makes also a deep copy of all constituent Block s.
        Parameters:
        bs - BlockSet object to be copied.
    • Method Detail

      • clone

        public BlockSetImpl clone()
        Description copied from interface: BlockSet
        Creates and returns an identical copy of this blockset, including a deep copy of all constituent Blocks.
        Specified by:
        clone in interface BlockSet
        Overrides:
        clone in class java.lang.Object
        Returns:
        BlockSet identical copy of this object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setMultipleAlignment

        public void setMultipleAlignment​(MultipleAlignment parent)
        Description copied from interface: BlockSet
        Set the back-reference to its parent MultipleAlignment.

        Neither removes this BlockSet from its previous alignment, if any, nor adds it to the new parent. Calling code should assure that links to and from the ensemble are consistent and free of memory leaks.

        Specified by:
        setMultipleAlignment in interface BlockSet
        Parameters:
        parent - the parent MultipleAlignment.
        See Also:
        BlockSet.getMultipleAlignment()
      • getBlocks

        public java.util.List<Block> getBlocks()
        Description copied from interface: BlockSet
        Returns the List of alignment Blocks of the BlockSet. It initializes a new List of Blocks if it is null.
        Specified by:
        getBlocks in interface BlockSet
        Returns:
        List of alignment Blocks.
        See Also:
        BlockSet.setBlocks(List)
      • getTransformations

        public java.util.List<javax.vecmath.Matrix4d> getTransformations()
        Description copied from interface: BlockSet
        Returns a transformation matrix for each structure giving the 3D superimposition information of the multiple structure alignment.
        Specified by:
        getTransformations in interface BlockSet
        Returns:
        the 3D superimposition information of the alignment
      • setTransformations

        public void setTransformations​(java.util.List<javax.vecmath.Matrix4d> transformations)
        Description copied from interface: BlockSet
        Set a new superposition for the structures. This may trigger other properties to update which depend on the superposition.
        Specified by:
        setTransformations in interface BlockSet
      • length

        public int length()
        Description copied from interface: BlockSet
        Returns the total number of aligned residues (columns) in the alignment: the sum of all Block lengths.
        Specified by:
        length in interface BlockSet
        Returns:
        int the total number of aligned residues.
        See Also:
        BlockSet.getCoreLength(), BlockSet.size()
      • getCoreLength

        public int getCoreLength()
        Description copied from interface: BlockSet
        Returns the number of aligned residues (columns) without gaps in the alignment: the sum of all Block core lengths.
        Specified by:
        getCoreLength in interface BlockSet
        Returns:
        int the total number of aligned residues.
        See Also:
        BlockSet.length(), BlockSet.size()
      • updateLength

        protected void updateLength()
      • updateCoreLength

        protected void updateCoreLength()
      • updateCache

        protected void updateCache()
      • getAlignResCounts

        public java.util.List<java.lang.Integer> getAlignResCounts()
        Description copied from interface: BlockSet
        Returns the number of non null positions (residues) of each structure in the alignment Block Set. The values can be used to compute the coverages.
        Specified by:
        getAlignResCounts in interface BlockSet
        Returns:
        List of residue counts for each structure