Class MultipleAlignmentImpl
java.lang.Object
org.biojava.nbio.structure.align.multiple.AbstractScoresCache
org.biojava.nbio.structure.align.multiple.MultipleAlignmentImpl
- All Implemented Interfaces:
Serializable,Cloneable,MultipleAlignment,ScoresCache
public class MultipleAlignmentImpl
extends AbstractScoresCache
implements Serializable, MultipleAlignment, Cloneable
A general implementation of a
MultipleAlignment.- Since:
- 4.1.0
- Author:
- Aleix Lafita
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.Constructor linking to an existing ensemble.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cached scores.clone()Creates and returns an identical copy of this alignment, including a deep copy of all constituent BlockSets.Returns the number of non null positions (residues) of each structure in the alignment.Returns the array of Atoms for each structure from its parent Ensemble.getBlock(int index) Returns the Block with the specified index of the MultipleAlignment.Convenience method to get a List of all Blocks from all BlockSets.getBlockSet(int index) Returns the BlockSet with the specified index of the MultipleAlignment.Returns the BlockSet List of the multiple structure alignment.intReturns the number of aligned residues (columns) without gaps in the alignment: the sum of all BlockSet core lengths.Returns the coverage of the alignment for each structure in the alignment as a fraction between 0.0 and 1.0.Returns the parent Ensemble of the MultipleAlignment.getStructureIdentifier(int index) Returns the StructureIdentifier associated with the structure index from its parent Ensemble.intlength()Returns the total number of aligned residues (columns) in the multiple alignment: the sum of all BlockSet lengths.voidsetBlockSets(List<BlockSet> blockSets) Sets the List of BlockSet List of the specified alignment.voidsetEnsemble(MultipleAlignmentEnsemble parent) Set the back-reference to its parent Ensemble.intsize()Returns the number of aligned structures in the MultipleAlignment.toString()Return a summary of the MultipleAlignment, containing the structures, the lengths and the cached scores.protected voidUpdates all cached propertiesprotected voidForce recalculation of the core length (ungapped columns) based on the BlockSet core lengths.protected voidForce recalculation of the length (aligned columns) based on the BlockSet lengths.Methods inherited from class org.biojava.nbio.structure.align.multiple.AbstractScoresCache
clone, getScore, getScores, putScoreMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.nbio.structure.align.multiple.ScoresCache
getScore, getScores, putScore
-
Constructor Details
-
MultipleAlignmentImpl
public MultipleAlignmentImpl()Default Constructor. Empty alignment. No structures assigned. -
MultipleAlignmentImpl
Constructor linking to an existing ensemble. Automatically adds this alignment to the parent ensemble.- Parameters:
ensemble- parent MultipleAlignmentEnsemble.
-
MultipleAlignmentImpl
Copy constructor. Recursively copies member BlockSets.- Parameters:
ma- MultipleAlignmentImpl to copy.
-
-
Method Details
-
clear
Description copied from class:AbstractScoresCacheClear the cached scores. This frees memory after the alignment changed.- Specified by:
clearin interfaceMultipleAlignment- Overrides:
clearin classAbstractScoresCache
-
clone
Description copied from interface:MultipleAlignmentCreates and returns an identical copy of this alignment, including a deep copy of all constituent BlockSets.- Specified by:
clonein interfaceMultipleAlignment- Overrides:
clonein classObject- Returns:
- MultipleAlignment identical copy of this object.
-
toString
Description copied from interface:MultipleAlignmentReturn a summary of the MultipleAlignment, containing the structures, the lengths and the cached scores. Can be used as a header for the differnt display options.- Specified by:
toStringin interfaceMultipleAlignment- Overrides:
toStringin classObject- Returns:
- String header summary of the MultipleAlignment
-
getBlockSets
Description copied from interface:MultipleAlignmentReturns the BlockSet List of the multiple structure alignment. Initializes the variable if it is null.- Specified by:
getBlockSetsin interfaceMultipleAlignment- Returns:
- List of BlockSets that describe the aligned residues of all the structures.
- See Also:
-
getBlocks
Description copied from interface:MultipleAlignmentConvenience method to get a List of all Blocks from all BlockSets. Modifications of this List will not alter the MultipleAlignment, but modifications to the Blocks will.- Specified by:
getBlocksin interfaceMultipleAlignment- Returns:
- List of Blocks
- See Also:
-
setBlockSets
Description copied from interface:MultipleAlignmentSets the List of BlockSet List of the specified alignment.- Specified by:
setBlockSetsin interfaceMultipleAlignment- Parameters:
blockSets- the List of BlockSets that describe the aligned residues.- See Also:
-
getBlockSet
Description copied from interface:MultipleAlignmentReturns the BlockSet with the specified index of the MultipleAlignment. Throws an Exception if the index is out of bounds, like accessing a normal List.- Specified by:
getBlockSetin interfaceMultipleAlignment- Parameters:
index- of the BlockSet- Returns:
- BlockSets at the specified index
- See Also:
-
getBlock
Description copied from interface:MultipleAlignmentReturns the Block with the specified index of the MultipleAlignment. Throws an Exception if the index is out of bounds, like accessing a normal List.- Specified by:
getBlockin interfaceMultipleAlignment- Parameters:
index- of the BlockSet- Returns:
- Block at the specified index
- See Also:
-
getAtomArrays
Description copied from interface:MultipleAlignmentReturns the array of Atoms for each structure from its parent Ensemble. Throws an Exception if the parent ensemble is null or the Atom variables are not previously set.- Specified by:
getAtomArraysin interfaceMultipleAlignment- Returns:
- List of Atom arrays
- See Also:
-
getStructureIdentifier
Description copied from interface:MultipleAlignmentReturns the StructureIdentifier associated with the structure index from its parent Ensemble. Throws an Exception if the parent ensemble is null or the StructureIdentifiers are not previously set.- Specified by:
getStructureIdentifierin interfaceMultipleAlignment- Returns:
- StructureIdentifier
- See Also:
-
size
Description copied from interface:MultipleAlignmentReturns the number of aligned structures in the MultipleAlignment.- Specified by:
sizein interfaceMultipleAlignment- Returns:
- int number of aligned structures
- See Also:
-
length
Description copied from interface:MultipleAlignmentReturns the total number of aligned residues (columns) in the multiple alignment: the sum of all BlockSet lengths.- Specified by:
lengthin interfaceMultipleAlignment- Returns:
- int the total number of aligned residues in the alignment.
- See Also:
-
getCoreLength
Description copied from interface:MultipleAlignmentReturns the number of aligned residues (columns) without gaps in the alignment: the sum of all BlockSet core lengths.- Specified by:
getCoreLengthin interfaceMultipleAlignment- Returns:
- int the total number of aligned residues.
- See Also:
-
updateLength
Force recalculation of the length (aligned columns) based on the BlockSet lengths. -
updateCoreLength
Force recalculation of the core length (ungapped columns) based on the BlockSet core lengths. -
updateCache
Updates all cached properties -
getEnsemble
Description copied from interface:MultipleAlignmentReturns the parent Ensemble of the MultipleAlignment. Returns null if there is no referenced object.- Specified by:
getEnsemblein interfaceMultipleAlignment- Returns:
- MultipleAlignmentEnsemble the parent MultipleAlignment of the BlockSet, or null.
- See Also:
-
setEnsemble
Description copied from interface:MultipleAlignmentSet the back-reference to its parent Ensemble.Neither removes this alignment from its previous ensemble, 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:
setEnsemblein interfaceMultipleAlignment- Parameters:
parent- the parent MultipleAlignmentEnsemble.- See Also:
-
getAlignResCounts
Description copied from interface:MultipleAlignmentReturns the number of non null positions (residues) of each structure in the alignment. The values can be used to compute the coverages.- Specified by:
getAlignResCountsin interfaceMultipleAlignment- Returns:
- List of residue counts for each structure
-
getCoverages
Description copied from interface:MultipleAlignmentReturns the coverage of the alignment for each structure in the alignment as a fraction between 0.0 and 1.0.- Specified by:
getCoveragesin interfaceMultipleAlignment- Returns:
- List coverage for each structure
-