Class Stoichiometry


  • public class Stoichiometry
    extends java.lang.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 Detail

      • Stoichiometry

        public Stoichiometry​(java.util.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​(java.util.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​(java.util.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​(java.util.List<SubunitCluster> clusters,
                             java.util.function.Function<java.util.List<SubunitCluster>,​java.lang.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 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 java.util.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.
      • 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​(java.util.function.Function<java.util.List<SubunitCluster>,​java.lang.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 java.lang.String getAlphabet()
        Returns:
        Alphabet (a sequence of characters) used in this stoichiometry to construct human-readable representation.
      • setAlphabet

        public void setAlphabet​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        Human-readable representation of this stoichiometry.