Class Stoichiometry
- java.lang.Object
-
- org.biojava.nbio.structure.symmetry.core.Stoichiometry
-
public class Stoichiometry extends Object
A utility object that describes Stoichiometry (composition of a protein assembly), determined via clustering procedureSubunitClusterer
, and implements human-readable representation using various strategies.- Since:
- 5.0.0
- Author:
- Dmytro Guzenko
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Stoichiometry.StringOverflowStrategy
What to do when the number ofSubunitCluster
exceeds the length of the alphabet.
-
Constructor Summary
Constructors Constructor Description Stoichiometry(List<SubunitCluster> clusters)
Constructor for Stoichiometry.Stoichiometry(List<SubunitCluster> clusters, boolean resetAlphas)
Constructor for Stoichiometry.Stoichiometry(List<SubunitCluster> clusters, Function<List<SubunitCluster>,String> customStringGenerator)
Constructor for Stoichiometry.Stoichiometry(List<SubunitCluster> clusters, Stoichiometry.StringOverflowStrategy strategy)
Constructor for Stoichiometry.Stoichiometry(List<SubunitCluster> clusters, Stoichiometry.StringOverflowStrategy strategy, boolean resetAlphas)
Constructor for Stoichiometry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stoichiometry
combineWith(Stoichiometry other)
Make a combined Stoichiometry object of this> and the other>.String
getAlphabet()
List<SubunitCluster>
getClusters()
Stoichiometry
getComponent(int i)
Make a Stoichiometry object that corresponds to a single component.Stoichiometry.StringOverflowStrategy
getStrategy()
boolean
isPseudoStoichiometric()
A pseudostoichiometricSubunitCluster
was obtained using theSubunitClustererMethod.STRUCTURE
similarity, orSubunitClustererMethod.SEQUENCE
similarity with low scores.int
numberOfComponents()
void
resetAlphas()
Reassign alpha-strings for each cluster according to the current strategy.void
setAlphabet(String alphabet)
Change alphabet used for string representation of a stoichiometry.void
setCustomStringGenerator(Function<List<SubunitCluster>,String> customStringGenerator)
Let a user-defined function handle the entire string representation of a stoichiometry.void
setStrategy(Stoichiometry.StringOverflowStrategy strategy)
Change string representation of a stoichiometry in case number of clusters exceeds number of letters in the alphabet.String
toString()
-
-
-
Constructor Detail
-
Stoichiometry
public Stoichiometry(List<SubunitCluster> clusters)
Constructor for Stoichiometry. The default strategy is CYCLE, the letters assigned for each cluster will be reset.- Parameters:
clusters
- List ofSubunitCluster
that defines assembly composition.
-
Stoichiometry
public Stoichiometry(List<SubunitCluster> clusters, boolean resetAlphas)
Constructor for Stoichiometry. The default strategy is CYCLE.- Parameters:
clusters
- List ofSubunitCluster
that defines assembly composition.resetAlphas
- Whether to keep alphas assigned toSubunitCluster
object (useful for local symmetry detection) or to generate them anew.
-
Stoichiometry
public Stoichiometry(List<SubunitCluster> clusters, Stoichiometry.StringOverflowStrategy strategy)
Constructor for Stoichiometry. The alphas assigned toSubunitCluster
objects will be reset.- Parameters:
clusters
- List ofSubunitCluster
that defines assembly composition.strategy
- What to do if number ofSubunitCluster
exceeds the alphabet length.
-
Stoichiometry
public Stoichiometry(List<SubunitCluster> clusters, Stoichiometry.StringOverflowStrategy strategy, boolean resetAlphas)
Constructor for Stoichiometry.- Parameters:
clusters
- List ofSubunitCluster
that defines assembly composition.strategy
- What to do if number ofSubunitCluster
exceeds the alphabet length.resetAlphas
- Whether to keep alphas assigned toSubunitCluster
object (useful for local symmetry detection) or to generate them anew.
-
Stoichiometry
public Stoichiometry(List<SubunitCluster> clusters, Function<List<SubunitCluster>,String> customStringGenerator)
Constructor for Stoichiometry.- Parameters:
clusters
- List ofSubunitCluster
that defines assembly composition.customStringGenerator
- A function which produces a string for a composition (list of subunit clusters).
-
-
Method Detail
-
resetAlphas
public void resetAlphas()
Reassign alpha-strings for each cluster according to the current strategy. Has no effect if custom string generator is used.
-
getClusters
public List<SubunitCluster> getClusters()
- Returns:
- list of
SubunitCluster
, ordered by the number of subunits (decreasing).
-
numberOfComponents
public int numberOfComponents()
- Returns:
- Number of distinct components in this stoichiometry.
-
combineWith
public Stoichiometry combineWith(Stoichiometry other)
Make a combined Stoichiometry object of this> and the other>. The combined list of clusters will be ordered by the number of subunits.- Returns:
- new
Stoichiometry
object.
-
getComponent
public Stoichiometry getComponent(int i)
Make a Stoichiometry object that corresponds to a single component.- Parameters:
i
- component index- Returns:
- new
Stoichiometry
object.
-
getStrategy
public Stoichiometry.StringOverflowStrategy getStrategy()
- Returns:
Stoichiometry.StringOverflowStrategy
used in this stoichiometry to construct human-readable representation in case number of clusters exceeds number of letters in the alphabet.
-
setStrategy
public void setStrategy(Stoichiometry.StringOverflowStrategy strategy)
Change string representation of a stoichiometry in case number of clusters exceeds number of letters in the alphabet. This action may invalidate alphas already assigned to the clusters.- Parameters:
strategy
-Stoichiometry.StringOverflowStrategy
used in this stoichiometry to construct human-readable representation in case number of clusters exceeds number of letters in the alphabet.
-
setCustomStringGenerator
public void setCustomStringGenerator(Function<List<SubunitCluster>,String> customStringGenerator)
Let a user-defined function handle the entire string representation of a stoichiometry.- Parameters:
customStringGenerator
- A function which accepts a list of subunit clusters and returns a string.
-
getAlphabet
public String getAlphabet()
- Returns:
- Alphabet (a sequence of characters) used in this stoichiometry to construct human-readable representation.
-
setAlphabet
public void setAlphabet(String alphabet)
Change alphabet used for string representation of a stoichiometry. This action invalidates alphas already assigned to the clusters.- Parameters:
alphabet
- a sequence of characters used in this stoichiometry to construct human-readable representation.
-
isPseudoStoichiometric
public boolean isPseudoStoichiometric()
A pseudostoichiometricSubunitCluster
was obtained using theSubunitClustererMethod.STRUCTURE
similarity, orSubunitClustererMethod.SEQUENCE
similarity with low scores.- Returns:
- true if any of the clusters is pseudostoichiometric, false otherwise
-
-