Class BlockSetImpl
- java.lang.Object
-
- org.biojava.nbio.structure.align.multiple.AbstractScoresCache
-
- org.biojava.nbio.structure.align.multiple.BlockSetImpl
-
- All Implemented Interfaces:
Serializable,Cloneable,BlockSet,ScoresCache
public class BlockSetImpl extends AbstractScoresCache implements Serializable, BlockSet, 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 Summary
Constructors Constructor Description BlockSetImpl(BlockSetImpl bs)Copy constructor.BlockSetImpl(MultipleAlignment alignment)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the cached scores.BlockSetImplclone()Creates and returns an identical copy of this blockset, including a deep copy of all constituentBlocks.List<Integer>getAlignResCounts()Returns the number of non null positions (residues) of each structure in the alignment Block Set.List<Block>getBlocks()Returns the List of alignment Blocks of the BlockSet.intgetCoreLength()Returns the number of aligned residues (columns) without gaps in the alignment: the sum of all Block core lengths.MultipleAlignmentgetMultipleAlignment()Returns the parent MultipleAlignment of the BlockSet.List<javax.vecmath.Matrix4d>getTransformations()Returns a transformation matrix for each structure giving the 3D superimposition information of the multiple structure alignment.intlength()Returns the total number of aligned residues (columns) in the alignment: the sum of all Block lengths.voidsetBlocks(List<Block> blocks)Set the List of alignment Blocks of the BlockSet.voidsetMultipleAlignment(MultipleAlignment parent)Set the back-reference to its parent MultipleAlignment.voidsetTransformations(List<javax.vecmath.Matrix4d> transformations)Set a new superposition for the structures.intsize()Returns the number of aligned structures in the BlockSet.StringtoString()protected voidupdateCache()protected voidupdateCoreLength()protected voidupdateLength()-
Methods inherited from class org.biojava.nbio.structure.align.multiple.AbstractScoresCache
clone, getScore, getScores, putScore
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.biojava.nbio.structure.align.multiple.ScoresCache
getScore, getScores, putScore
-
-
-
-
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 constituentBlocks.- Parameters:
bs- BlockSet object to be copied.
-
-
Method Detail
-
clear
public void clear()
Description copied from class:AbstractScoresCacheClear the cached scores. This frees memory after the alignment changed.- Specified by:
clearin interfaceBlockSet- Overrides:
clearin classAbstractScoresCache
-
clone
public BlockSetImpl clone()
Description copied from interface:BlockSetCreates and returns an identical copy of this blockset, including a deep copy of all constituentBlocks.
-
getMultipleAlignment
public MultipleAlignment getMultipleAlignment()
Description copied from interface:BlockSetReturns the parent MultipleAlignment of the BlockSet. Returns null if there is no referenced object.- Specified by:
getMultipleAlignmentin interfaceBlockSet- Returns:
- MultipleAlignment the parent MultipleAlignment of the BlockSet, or null.
- See Also:
BlockSet.setMultipleAlignment(MultipleAlignment)
-
setMultipleAlignment
public void setMultipleAlignment(MultipleAlignment parent)
Description copied from interface:BlockSetSet 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:
setMultipleAlignmentin interfaceBlockSet- Parameters:
parent- the parent MultipleAlignment.- See Also:
BlockSet.getMultipleAlignment()
-
getBlocks
public List<Block> getBlocks()
Description copied from interface:BlockSetReturns the List of alignment Blocks of the BlockSet. It initializes a new List of Blocks if it is null.- Specified by:
getBlocksin interfaceBlockSet- Returns:
- List of alignment Blocks.
- See Also:
BlockSet.setBlocks(List)
-
setBlocks
public void setBlocks(List<Block> blocks)
Description copied from interface:BlockSetSet the List of alignment Blocks of the BlockSet.Also calls
Block.setBlockSet(BlockSet)for each argument- Specified by:
setBlocksin interfaceBlockSet- Parameters:
blocks- List of alignment Blocks.- See Also:
BlockSet.getBlocks()
-
getTransformations
public List<javax.vecmath.Matrix4d> getTransformations()
Description copied from interface:BlockSetReturns a transformation matrix for each structure giving the 3D superimposition information of the multiple structure alignment.- Specified by:
getTransformationsin interfaceBlockSet- Returns:
- the 3D superimposition information of the alignment
-
setTransformations
public void setTransformations(List<javax.vecmath.Matrix4d> transformations)
Description copied from interface:BlockSetSet a new superposition for the structures. This may trigger other properties to update which depend on the superposition.- Specified by:
setTransformationsin interfaceBlockSet
-
length
public int length()
Description copied from interface:BlockSetReturns the total number of aligned residues (columns) in the alignment: the sum of all Block lengths.- Specified by:
lengthin interfaceBlockSet- Returns:
- int the total number of aligned residues.
- See Also:
BlockSet.getCoreLength(),BlockSet.size()
-
size
public int size()
Description copied from interface:BlockSetReturns the number of aligned structures in the BlockSet.- Specified by:
sizein interfaceBlockSet- Returns:
- int number of aligned structures
- See Also:
BlockSet.length(),BlockSet.getCoreLength()
-
getCoreLength
public int getCoreLength()
Description copied from interface:BlockSetReturns the number of aligned residues (columns) without gaps in the alignment: the sum of all Block core lengths.- Specified by:
getCoreLengthin interfaceBlockSet- 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 List<Integer> getAlignResCounts()
Description copied from interface:BlockSetReturns 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:
getAlignResCountsin interfaceBlockSet- Returns:
- List of residue counts for each structure
-
-