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:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchParameters.MassAccuracyType
Possible mass accuracy types.Nested classes/interfaces inherited from interface com.compomics.util.experiment.io.parameters.MarshallableParameter
MarshallableParameter.Type
-
Field Summary
Fields Modifier and Type Field Description static String[]
implementedForwardIons
Convenience array for forward ion type selection.static String[]
implementedRewindIons
Convenience array for rewind ion type selection.static int
preferredMaxVariableModifications
The preferred maximal number of variable modifications.static int
preferredMinSequences
The preferred minimal number of protein sequences.String
version
Version number. -
Constructor Summary
Constructors Constructor Description SearchParameters()
Constructor.SearchParameters(SearchParameters searchParameters)
Constructor. -
Method Summary
Modifier and Type Method Description boolean
equals(SearchParameters otherSearchParameters)
Returns true if the search parameter objects have identical settings.Set<Integer>
getAlgorithms()
Returns the algorithms for which specific parameters are stored.HashMap<Integer,IdentificationAlgorithmParameter>
getAlgorithmSpecificParameters()
Returns the algorithm specific parameters in a map: algorithm as indexed in the Advocate class > parameters.DigestionParameters
getDigestionParameters()
Returns the digestion preferences.boolean
getFlanking()
Return whether the flanking amino acids of a mapped peptide are to be reported.ArrayList<Integer>
getForwardIons()
Returns the forward ions searched as list of integers as indexed in the FragmentIon class.SearchParameters.MassAccuracyType
getFragmentAccuracyType()
Returns the fragment accuracy type.double
getFragmentIonAccuracy()
Returns the MS2 ion m/z tolerance.double
getFragmentIonAccuracyInDaltons()
Returns the absolute fragment ion tolerance in Dalton.double
getFragmentIonAccuracyInDaltons(double refMass)
Returns the absolute fragment ion tolerance in Dalton.IdentificationAlgorithmParameter
getIdentificationAlgorithmParameter(int algorithmID)
Returns the algorithm specific parameters, null if not found.static SearchParameters
getIdentificationParameters(File searchParametersFile)
Loads the identification parameters from a file.static String[]
getIons()
Getter for the list of ion symbols used.int
getMaxChargeSearched()
Returns the maximal charge searched.int
getMaxIsotopicCorrection()
Returns the maximal isotopic correction.int
getMinChargeSearched()
Returns the minimal charge searched.int
getMinIsotopicCorrection()
Returns the minimal isotopic correction.ModificationParameters
getModificationParameters()
Returns the modification settings.double
getPrecursorAccuracy()
Returns the precursor tolerance.SearchParameters.MassAccuracyType
getPrecursorAccuracyType()
Returns the precursor accuracy type.double
getRefMass()
Returns the reference mass used to convert ppm to Da.ArrayList<Integer>
getRewindIons()
Returns the rewind ions searched as list of integers as indexed in the FragmentIon class.String
getShortDescription()
Returns a short description of the parameters.MarshallableParameter.Type
getType()
Returns the type of marshalled parameter from an unmarshalled object.Boolean
isPrecursorAccuracyTypePpm()
Returns true if the current precursor accuracy type is ppm.static void
saveIdentificationParameters(SearchParameters searchParameters, File searchParametersFile)
Saves the identification parameters to a serialized file.void
saveIdentificationParametersAsTextFile(File file)
Saves the identification parameters as a human readable text file.void
setDefaultAdvancedSettings()
Set the advanced settings to the default values.void
setDefaultAdvancedSettings(SearchParameters searchParameters)
Set the advanced settings to the values in the given search parameters object or to the default values of the advanced settings are not set for a given advocate.void
setDigestionParameters(DigestionParameters digestionParameters)
Sets the digestion preferences.void
setFlanking(boolean flanking)
Set whether the flanking amino acids of a mapped peptide are to be reported.void
setForwardIons(ArrayList<Integer> forwardIons)
Sets the forward ions searched as list of integers as indexed in the FragmentIon class.void
setFragmentAccuracyType(SearchParameters.MassAccuracyType fragmentAccuracyType)
Sets the fragment accuracy type.void
setFragmentIonAccuracy(double fragmentIonMZTolerance)
Sets the fragment ion m/z tolerance.void
setIdentificationAlgorithmParameter(int algorithmID, IdentificationAlgorithmParameter identificationAlgorithmParameter)
Adds identification algorithm specific parameters.void
setMaxChargeSearched(int maxChargeSearched)
Sets the maximal charge searched.void
setMaxIsotopicCorrection(int maxIsotopicCorrection)
Sets the maximal isotopic correction.void
setMinChargeSearched(int minChargeSearched)
Sets the minimal charge searched.void
setMinIsotopicCorrection(int minIsotopicCorrection)
Sets the minimal isotopic correction.void
setModificationParameters(ModificationParameters modificationParameters)
Sets the modification settings.void
setPrecursorAccuracy(double precursorTolerance)
Sets the precursor tolerance.void
setPrecursorAccuracyType(SearchParameters.MassAccuracyType precursorAccuracyType)
Sets the precursor accuracy type.void
setRefMass(double refMass)
Sets the reference mass used to convert ppm to Da.void
setRewindIons(ArrayList<Integer> rewindIons)
Sets the rewind ions searched as list of integers as indexed in the FragmentIon class.void
setType()
Sets the parameters type.String
toString()
String
toString(boolean html)
Returns the search parameters as a string.Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
Field Details
-
version
Version number.- See Also:
- Constant Field Values
-
implementedForwardIons
Convenience array for forward ion type selection. -
implementedRewindIons
Convenience array for rewind ion type selection. -
preferredMaxVariableModifications
public static final int preferredMaxVariableModificationsThe preferred maximal number of variable modifications.- See Also:
- Constant Field Values
-
preferredMinSequences
public static final int preferredMinSequencesThe preferred minimal number of protein sequences.- See Also:
- Constant Field Values
-
-
Constructor Details
-
SearchParameters
public SearchParameters()Constructor. -
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
Set the advanced settings to the values in the given search parameters object or to the default values of 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
Returns the modification settings.- Returns:
- the modification settings
-
setModificationParameters
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
Returns the digestion preferences.- Returns:
- the digestion preferences
-
setDigestionParameters
Sets the digestion preferences.- Parameters:
digestionParameters
- the digestion preferences
-
getForwardIons
Returns the forward ions searched as list of integers as indexed in the FragmentIon class.- Returns:
- the forward ions searched
-
setForwardIons
Sets the forward ions searched as list of integers as indexed in the FragmentIon class.- Parameters:
forwardIons
- the forward ions searched
-
getRewindIons
Returns the rewind ions searched as list of integers as indexed in the FragmentIon class.- Returns:
- the rewind ions searched
-
setRewindIons
Sets the rewind ions searched as list of integers as indexed in the FragmentIon class.- Parameters:
rewindIons
- the rewind ions searched
-
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
Returns the precursor accuracy type.- Returns:
- the precursor accuracy type
-
setPrecursorAccuracyType
Sets the precursor accuracy type.- Parameters:
precursorAccuracyType
- the precursor accuracy type
-
getFragmentAccuracyType
Returns the fragment accuracy type.- Returns:
- the fragment accuracy type
-
setFragmentAccuracyType
Sets the fragment accuracy type.- Parameters:
fragmentAccuracyType
- the fragment accuracy type
-
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
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
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 classidentificationAlgorithmParameter
- the specific parameters
-
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, ClassNotFoundExceptionLoads 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 occursClassNotFoundException
- if a ClassNotFoundException occurs
-
saveIdentificationParameters
public static void saveIdentificationParameters(SearchParameters searchParameters, File searchParametersFile) throws IOExceptionSaves the identification parameters to a serialized file.- Parameters:
searchParameters
- the identification parameterssearchParametersFile
- the file- Throws:
IOException
- if an IOException occurs
-
saveIdentificationParametersAsTextFile
Saves the identification parameters as a human readable text file.- Parameters:
file
- the file- Throws:
IOException
- if an IOException occurs
-
toString
-
getShortDescription
Returns a short description of the parameters.- Returns:
- a short description of the parameters
-
toString
Returns the search parameters as a string.- Parameters:
html
- use HTML formatting- Returns:
- the search parameters as a string
-
equals
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 interfaceMarshallableParameter
-
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 interfaceMarshallableParameter
- Returns:
- the type of marshalled parameter from an unmarshalled object
-