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 procedure SubunitClusterer, and implements human-readable representation using various strategies.
Since:
5.0.0
Author:
Dmytro Guzenko
  • Constructor Details

    • 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 of SubunitCluster that defines assembly composition.
    • Stoichiometry

      public Stoichiometry(List<SubunitCluster> clusters, boolean resetAlphas)
      Constructor for Stoichiometry. The default strategy is CYCLE.
      Parameters:
      clusters - List of SubunitCluster that defines assembly composition.
      resetAlphas - Whether to keep alphas assigned to SubunitCluster 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 to SubunitCluster objects will be reset.
      Parameters:
      clusters - List of SubunitCluster that defines assembly composition.
      strategy - What to do if number of SubunitCluster exceeds the alphabet length.
    • Stoichiometry

      public Stoichiometry(List<SubunitCluster> clusters, Stoichiometry.StringOverflowStrategy strategy, boolean resetAlphas)
      Constructor for Stoichiometry.
      Parameters:
      clusters - List of SubunitCluster that defines assembly composition.
      strategy - What to do if number of SubunitCluster exceeds the alphabet length.
      resetAlphas - Whether to keep alphas assigned to SubunitCluster 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 of SubunitCluster that defines assembly composition.
      customStringGenerator - A function which produces a string for a composition (list of subunit clusters).
  • Method Details

    • 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 thisinvalid input: '<'/> and the otherinvalid input: '<'/>. 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

      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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      Human-readable representation of this stoichiometry.
    • isPseudoStoichiometric

      public boolean isPseudoStoichiometric()
      A pseudostoichiometric SubunitCluster was obtained using the SubunitClustererMethod.STRUCTURE similarity, or SubunitClustererMethod.SEQUENCE similarity with low scores.
      Returns:
      true if any of the clusters is pseudostoichiometric, false otherwise