Class SearchParameters

java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.parameters.identification.search.SearchParameters
All Implemented Interfaces:
MarshallableParameter, Serializable

public class SearchParameters extends ExperimentObject implements MarshallableParameter
This class groups the parameters used for identification.
Author:
Marc Vaudel, Harald Barsnes
See Also:
  • Field Details

    • version

      public final String version
      Version number.
      See Also:
    • implementedForwardIons

      public static final String[] implementedForwardIons
      Convenience array for forward ion type selection.
    • implementedRewindIons

      public static final String[] implementedRewindIons
      Convenience array for rewind ion type selection.
    • preferredMaxVariableModifications

      public static final int preferredMaxVariableModifications
      The preferred maximal number of variable modifications.
      See Also:
    • preferredMinSequences

      public static final int preferredMinSequences
      The preferred minimal number of protein sequences.
      See Also:
  • Constructor Details

    • SearchParameters

      public SearchParameters()
      Constructor.
    • SearchParameters

      public SearchParameters(SearchParameters searchParameters)
      Constructor.
      Parameters:
      searchParameters - the search parameter to base the search parameters on.
  • Method Details

    • setDefaultAdvancedSettings

      public void setDefaultAdvancedSettings()
      Set the advanced settings to the default values.
    • setDefaultAdvancedSettings

      public void setDefaultAdvancedSettings(SearchParameters searchParameters)
      Set the advanced settings to the values in the given search parameters object or to the default values if the advanced settings are not set for a given advocate.
      Parameters:
      searchParameters - the search parameter to extract the advanced settings from
    • getRefMass

      public double getRefMass()
      Returns the reference mass used to convert ppm to Da.
      Returns:
      the reference mass used to convert ppm to Da
    • setRefMass

      public void setRefMass(double refMass)
      Sets the reference mass used to convert ppm to Da.
      Parameters:
      refMass - the reference mass used to convert ppm to Da
    • getModificationParameters

      public ModificationParameters getModificationParameters()
      Returns the modification settings.
      Returns:
      the modification settings
    • setModificationParameters

      public void setModificationParameters(ModificationParameters modificationParameters)
      Sets the modification settings.
      Parameters:
      modificationParameters - the modification settings
    • getFragmentIonAccuracy

      public double getFragmentIonAccuracy()
      Returns the MS2 ion m/z tolerance.
      Returns:
      the MS2 ion m/z tolerance
    • getFragmentIonAccuracyInDaltons

      public double getFragmentIonAccuracyInDaltons()
      Returns the absolute fragment ion tolerance in Dalton. If the tolerance is in ppm, the internal reference mass is used.
      Returns:
      the absolute fragment ion tolerance in Dalton
    • getFragmentIonAccuracyInDaltons

      public double getFragmentIonAccuracyInDaltons(double refMass)
      Returns the absolute fragment ion tolerance in Dalton. If the tolerance is in ppm, the given reference mass is used.
      Parameters:
      refMass - the reference mass to use for the conversion of tolerances in ppm.
      Returns:
      the absolute fragment ion tolerance in Dalton
    • setFragmentIonAccuracy

      public void setFragmentIonAccuracy(double fragmentIonMZTolerance)
      Sets the fragment ion m/z tolerance.
      Parameters:
      fragmentIonMZTolerance - the fragment ion m/z tolerance
    • getDigestionParameters

      public DigestionParameters getDigestionParameters()
      Returns the digestion preferences.
      Returns:
      the digestion preferences
    • setDigestionParameters

      public void setDigestionParameters(DigestionParameters digestionParameters)
      Sets the digestion preferences.
      Parameters:
      digestionParameters - the digestion preferences
    • getForwardIons

      public ArrayList<Integer> getForwardIons()
      Returns the forward ions searched as list of integers as indexed in the PeptideFragmentIon class.
      Returns:
      the forward ions searched
    • setForwardIons

      public void setForwardIons(ArrayList<Integer> forwardIons)
      Sets the forward ions searched as list of integers as indexed in the PeptideFragmentIon class.
      Parameters:
      forwardIons - the forward ions searched
    • getRewindIons

      public ArrayList<Integer> getRewindIons()
      Returns the rewind ions searched as list of integers as indexed in the PeptideFragmentIon class.
      Returns:
      the rewind ions searched
    • setRewindIons

      public void setRewindIons(ArrayList<Integer> rewindIons)
      Sets the rewind ions searched as list of integers as indexed in the PeptideFragmentIon class.
      Parameters:
      rewindIons - the rewind ions searched
    • getIons

      public static String[] getIons()
      Getter for the list of ion symbols used.
      Returns:
      the list of ion symbols used
    • getPrecursorAccuracy

      public double getPrecursorAccuracy()
      Returns the precursor tolerance.
      Returns:
      the precursor tolerance
    • setPrecursorAccuracy

      public void setPrecursorAccuracy(double precursorTolerance)
      Sets the precursor tolerance.
      Parameters:
      precursorTolerance - the precursor tolerance
    • getPrecursorAccuracyType

      public SearchParameters.MassAccuracyType getPrecursorAccuracyType()
      Returns the precursor accuracy type.
      Returns:
      the precursor accuracy type
    • setPrecursorAccuracyType

      public void setPrecursorAccuracyType(SearchParameters.MassAccuracyType precursorAccuracyType)
      Sets the precursor accuracy type.
      Parameters:
      precursorAccuracyType - the precursor accuracy type
    • getFragmentAccuracyType

      public SearchParameters.MassAccuracyType getFragmentAccuracyType()
      Returns the fragment accuracy type.
      Returns:
      the fragment accuracy type
    • setFragmentAccuracyType

      public void setFragmentAccuracyType(SearchParameters.MassAccuracyType fragmentAccuracyType)
      Sets the fragment accuracy type.
      Parameters:
      fragmentAccuracyType - the fragment accuracy type
    • isPrecursorAccuracyTypePpm

      public Boolean isPrecursorAccuracyTypePpm()
      Returns true if the current precursor accuracy type is ppm.
      Returns:
      true if the current precursor accuracy type is ppm
    • getMaxChargeSearched

      public int getMaxChargeSearched()
      Returns the maximal charge searched.
      Returns:
      the maximal charge searched
    • setMaxChargeSearched

      public void setMaxChargeSearched(int maxChargeSearched)
      Sets the maximal charge searched.
      Parameters:
      maxChargeSearched - the maximal charge searched
    • getMinChargeSearched

      public int getMinChargeSearched()
      Returns the minimal charge searched.
      Returns:
      the minimal charge searched
    • setMinChargeSearched

      public void setMinChargeSearched(int minChargeSearched)
      Sets the minimal charge searched.
      Parameters:
      minChargeSearched - the minimal charge searched
    • getAlgorithmSpecificParameters

      public HashMap<Integer,IdentificationAlgorithmParameter> getAlgorithmSpecificParameters()
      Returns the algorithm specific parameters in a map: algorithm as indexed in the Advocate class > parameters. null if not set.
      Returns:
      the algorithm specific parameters in a map
    • getIdentificationAlgorithmParameter

      public IdentificationAlgorithmParameter getIdentificationAlgorithmParameter(int algorithmID)
      Returns the algorithm specific parameters, null if not found.
      Parameters:
      algorithmID - the index of the search engine as indexed in the Advocate class
      Returns:
      the algorithm specific parameters
    • setIdentificationAlgorithmParameter

      public void setIdentificationAlgorithmParameter(int algorithmID, IdentificationAlgorithmParameter identificationAlgorithmParameter)
      Adds identification algorithm specific parameters.
      Parameters:
      algorithmID - the algorithm id as indexed in the Advocate class
      identificationAlgorithmParameter - the specific parameters
    • getAlgorithms

      public Set<Integer> getAlgorithms()
      Returns the algorithms for which specific parameters are stored. Warning: this does not mean that the algorithm was actually used.
      Returns:
      the algorithms for which specific parameters are stored in a set of indexes as listed in the Advocate class
    • getMinIsotopicCorrection

      public int getMinIsotopicCorrection()
      Returns the minimal isotopic correction.
      Returns:
      the minimal isotopic correction
    • setMinIsotopicCorrection

      public void setMinIsotopicCorrection(int minIsotopicCorrection)
      Sets the minimal isotopic correction.
      Parameters:
      minIsotopicCorrection - the minimal isotopic correction
    • getMaxIsotopicCorrection

      public int getMaxIsotopicCorrection()
      Returns the maximal isotopic correction.
      Returns:
      the maximal isotopic correction
    • setMaxIsotopicCorrection

      public void setMaxIsotopicCorrection(int maxIsotopicCorrection)
      Sets the maximal isotopic correction.
      Parameters:
      maxIsotopicCorrection - the maximal isotopic correction
    • getIdentificationParameters

      public static SearchParameters getIdentificationParameters(File searchParametersFile) throws IOException, ClassNotFoundException
      Loads the identification parameters from a file. If the file is an identification parameters file, the search parameters are extracted.
      Parameters:
      searchParametersFile - the search parameter file
      Returns:
      the search parameters
      Throws:
      IOException - if an IOException occurs
      ClassNotFoundException - if a ClassNotFoundException occurs
    • saveIdentificationParameters

      public static void saveIdentificationParameters(SearchParameters searchParameters, File searchParametersFile) throws IOException
      Saves the identification parameters to a serialized file.
      Parameters:
      searchParameters - the identification parameters
      searchParametersFile - the file
      Throws:
      IOException - if an IOException occurs
    • saveIdentificationParametersAsTextFile

      public void saveIdentificationParametersAsTextFile(File file) throws IOException
      Saves the identification parameters as a human readable text file.
      Parameters:
      file - the file
      Throws:
      IOException - if an IOException occurs
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShortDescription

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

      public String toString(boolean html)
      Returns the search parameters as a string.
      Parameters:
      html - use HTML formatting
      Returns:
      the search parameters as a string
    • equals

      public boolean equals(SearchParameters otherSearchParameters)
      Returns true if the search parameter objects have identical settings.
      Parameters:
      otherSearchParameters - the parameters to compare to
      Returns:
      true if the search parameter objects have identical settings
    • setFlanking

      public void setFlanking(boolean flanking)
      Set whether the flanking amino acids of a mapped peptide are to be reported.
      Parameters:
      flanking - whether the flanking amino acids of a mapped peptide are to be reported
    • getFlanking

      public boolean getFlanking()
      Return whether the flanking amino acids of a mapped peptide are to be reported.
      Returns:
      true if whether the flanking amino acids of a mapped peptide are to be reported
    • setType

      public void setType()
      Description copied from interface: MarshallableParameter
      Sets the parameters type. The type must be set before writing a file but not in the constructor.
      Specified by:
      setType in interface MarshallableParameter
    • getType

      public MarshallableParameter.Type getType()
      Description copied from interface: MarshallableParameter
      Returns the type of marshalled parameter from an unmarshalled object. The type must be written in the file but not set in the constructor. Null if not a MarshallableParameter.
      Specified by:
      getType in interface MarshallableParameter
      Returns:
      the type of marshalled parameter from an unmarshalled object