java.lang.Object
com.compomics.util.experiment.identification.protein_sequences.digestion.ProteinIteratorUtils

public class ProteinIteratorUtils
extends Object
This class contains utilities used during the iteration of protein sequences.
Author:
Marc Vaudel
  • Field Details

    • WATER_MASS

      public static final double WATER_MASS
      The mass of water (H2O).
  • Constructor Details

    • ProteinIteratorUtils

      public ProteinIteratorUtils()
      Empty default constructor
    • ProteinIteratorUtils

      public ProteinIteratorUtils​(ArrayList<String> fixedModifications, Integer maxX)
      Constructor.
      Parameters:
      fixedModifications - a list of fixed modifications to consider when iterating the protein sequences.
      maxX - The maximal number of Xs allowed in a sequence to derive the possible peptides
  • Method Details

    • getNtermModification

      public String getNtermModification​(boolean proteinNTerm, char nTermAaChar, String proteinSequence)
      Returns the N-term modification for the given amino acid. Null if no modification is found.
      Parameters:
      proteinNTerm - boolean indicating whether the amino acid is at the protein N-terminus
      nTermAaChar - the amino acid as character
      proteinSequence - the protein sequence
      Returns:
      the N-term modification for the given amino acid.
    • getCtermModification

      public String getCtermModification​(PeptideDraft peptideDraft, String proteinSequence, int indexOnProtein)
      Returns the c-terminal modification for the given peptide draft.
      Parameters:
      peptideDraft - the peptide draft of interest
      proteinSequence - the protein sequence
      indexOnProtein - the index of the peptide draft on the protein
      Returns:
      the c-terminal modification for the given peptide draft
    • getModificationMass

      public double getModificationMass​(String modificationName)
      Returns the mass corresponding to a given modification.
      Parameters:
      modificationName - the name of the modification
      Returns:
      the mass of the modification
    • getFixedModificationAtAa

      public String getFixedModificationAtAa​(char aa)
      Returns the fixed modification that can be found at the given amino acid. Null if none.
      Parameters:
      aa - the one letter code of the amino acid
      Returns:
      the fixed modification that can be found at the given amino acid
    • getModificationPattern

      public AminoAcidPattern getModificationPattern​(String modificationName)
      Returns the modification pattern that is targeted by the given modification. Null if no pattern longer than one is targeted.
      Parameters:
      modificationName - the name of the modification
      Returns:
      the modification pattern that is targeted
    • getMaxXsInSequence

      public int getMaxXsInSequence()
      Returns the maximal number of Xs to account for in a sequence.
      Returns:
      the maximal number of Xs to account for in a sequence
    • getMinCtermMass

      public double getMinCtermMass()
      Returns the minimal mass to consider for a c-terminus.
      Returns:
      the minimal mass to consider for a c-terminus
    • getPeptideFromProtein

      public ExtendedPeptide getPeptideFromProtein​(char[] proteinSequence, int indexOnProtein, double massMin, double massMax)
      Returns a peptide from the given sequence. The sequence should not contain ambiguous amino acids. Peptides are filtered according to the given masses. Filters are ignored if null.
      Parameters:
      proteinSequence - the protein sequence where this peptide was found
      indexOnProtein - the index on the protein
      massMin - the minimal mass
      massMax - the maximal mass
      Returns:
      a peptide from the given sequence
    • getPeptideFromProtein

      public ExtendedPeptide getPeptideFromProtein​(char[] peptideSequence, String proteinSequence, int indexOnProtein, Double massMin, Double massMax)
      Returns a peptide from the given sequence on the given protein. The sequence should not contain ambiguous amino acids. Peptides are filtered according to the given masses. Filters are ignored if null.
      Parameters:
      peptideSequence - the peptide sequence
      proteinSequence - the protein sequence where this peptide was found
      indexOnProtein - the index on the protein
      massMin - the minimal mass
      massMax - the maximal mass
      Returns:
      a peptide from the given sequence
    • getPeptideFromProtein

      public ExtendedPeptide getPeptideFromProtein​(char[] peptideSequence, String proteinSequence, int indexOnProtein, double massMin, double massMax, BoxedObject<Boolean> smallMass)
      Returns a peptide from the given sequence on the given protein. The sequence should not contain ambiguous amino acids. Peptides are filtered according to the given masses. Filters are ignored if null.
      Parameters:
      peptideSequence - the peptide sequence
      proteinSequence - the protein sequence where this peptide was found
      indexOnProtein - the index on the protein
      massMin - the minimal mass
      massMax - the maximal mass
      smallMass - an encapsulated boolean indicating whether the peptide passed the maximal mass filter
      Returns:
      a peptide from the given sequence