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 void
addMultipleAlignment(MultipleAlignment alignment)
Add a new MultipleAlignment to the end of the ensemble and set its parent ensemble to this.void
clear()
Clear the cached scores.MultipleAlignmentEnsembleImpl
clone()
Creates and returns an identical copy of this ensemble, including a deep clone of all constituent alignments.String
getAlgorithmName()
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).Long
getCalculationTime()
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.Long
getIoTime()
Returns the io time for this object, in milliseconds.MultipleAlignment
getMultipleAlignment(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.).String
getVersion()
Returns the version of the algorithm used to generate the MultipleAlignment objects.void
setAlgorithmName(String algorithmName)
Set the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.void
setAtomArrays(List<Atom[]> atomArrays)
Sets the List of Atom arrays.void
setCalculationTime(Long millis)
Set the running time spent to calculate this alignment.void
setIoTime(Long millis)
Set the IO time to load this objectvoid
setMultipleAlignments(List<MultipleAlignment> alignments)
Set the List of MultipleAlignments in the ensemble.void
setStructureIdentifiers(List<StructureIdentifier> structureNames)
Set the List containing the names of the structures aligned (i.e.: PDB code, SCOP domain, etc.).void
setVersion(String version)
Sets the version of the algorithm used to generate the MultipleAlignment objects.int
size()
Returns the number of aligned structures in the MultipleAlignments.void
updateAtomArrays()
Force the atom arrays to regenerate based ongetStructureIdentifiers()
.void
updateDistanceMatrix()
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:MultipleAlignmentEnsemble
Creates and returns an identical copy of this ensemble, including a deep clone of all constituent alignments.- Specified by:
clone
in interfaceMultipleAlignmentEnsemble
- Overrides:
clone
in classObject
- Returns:
- MultipleAlignmentEnsemble identical copy of this object.
-
getAlgorithmName
public String getAlgorithmName()
Description copied from interface:MultipleAlignmentEnsemble
Returns the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.- Specified by:
getAlgorithmName
in interfaceMultipleAlignmentEnsemble
- Returns:
- String name of the algorithm.
- See Also:
MultipleAlignmentEnsemble.setAlgorithmName(String)
-
setAlgorithmName
public void setAlgorithmName(String algorithmName)
Description copied from interface:MultipleAlignmentEnsemble
Set the name of the multiple structure alignment algorithm that created the MultipleAlignment objects.- Specified by:
setAlgorithmName
in interfaceMultipleAlignmentEnsemble
- Parameters:
algorithmName
- name of the algorithm.- See Also:
MultipleAlignmentEnsemble.getAlgorithmName()
-
getVersion
public String getVersion()
Description copied from interface:MultipleAlignmentEnsemble
Returns the version of the algorithm used to generate the MultipleAlignment objects.- Specified by:
getVersion
in interfaceMultipleAlignmentEnsemble
- Returns:
- String version of the algorithm.
- See Also:
MultipleAlignmentEnsemble.setVersion(String)
-
setVersion
public void setVersion(String version)
Description copied from interface:MultipleAlignmentEnsemble
Sets the version of the algorithm used to generate the MultipleAlignment objects.- Specified by:
setVersion
in interfaceMultipleAlignmentEnsemble
- Parameters:
version
- the version of the algorithm.- See Also:
MultipleAlignmentEnsemble.getVersion()
-
getIoTime
public Long getIoTime()
Description copied from interface:MultipleAlignmentEnsemble
Returns the io time for this object, in milliseconds.- Specified by:
getIoTime
in interfaceMultipleAlignmentEnsemble
- Returns:
- long creation time, or null if unset
-
setIoTime
public void setIoTime(Long millis)
Description copied from interface:MultipleAlignmentEnsemble
Set the IO time to load this object- Specified by:
setIoTime
in interfaceMultipleAlignmentEnsemble
-
getCalculationTime
public Long getCalculationTime()
Description copied from interface:MultipleAlignmentEnsemble
Returns the running time of the structure alignment calculation, in milliseconds.- Specified by:
getCalculationTime
in 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:MultipleAlignmentEnsemble
Set the running time spent to calculate this alignment.- Specified by:
setCalculationTime
in interfaceMultipleAlignmentEnsemble
-
getStructureIdentifiers
public List<StructureIdentifier> getStructureIdentifiers()
Description copied from interface:MultipleAlignmentEnsemble
Returns 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:
getStructureIdentifiers
in 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:MultipleAlignmentEnsemble
Set 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:
setStructureIdentifiers
in 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:MultipleAlignmentEnsemble
Get 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:
getAtomArrays
in interfaceMultipleAlignmentEnsemble
- Returns:
- List of Atom[].
- See Also:
MultipleAlignmentEnsemble.setAtomArrays(List)
-
setAtomArrays
public void setAtomArrays(List<Atom[]> atomArrays)
Description copied from interface:MultipleAlignmentEnsemble
Sets 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:
setAtomArrays
in 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:
IOException
StructureException
-
getDistanceMatrix
public List<Matrix> getDistanceMatrix()
Description copied from interface:MultipleAlignmentEnsemble
Returns the List containing the interatomic distance Matrix of each structure.- Specified by:
getDistanceMatrix
in 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:MultipleAlignmentEnsemble
Returns the List of MultipleAlignments in the ensemble.- Specified by:
getMultipleAlignments
in interfaceMultipleAlignmentEnsemble
- Returns:
- List of MultipleAlignment in the ensemble.
- See Also:
#setMultipleAlignments()
-
getMultipleAlignment
public MultipleAlignment getMultipleAlignment(int index)
Description copied from interface:MultipleAlignmentEnsemble
Returns the MultipleAlignments at the specified index in the ensemble. Throws an exception equivalently to accessing an index of a List- Specified by:
getMultipleAlignment
in interfaceMultipleAlignmentEnsemble
- Returns:
- MultipleAlignment at the index in the ensemble.
- See Also:
#setMultipleAlignments()
-
setMultipleAlignments
public void setMultipleAlignments(List<MultipleAlignment> alignments)
Description copied from interface:MultipleAlignmentEnsemble
Set the List of MultipleAlignments in the ensemble.- Specified by:
setMultipleAlignments
in 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:MultipleAlignmentEnsemble
Add a new MultipleAlignment to the end of the ensemble and set its parent ensemble to this.- Specified by:
addMultipleAlignment
in interfaceMultipleAlignmentEnsemble
-
size
public int size()
Description copied from interface:MultipleAlignmentEnsemble
Returns the number of aligned structures in the MultipleAlignments.- Specified by:
size
in interfaceMultipleAlignmentEnsemble
- Returns:
- int number of aligned structures.
- See Also:
MultipleAlignmentEnsemble.getStructureIdentifiers()
,MultipleAlignmentEnsemble.getAtomArrays()
-
clear
public void clear()
Description copied from class:AbstractScoresCache
Clear the cached scores. This frees memory after the alignment changed.- Specified by:
clear
in interfaceMultipleAlignmentEnsemble
- Overrides:
clear
in classAbstractScoresCache
-
-