Class MultipleAlignmentEnsembleImpl
- java.lang.Object
-
- org.biojava.nbio.structure.align.multiple.AbstractScoresCache
-
- org.biojava.nbio.structure.align.multiple.MultipleAlignmentEnsembleImpl
-
- All Implemented Interfaces:
Serializable,Cloneable,MultipleAlignmentEnsemble,ScoresCache
public class MultipleAlignmentEnsembleImpl extends AbstractScoresCache implements MultipleAlignmentEnsemble, Serializable, Cloneable
A general implementation of aMultipleAlignmentEnsemble.- Since:
- 4.1.0
- Author:
- Aleix Lafita
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultipleAlignmentEnsembleImpl()Default Constructor.MultipleAlignmentEnsembleImpl(List<StructureIdentifier> structureIdentifiers)Constructor using structure identifiers.MultipleAlignmentEnsembleImpl(AFPChain afp, Atom[] ca1, Atom[] ca2, boolean flexible)Constructor from an AFPChain instance.MultipleAlignmentEnsembleImpl(MultipleAlignmentEnsembleImpl e)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMultipleAlignment(MultipleAlignment alignment)Add a new MultipleAlignment to the end of the ensemble and set its parent ensemble to this.voidclear()Clear the cached scores.MultipleAlignmentEnsembleImplclone()Creates and returns an identical copy of this ensemble, including a deep clone of all constituent alignments.StringgetAlgorithmName()Returns the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.List<Atom[]>getAtomArrays()Get an array of representative atoms for each structure (CA atoms for proteins).LonggetCalculationTime()Returns the running time of the structure alignment calculation, in milliseconds.List<Matrix>getDistanceMatrix()Returns the List containing the interatomic distance Matrix of each structure.LonggetIoTime()Returns the io time for this object, in milliseconds.MultipleAlignmentgetMultipleAlignment(int index)Returns the MultipleAlignments at the specified index in the ensemble.List<MultipleAlignment>getMultipleAlignments()Returns the List of MultipleAlignments in the ensemble.List<StructureIdentifier>getStructureIdentifiers()Returns a List containing the names of the structures aligned (i.e.: PDB code, SCOP domain, etc.).StringgetVersion()Returns the version of the algorithm used to generate the MultipleAlignment objects.voidsetAlgorithmName(String algorithmName)Set the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.voidsetAtomArrays(List<Atom[]> atomArrays)Sets the List of Atom arrays.voidsetCalculationTime(Long millis)Set the running time spent to calculate this alignment.voidsetIoTime(Long millis)Set the IO time to load this objectvoidsetMultipleAlignments(List<MultipleAlignment> alignments)Set the List of MultipleAlignments in the ensemble.voidsetStructureIdentifiers(List<StructureIdentifier> structureNames)Set the List containing the names of the structures aligned (i.e.: PDB code, SCOP domain, etc.).voidsetVersion(String version)Sets the version of the algorithm used to generate the MultipleAlignment objects.intsize()Returns the number of aligned structures in the MultipleAlignments.voidupdateAtomArrays()Force the atom arrays to regenerate based ongetStructureIdentifiers().voidupdateDistanceMatrix()Force recalculation of the distance matrices.-
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, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.nbio.structure.align.multiple.ScoresCache
getScore, getScores, putScore
-
-
-
-
Constructor Detail
-
MultipleAlignmentEnsembleImpl
public MultipleAlignmentEnsembleImpl()
Default Constructor. Empty ensemble, no structures assigned.
-
MultipleAlignmentEnsembleImpl
public MultipleAlignmentEnsembleImpl(List<StructureIdentifier> structureIdentifiers)
Constructor using structure identifiers.- Parameters:
structureIdentifiers- List of Structure names, that can be parsed byAtomCache.
-
MultipleAlignmentEnsembleImpl
public MultipleAlignmentEnsembleImpl(MultipleAlignmentEnsembleImpl e)
Copy constructor. This copies recursively all member variables, including MultipleAlignments, Atom arrays and cached variables.- Parameters:
e- MultipleAlignmentEnsemble to copy.
-
MultipleAlignmentEnsembleImpl
public MultipleAlignmentEnsembleImpl(AFPChain afp, Atom[] ca1, Atom[] ca2, boolean flexible)
Constructor from an AFPChain instance. Creates an equivalent pairwise alignment, but in the MultipleAlignment format.- Parameters:
afp- pairwise alignmentca1- Atoms of the first strcutureca2- Atoms of the second structureflexible- true if the alignment is flexible (use BlockSets)
-
-
Method Detail
-
clone
public MultipleAlignmentEnsembleImpl clone()
Description copied from interface:MultipleAlignmentEnsembleCreates and returns an identical copy of this ensemble, including a deep clone of all constituent alignments.- Specified by:
clonein interfaceMultipleAlignmentEnsemble- Overrides:
clonein classObject- Returns:
- MultipleAlignmentEnsemble identical copy of this object.
-
getAlgorithmName
public String getAlgorithmName()
Description copied from interface:MultipleAlignmentEnsembleReturns the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.- Specified by:
getAlgorithmNamein interfaceMultipleAlignmentEnsemble- Returns:
- String name of the algorithm.
- See Also:
MultipleAlignmentEnsemble.setAlgorithmName(String)
-
setAlgorithmName
public void setAlgorithmName(String algorithmName)
Description copied from interface:MultipleAlignmentEnsembleSet the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.- Specified by:
setAlgorithmNamein interfaceMultipleAlignmentEnsemble- Parameters:
algorithmName- name of the algorithm.- See Also:
MultipleAlignmentEnsemble.getAlgorithmName()
-
getVersion
public String getVersion()
Description copied from interface:MultipleAlignmentEnsembleReturns the version of the algorithm used to generate the MultipleAlignment objects.- Specified by:
getVersionin interfaceMultipleAlignmentEnsemble- Returns:
- String version of the algorithm.
- See Also:
MultipleAlignmentEnsemble.setVersion(String)
-
setVersion
public void setVersion(String version)
Description copied from interface:MultipleAlignmentEnsembleSets the version of the algorithm used to generate the MultipleAlignment objects.- Specified by:
setVersionin interfaceMultipleAlignmentEnsemble- Parameters:
version- the version of the algorithm.- See Also:
MultipleAlignmentEnsemble.getVersion()
-
getIoTime
public Long getIoTime()
Description copied from interface:MultipleAlignmentEnsembleReturns the io time for this object, in milliseconds.- Specified by:
getIoTimein interfaceMultipleAlignmentEnsemble- Returns:
- long creation time, or null if unset
-
setIoTime
public void setIoTime(Long millis)
Description copied from interface:MultipleAlignmentEnsembleSet the IO time to load this object- Specified by:
setIoTimein interfaceMultipleAlignmentEnsemble
-
getCalculationTime
public Long getCalculationTime()
Description copied from interface:MultipleAlignmentEnsembleReturns the running time of the structure alignment calculation, in milliseconds.- Specified by:
getCalculationTimein interfaceMultipleAlignmentEnsemble- Returns:
- long running time of the calculation, or null if unset
- See Also:
MultipleAlignmentEnsemble.getIoTime()
-
setCalculationTime
public void setCalculationTime(Long millis)
Description copied from interface:MultipleAlignmentEnsembleSet the running time spent to calculate this alignment.- Specified by:
setCalculationTimein interfaceMultipleAlignmentEnsemble
-
getStructureIdentifiers
public List<StructureIdentifier> getStructureIdentifiers()
Description copied from interface:MultipleAlignmentEnsembleReturns a List containing the names of the structures aligned (i.e.: PDB code, SCOP domain, etc.).The names are structure identifiers of the structures. They are in the same order as in the alignment Blocks (same index number for same structure).
- Specified by:
getStructureIdentifiersin interfaceMultipleAlignmentEnsemble- Returns:
- List of String names of the structures
- See Also:
MultipleAlignmentEnsemble.setStructureIdentifiers(List),MultipleAlignmentEnsemble.getAtomArrays()
-
setStructureIdentifiers
public void setStructureIdentifiers(List<StructureIdentifier> structureNames)
Description copied from interface:MultipleAlignmentEnsembleSet the List containing the names of the structures aligned (i.e.: PDB code, SCOP domain, etc.).The names are structure identifiers of the structures.
- Specified by:
setStructureIdentifiersin interfaceMultipleAlignmentEnsemble- Parameters:
structureNames- names of the structures, structure identifiers- See Also:
MultipleAlignmentEnsemble.getStructureIdentifiers(),MultipleAlignmentEnsemble.setAtomArrays(List)
-
getAtomArrays
public List<Atom[]> getAtomArrays()
Description copied from interface:MultipleAlignmentEnsembleGet an array of representative atoms for each structure (CA atoms for proteins).Atoms should be unrotated. Thus, to obtain a superimposed set of structures, each atom array should be cloned and then rotated according to the transformation matrix.
If atoms have not previously been set using
MultipleAlignmentEnsemble.setAtomArrays(List), attempts to load representative atoms based onMultipleAlignmentEnsemble.getStructureIdentifiers(). If it fails to load the Atoms it gives a NullPointerException before returning null.- Specified by:
getAtomArraysin interfaceMultipleAlignmentEnsemble- Returns:
- List of Atom[].
- See Also:
MultipleAlignmentEnsemble.setAtomArrays(List)
-
setAtomArrays
public void setAtomArrays(List<Atom[]> atomArrays)
Description copied from interface:MultipleAlignmentEnsembleSets the List of Atom arrays. Every structure has an Atom array associated. Note that this should be called in conjunction withMultipleAlignmentEnsemble.setStructureIdentifiers(List).Setting the atom arrays to null will cause them to be automatically regenerated based on
MultipleAlignmentEnsemble.getStructureIdentifiers()during the next call toMultipleAlignmentEnsemble.getAtomArrays().- Specified by:
setAtomArraysin interfaceMultipleAlignmentEnsemble- Parameters:
atomArrays- the List of representative (C-alpha) atom arrays- See Also:
MultipleAlignmentEnsemble.getAtomArrays(),MultipleAlignmentEnsemble.setStructureIdentifiers(List)
-
updateAtomArrays
public void updateAtomArrays() throws IOException, StructureException
Force the atom arrays to regenerate based ongetStructureIdentifiers().- Throws:
IOExceptionStructureException
-
getDistanceMatrix
public List<Matrix> getDistanceMatrix()
Description copied from interface:MultipleAlignmentEnsembleReturns the List containing the interatomic distance Matrix of each structure.- Specified by:
getDistanceMatrixin interfaceMultipleAlignmentEnsemble- Returns:
- List of Matrix interatomic distance matrices.
- See Also:
#updateDistanceMatrix()
-
updateDistanceMatrix
public void updateDistanceMatrix()
Force recalculation of the distance matrices.
-
getMultipleAlignments
public List<MultipleAlignment> getMultipleAlignments()
Description copied from interface:MultipleAlignmentEnsembleReturns the List of MultipleAlignments in the ensemble.- Specified by:
getMultipleAlignmentsin interfaceMultipleAlignmentEnsemble- Returns:
- List of MultipleAlignment in the ensemble.
- See Also:
#setMultipleAlignments()
-
getMultipleAlignment
public MultipleAlignment getMultipleAlignment(int index)
Description copied from interface:MultipleAlignmentEnsembleReturns the MultipleAlignments at the specified index in the ensemble. Throws an exception equivalently to accessing an index of a List- Specified by:
getMultipleAlignmentin interfaceMultipleAlignmentEnsemble- Returns:
- MultipleAlignment at the index in the ensemble.
- See Also:
#setMultipleAlignments()
-
setMultipleAlignments
public void setMultipleAlignments(List<MultipleAlignment> alignments)
Description copied from interface:MultipleAlignmentEnsembleSet the List of MultipleAlignments in the ensemble.- Specified by:
setMultipleAlignmentsin interfaceMultipleAlignmentEnsemble- Parameters:
alignments- List of MultipleAlignments that are part of the ensemble.- See Also:
MultipleAlignmentEnsemble.addMultipleAlignment(MultipleAlignment)
-
addMultipleAlignment
public void addMultipleAlignment(MultipleAlignment alignment)
Description copied from interface:MultipleAlignmentEnsembleAdd a new MultipleAlignment to the end of the ensemble and set its parent ensemble to this.- Specified by:
addMultipleAlignmentin interfaceMultipleAlignmentEnsemble
-
size
public int size()
Description copied from interface:MultipleAlignmentEnsembleReturns the number of aligned structures in the MultipleAlignments.- Specified by:
sizein interfaceMultipleAlignmentEnsemble- Returns:
- int number of aligned structures.
- See Also:
MultipleAlignmentEnsemble.getStructureIdentifiers(),MultipleAlignmentEnsemble.getAtomArrays()
-
clear
public void clear()
Description copied from class:AbstractScoresCacheClear the cached scores. This frees memory after the alignment changed.- Specified by:
clearin interfaceMultipleAlignmentEnsemble- Overrides:
clearin classAbstractScoresCache
-
-