Class SubunitCluster
- java.lang.Object
-
- org.biojava.nbio.structure.cluster.SubunitCluster
-
public class SubunitCluster extends Object
A SubunitCluster contains a set of equivalentQuatSymmetrySubunits
, the set of equivalent residues (EQR) betweenSubunit
and aSubunit
representative. It also stores the method used for clustering.This class allows the comparison and merging of SubunitClusters.
- Since:
- 5.0.0
- Author:
- Aleix Lafita
-
-
Constructor Summary
Constructors Constructor Description SubunitCluster(Subunit subunit)
A constructor from a single Subunit.SubunitCluster(SubunitCluster other, List<Integer> subunitsToRetain)
A copy constructor with the possibility of removing subunits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
divideInternally(SubunitClustererParameters clusterParams)
Analyze the internal symmetry of the SubunitCluster and divide itsSubunit
into the internal repeats (domains) if they are internally symmetric.Atom[]
getAlignedAtomsSubunit(int index)
List<Atom[]>
getAlignedAtomsSubunits()
String
getAlpha()
A letter that is assigned to this cluster in stoichiometry.SubunitClustererMethod
getClustererMethod()
MultipleAlignment
getMultipleAlignment()
The multiple alignment is calculated from the equivalent residues in the SubunitCluster.List<Subunit>
getSubunits()
Subunits contained in the SubunitCluster.boolean
isIdenticalTo(SubunitCluster other)
Tells whether the other SubunitCluster contains exactly the same Subunit.boolean
isPseudoStoichiometric()
int
length()
boolean
mergeIdentical(SubunitCluster other)
Merges the other SubunitCluster into this one if it contains exactly the same Subunit.boolean
mergeSequence(SubunitCluster other, SubunitClustererParameters params)
Merges the other SubunitCluster into this one if their representatives sequences are similar (according to the criteria in params).boolean
mergeSequence(SubunitCluster other, SubunitClustererParameters params, Alignments.PairwiseSequenceAlignerType alignerType, GapPenalty gapPenalty, SubstitutionMatrix<AminoAcidCompound> subsMatrix)
Merges the other SubunitCluster into this one if their representatives sequences are similar (according to the criteria in params).boolean
mergeStructure(SubunitCluster other, SubunitClustererParameters params)
Merges the other SubunitCluster into this one if their representative Atoms are structurally similar (according to the criteria in params).void
setAlpha(String alpha)
A letter that is assigned to this cluster in stoichiometry.int
size()
String
toString()
-
-
-
Constructor Detail
-
SubunitCluster
public SubunitCluster(Subunit subunit)
A constructor from a single Subunit. To obtain a SubunitCluster with multiple Subunits, initialize different SubunitClusters and merge them.- Parameters:
subunit
- initial Subunit
-
SubunitCluster
public SubunitCluster(SubunitCluster other, List<Integer> subunitsToRetain)
A copy constructor with the possibility of removing subunits. No re-clustering is done.- Parameters:
other
- reference SubunitClustersubunitsToRetain
- which subunits to copy to this cluster
-
-
Method Detail
-
getAlpha
public String getAlpha()
A letter that is assigned to this cluster in stoichiometry.- Returns:
- alpha String
-
setAlpha
public void setAlpha(String alpha)
A letter that is assigned to this cluster in stoichiometry.- Parameters:
alpha
- String
-
getSubunits
public List<Subunit> getSubunits()
Subunits contained in the SubunitCluster.- Returns:
- an unmodifiable view of the original List
-
isIdenticalTo
public boolean isIdenticalTo(SubunitCluster other)
Tells whether the other SubunitCluster contains exactly the same Subunit. This is checked by String equality of their residue one-letter sequences.- Parameters:
other
- SubunitCluster- Returns:
- true if the SubunitClusters are identical, false otherwise
-
mergeIdentical
public boolean mergeIdentical(SubunitCluster other)
Merges the other SubunitCluster into this one if it contains exactly the same Subunit. This is checked byisIdenticalTo(SubunitCluster)
.- Parameters:
other
- SubunitCluster- Returns:
- true if the SubunitClusters were merged, false otherwise
-
mergeSequence
public boolean mergeSequence(SubunitCluster other, SubunitClustererParameters params) throws CompoundNotFoundException
Merges the other SubunitCluster into this one if their representatives sequences are similar (according to the criteria in params).The sequence alignment is performed using linear
SimpleGapPenalty
and BLOSUM62 as scoring matrix.- Parameters:
other
- SubunitClusterparams
- SubunitClustererParameters, with information whether to use local or global alignment, sequence identity and coverage thresholds. Threshold values lower than 0.7 are not recommended. UsemergeStructure(org.biojava.nbio.structure.cluster.SubunitCluster, org.biojava.nbio.structure.cluster.SubunitClustererParameters)
for lower values.- Returns:
- true if the SubunitClusters were merged, false otherwise
- Throws:
CompoundNotFoundException
-
mergeSequence
public boolean mergeSequence(SubunitCluster other, SubunitClustererParameters params, Alignments.PairwiseSequenceAlignerType alignerType, GapPenalty gapPenalty, SubstitutionMatrix<AminoAcidCompound> subsMatrix) throws CompoundNotFoundException
Merges the other SubunitCluster into this one if their representatives sequences are similar (according to the criteria in params).The sequence alignment is performed using linear
SimpleGapPenalty
and BLOSUM62 as scoring matrix.- Parameters:
other
- SubunitClusterparams
-SubunitClustererParameters
, with information whether to use local or global alignment, sequence identity and coverage thresholds. Threshold values lower than 0.7 are not recommended. UsemergeStructure(org.biojava.nbio.structure.cluster.SubunitCluster, org.biojava.nbio.structure.cluster.SubunitClustererParameters)
for lower values.alignerType
- parameter for the sequence alignment algorithmgapPenalty
- parameter for the sequence alignment algorithmsubsMatrix
- parameter for the sequence alignment algorithm- Returns:
- true if the SubunitClusters were merged, false otherwise
- Throws:
CompoundNotFoundException
-
mergeStructure
public boolean mergeStructure(SubunitCluster other, SubunitClustererParameters params) throws StructureException
Merges the other SubunitCluster into this one if their representative Atoms are structurally similar (according to the criteria in params).- Parameters:
other
- SubunitClusterparams
-SubunitClustererParameters
, with information on what alignment algorithm to use, RMSD/TMScore and structure coverage thresholds.- Returns:
- true if the SubunitClusters were merged, false otherwise
- Throws:
StructureException
-
divideInternally
public boolean divideInternally(SubunitClustererParameters clusterParams) throws StructureException
Analyze the internal symmetry of the SubunitCluster and divide itsSubunit
into the internal repeats (domains) if they are internally symmetric.- Parameters:
clusterParams
-SubunitClustererParameters
with fields used as follows: structureCoverageThreshold the minimum coverage of all repeats in the Subunit rmsdThreshold the maximum allowed RMSD between the repeats minimumSequenceLength the minimum length of the repeating units- Returns:
- true if the cluster was internally symmetric, false otherwise
- Throws:
StructureException
-
size
public int size()
- Returns:
- the number of Subunits in the cluster
-
length
public int length()
- Returns:
- the number of aligned residues between Subunits of the cluster
-
getClustererMethod
public SubunitClustererMethod getClustererMethod()
- Returns:
- the
SubunitClustererMethod
used for clustering the Subunits
-
getAlignedAtomsSubunits
public List<Atom[]> getAlignedAtomsSubunits()
-
getAlignedAtomsSubunit
public Atom[] getAlignedAtomsSubunit(int index)
- Parameters:
index
- Subunit index in the Cluster- Returns:
- An Atom array of length
length()
with the aligned Atoms from the selected Subunit in the Cluster
-
getMultipleAlignment
public MultipleAlignment getMultipleAlignment() throws StructureException
The multiple alignment is calculated from the equivalent residues in the SubunitCluster. The alignment is recalculated every time the method is called (no caching).- Returns:
- MultipleAlignment representation of the aligned residues in this Subunit Cluster
- Throws:
StructureException
-
isPseudoStoichiometric
public boolean isPseudoStoichiometric()
- Returns:
- true if this cluster is considered pseudo-stoichiometric (i.e., was either clustered by structure, or by sequence with low scores), false otherwise.
-
-