Class PeptideAssumptionFilter

java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.filtering.PeptideAssumptionFilter
All Implemented Interfaces:
Serializable

public class PeptideAssumptionFilter
extends ExperimentObject
This class filters peptide assumptions based on various properties.
Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form
  • Constructor Details

    • PeptideAssumptionFilter

      public PeptideAssumptionFilter()
      Constructor with default settings.
    • PeptideAssumptionFilter

      public PeptideAssumptionFilter​(int minPepLength, int maxPepLength, double maxMzDeviation, boolean isPpm, boolean unknownModification, Integer minMissedCleavages, Integer maxMissedCleavages, Integer minIsotopes, Integer maxIsotopes)
      Constructor for an Identification filter.
      Parameters:
      minPepLength - the minimal peptide length allowed (0 or less for disabled)
      maxPepLength - the maximal peptide length allowed (0 or less for disabled)
      maxMzDeviation - the maximal m/z deviation allowed (0 or less for disabled)
      isPpm - boolean indicating the unit of the allowed m/z deviation (true: ppm, false: Da)
      unknownModification - shall peptides presenting unknown modifications be removed
      minMissedCleavages - the minimum number of missed cleavages allowed (null for disabled)
      maxMissedCleavages - the maximum number of missed cleavages allowed (null for disabled)
      minIsotopes - the minimum number of isotopes allowed (null for disabled)
      maxIsotopes - the maximum number of isotopes allowed (null for disabled)
  • Method Details

    • setFilterFromSearchParameters

      public void setFilterFromSearchParameters​(SearchParameters searchParameters)
      Updates the filter based on the search parameters.
      Parameters:
      searchParameters - the search parameters where to take the information from
    • validatePeptide

      public boolean validatePeptide​(Peptide peptide, SequenceMatchingParameters sequenceMatchingPreferences, DigestionParameters digestionPreferences)
      Validates the peptide based on the peptide length, the share of X's in the sequence and the allowed number of missed cleavages.
      Parameters:
      peptide - the peptide to validate
      sequenceMatchingPreferences - the sequence matching preferences containing the maximal share of X's allowed
      digestionPreferences - the digestion preferences
      Returns:
      a boolean indicating whether the peptide passed the test
    • validateProteins

      public boolean validateProteins​(Peptide peptide, SequenceMatchingParameters sequenceMatchingPreferences, SequenceProvider sequenceProvider)
      Validates a peptide depending on its protein inference status.
      Parameters:
      peptide - the peptide
      sequenceMatchingPreferences - the sequence matching preferences
      sequenceProvider - a sequence provider
      Returns:
      a boolean indicating whether the peptide passed the test
    • validateModifications

      public boolean validateModifications​(Peptide peptide, SequenceMatchingParameters sequenceMatchingPreferences, SequenceMatchingParameters modificationSequenceMatchingPreferences, ModificationParameters modificationProfile)
      Verifies that the definition of every modification name is available.
      Parameters:
      peptide - the peptide of interest
      sequenceMatchingPreferences - the sequence matching preferences for peptide to protein mapping
      modificationSequenceMatchingPreferences - the sequence matching preferences for modification to peptide mapping
      modificationProfile - the modification profile of the identification
      Returns:
      a boolean indicating whether the peptide passed the test
    • validatePrecursor

      public boolean validatePrecursor​(PeptideAssumption assumption, String spectrumFile, String spectrumTitle, SpectrumProvider spectrumProvider, SearchParameters searchParameters)
      Validates the mass deviation of a peptide assumption.
      Parameters:
      assumption - the considered peptide assumption
      spectrumFile - the file of the spectrum used to get the precursor
      spectrumTitle - the file of the spectrum used to get the precursor
      spectrumProvider - the spectrum provider
      searchParameters - the search parameters
      Returns:
      a boolean indicating whether the given assumption passes the filter
    • removeUnknownModifications

      public boolean removeUnknownModifications()
      Returns a boolean indicating whether unknown modifications shall be removed.
      Returns:
      a boolean indicating whether unknown modifications shall be removed
    • setRemoveUnknownModifications

      public void setRemoveUnknownModifications​(boolean unknownModification)
      Set whether unknown modifications shall be removed.
      Parameters:
      unknownModification - whether unknown modifications shall be removed
    • isIsPpm

      public boolean isIsPpm()
      Indicates whether the mass tolerance is in ppm (true) or Dalton (false).
      Returns:
      a boolean indicating whether the mass tolerance is in ppm (true) or Dalton (false)
    • setIsPpm

      public void setIsPpm​(boolean isPpm)
      Sets whether the mass tolerance is in ppm (true) or Dalton (false).
      Parameters:
      isPpm - a boolean indicating whether the mass tolerance is in ppm (true) or Dalton (false)
    • getMaxMzDeviation

      public double getMaxMzDeviation()
      Returns the maximal m/z deviation allowed.
      Returns:
      the maximal mass deviation allowed
    • setMaxMzDeviation

      public void setMaxMzDeviation​(double maxMzDeviation)
      Sets the maximal m/z deviation allowed.
      Parameters:
      maxMzDeviation - the maximal mass deviation allowed
    • getMaxPepLength

      public int getMaxPepLength()
      Returns the maximal peptide length allowed.
      Returns:
      the maximal peptide length allowed
    • setMaxPepLength

      public void setMaxPepLength​(int maxPepLength)
      Sets the maximal peptide length allowed.
      Parameters:
      maxPepLength - the maximal peptide length allowed
    • getMinPepLength

      public int getMinPepLength()
      Returns the maximal peptide length allowed.
      Returns:
      the maximal peptide length allowed
    • setMinPepLength

      public void setMinPepLength​(int minPepLength)
      Sets the maximal peptide length allowed.
      Parameters:
      minPepLength - the maximal peptide length allowed
    • getMinIsotopes

      public Integer getMinIsotopes()
      Returns the minimal number of isotopes allowed (inclusive).
      Returns:
      the minimal number of isotopes allowed
    • setMinIsotopes

      public void setMinIsotopes​(Integer minIsotopes)
      Sets the minimal number of isotopes allowed (inclusive).
      Parameters:
      minIsotopes - the minimal number of isotopes allowed
    • getMaxIsotopes

      public Integer getMaxIsotopes()
      Returns the maximal number of isotopes allowed (inclusive).
      Returns:
      the maximal number of isotopes allowed
    • setMaxIsotopes

      public void setMaxIsotopes​(Integer maxIsotopes)
      Sets the maximal number of isotopes allowed (inclusive).
      Parameters:
      maxIsotopes - the maximal number of isotopes allowed
    • isSameAs

      public boolean isSameAs​(PeptideAssumptionFilter anotherFilter)
      Indicates whether this filter is the same as another one.
      Parameters:
      anotherFilter - another filter
      Returns:
      a boolean indicating that the filters have the same parameters
    • getShortDescription

      public String getShortDescription()
      Returns a short description of the parameters.
      Returns:
      a short description of the parameters
    • getMinMissedCleavages

      public Integer getMinMissedCleavages()
      Returns the minimum number of missed cleavages. Null means no limit.
      Returns:
      the minMissedCleavages
    • setMinMissedCleavages

      public void setMinMissedCleavages​(Integer minMissedCleavages)
      Set the minimum number of missed cleavages. Null means no limit.
      Parameters:
      minMissedCleavages - the minMissedCleavages to set
    • getMaxMissedCleavages

      public Integer getMaxMissedCleavages()
      Returns the maximum number of missed cleavages. Null means no limit.
      Returns:
      the maxMissedCleavages
    • setMaxMissedCleavages

      public void setMaxMissedCleavages​(Integer maxMissedCleavages)
      Set the maximum number of missed cleavages. Null means no limit.
      Parameters:
      maxMissedCleavages - the maxMissedCleavages to set