Class IonFactory

java.lang.Object
com.compomics.util.experiment.biology.ions.IonFactory

public class IonFactory
extends Object
This factory generates the expected ions from a peptide.
Author:
Marc Vaudel, Harald Barsnes
  • Method Details

    • getInstance

      public static IonFactory getInstance()
      Static method which returns the instance of the factory.
      Returns:
      the instance of the factory
    • getDefaultNeutralLosses

      public static HashSet<String> getDefaultNeutralLosses()
      Returns the default neutral losses.
      Returns:
      the default neutral losses
    • getNeutralLosses

      public static HashSet<String> getNeutralLosses​(ModificationParameters modificationParameters)
      Returns a list containing the default neutral losses and the losses found in the given modifications. Note: modifications must be loaded in the modification factory.
      Parameters:
      modificationParameters - the modification parameters
      Returns:
      the neutral losses expected in the dataset
    • getReporterIons

      public static HashSet<Integer> getReporterIons​(ModificationParameters modificationParameters)
      Returns the reporter ions to annotate with the given PTM settings.
      Parameters:
      modificationParameters - the PTMs to annotate
      Returns:
      a hashset of the subtype indexes of the reporter ions to annotate
    • getFragmentIons

      public HashMap<Integer,​HashMap<Integer,​ArrayList<Ion>>> getFragmentIons​(Peptide peptide, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
      This method returns all the theoretic ions expected from a peptide. /!\ this method will work only if the modifications found in the peptide are in the ModificationFactory.
      Parameters:
      peptide - The considered peptide
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      Returns:
      the expected fragment ions
    • getFragmentIons

      public HashMap<Integer,​HashMap<Integer,​ArrayList<Ion>>> getFragmentIons​(Peptide peptide, SpecificAnnotationParameters specificAnnotationSettings, ModificationParameters modificationParameters, SequenceProvider sequenceProvider, SequenceMatchingParameters modificationsSequenceMatchingParameters)
      This method returns the theoretic ions expected from a peptide. /!\ this method will work only if the modifications found in the peptide are in the ModificationFactory.
      Parameters:
      peptide - the considered peptide
      specificAnnotationSettings - if provided, only the ions detectable using these settings will be selected
      modificationParameters - the modification parameters the modification parameters
      sequenceProvider - a protein sequence provider
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      Returns:
      the expected fragment ions
    • getFragmentIons

      public HashMap<Integer,​HashMap<Integer,​ArrayList<Ion>>> getFragmentIons​(Tag tag, ModificationParameters modificationParameters, SequenceMatchingParameters modificationsSequenceMatchingParameters)
      This method returns the theoretic ions expected from a tag. /!\ this method will work only if the PTMs found in the tag are in the PTMFactory.
      Parameters:
      tag - the considered tag
      modificationParameters - the modification parameters the modification parameters
      modificationsSequenceMatchingParameters - the sequence matching parameters to use for modifications
      Returns:
      the expected fragment ions
    • getNeutralLossesCombinations

      public NeutralLossCombination[] getNeutralLossesCombinations​(HashSet<String> possibleNeutralLosses)
      Returns the possible neutral losses combinations as array of arrays of neutral losses.
      Parameters:
      possibleNeutralLosses - the possible neutral losses to include
      Returns:
      the possible neutral losses combinations
    • getLossesMass

      public static double getLossesMass​(NeutralLoss[] neutralLosses)
      Convenience summing the masses of various neutral losses.
      Parameters:
      neutralLosses - list of neutral losses
      Returns:
      the sum of the masses