Class PeptideShaker

java.lang.Object
eu.isas.peptideshaker.PeptideShaker

public class PeptideShaker extends Object
This class will be responsible for the identification import and the associated calculations.
Author:
Marc Vaudel, Harald Barsnes
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    Folder where the data files are stored by default.
    static final String
    Default PeptideShaker modifications.
    static final int
    Default time out in days.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PeptideShaker(com.compomics.util.experiment.ProjectParameters projectParameters)
    Constructor without mass specification.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createProject(com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.parameters.tools.ProcessingParameters processingParameters, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParameters, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, ProjectDetails projectDetails, com.compomics.util.parameters.peptide_shaker.ProjectType projectType, com.compomics.util.waiting.WaitingHandler waitingHandler, boolean setWaitingHandlerFinshedWhenDone, com.compomics.util.exceptions.ExceptionHandler exceptionHandler)
    Creates a PeptideShaker project.
    static File
    Returns the folder where the configuration files are stored.
    com.compomics.util.experiment.biology.genes.GeneMaps
    Returns the gene maps.
    com.compomics.util.experiment.identification.Identification
    Returns the identification object.
    com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator
    Returns the identification features generator used when loading the files.
    static String
    Retrieves the path to the jar file.
    static String
    Returns the matches directory parent.
    static File
    Returns the matches directory parent.
    static String
    Returns the directory used to store the identification matches.
    static File
    Returns the path to the matches folder according to the user path settings.
    com.compomics.util.experiment.identification.peptide_shaker.Metrics
    Returns the metrics picked-up while loading the files.
    com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider
    Returns the protein details provider.
    com.compomics.util.experiment.io.biology.protein.SequenceProvider
    Returns the sequence provider.
    static String
    Returns the file used for user preferences storage.
    static String
    Returns the folder used for user preferences storage.
    static String
    Retrieves the version number set in the pom file.
    int
    importFiles(com.compomics.util.waiting.WaitingHandler waitingHandler, ArrayList<File> idFiles, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, ProjectDetails projectDetails, com.compomics.util.parameters.tools.ProcessingParameters processingParameters, com.compomics.util.exceptions.ExceptionHandler exceptionHandler)
    Imports identification results from result files.
    static void
    instantiateFacories(com.compomics.util.parameters.UtilitiesUserParameters utilitiesUserPreferences)
    Instantiates the spectrum, sequence, and PTM factories with caches adapted to the memory available as set in the user preferences.
    static String
    loadModifications(com.compomics.util.parameters.identification.search.SearchParameters searchParameters)
    Verifies that the modifications backed-up in the search parameters are loaded and returns an error message if one was already loaded, null otherwise.
    void
    peptideMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider)
    Processes the identifications if a change occurred in the peptide map.
    void
    proteinMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider)
    Processes the identifications if a change occurred in the protein map.
    static void
    setConfigFolder(File aConfigFolder)
    Set the config folder.
    void
    setGeneMaps(com.compomics.util.experiment.biology.genes.GeneMaps geneMaps)
    Sets the gene maps.
    static void
    setMatchesDirectoryParent(String matchesDirectoryParent)
    Sets the matches directory parent.
    static void
    setUserPreferencesFolder(String userPreferencesFolder)
    Sets the file used for user preferences storage.
    void
    spectrumMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.tools.ProcessingParameters processingPreferences, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.peptide_shaker.ProjectType projectType)
    Processes the identifications if a change occurred in the PSM map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TIMEOUT_DAYS

      public static final int TIMEOUT_DAYS
      Default time out in days.
      See Also:
    • PEPTIDESHAKER_CONFIGURATION_FILE

      public static final String PEPTIDESHAKER_CONFIGURATION_FILE
      Default PeptideShaker modifications.
      See Also:
    • DATA_DIRECTORY

      public static String DATA_DIRECTORY
      Folder where the data files are stored by default. Should be the same as in SearchGUI.
  • Constructor Details

    • PeptideShaker

      public PeptideShaker(com.compomics.util.experiment.ProjectParameters projectParameters)
      Constructor without mass specification. Calculation will be done on new maps which will be retrieved as compomics utilities parameters.
      Parameters:
      projectParameters - the experiment conducted
  • Method Details

    • importFiles

      public int importFiles(com.compomics.util.waiting.WaitingHandler waitingHandler, ArrayList<File> idFiles, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, ProjectDetails projectDetails, com.compomics.util.parameters.tools.ProcessingParameters processingParameters, com.compomics.util.exceptions.ExceptionHandler exceptionHandler)
      Imports identification results from result files.
      Parameters:
      waitingHandler - the handler displaying feedback to the user
      idFiles - the files to import
      spectrumProvider - the spectrum provider
      identificationParameters - identification parameters
      projectDetails - the project details
      processingParameters - the initial processing preferences
      exceptionHandler - the exception handler
      Returns:
      0 if the import went fine, 1 otherwise
    • createProject

      public void createProject(com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.parameters.tools.ProcessingParameters processingParameters, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParameters, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, ProjectDetails projectDetails, com.compomics.util.parameters.peptide_shaker.ProjectType projectType, com.compomics.util.waiting.WaitingHandler waitingHandler, boolean setWaitingHandlerFinshedWhenDone, com.compomics.util.exceptions.ExceptionHandler exceptionHandler) throws InterruptedException, TimeoutException, IOException
      Creates a PeptideShaker project.
      Parameters:
      identificationParameters - the identification parameters
      processingParameters - the processing parameters
      spectrumCountingParameters - the spectrum counting parameters
      spectrumProvider - the spectrum provider
      projectDetails - the project details
      projectType - the project type
      waitingHandler - the handler displaying feedback to the user
      setWaitingHandlerFinshedWhenDone - if true, the waiting handler is set to finished when the project is created
      exceptionHandler - handler for exceptions
      Throws:
      InterruptedException - exception thrown if a thread gets interrupted
      TimeoutException - exception thrown if a process times out
      IOException - if an exception occurs when parsing files
    • spectrumMapChanged

      public void spectrumMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.tools.ProcessingParameters processingPreferences, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.peptide_shaker.ProjectType projectType)
      Processes the identifications if a change occurred in the PSM map.
      Parameters:
      identification - the identification object containing the identification matches
      waitingHandler - the waiting handler
      processingPreferences - the processing preferences
      identificationParameters - the identification parameters
      sequenceProvider - a protein sequence provider
      spectrumProvider - the spectrum provider
      projectType - the project type
    • peptideMapChanged

      public void peptideMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider)
      Processes the identifications if a change occurred in the peptide map.
      Parameters:
      identification - the identification object containing the identification matches
      waitingHandler - the waiting handler
      identificationParameters - the identification parameters
      sequenceProvider - a protein sequence provider
      spectrumProvider - the spectrum provider
    • proteinMapChanged

      public void proteinMapChanged(com.compomics.util.experiment.identification.Identification identification, com.compomics.util.waiting.WaitingHandler waitingHandler, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider)
      Processes the identifications if a change occurred in the protein map.
      Parameters:
      identification - the identification object containing the identification matches
      waitingHandler - the waiting handler
      identificationParameters - the identification parameters
      sequenceProvider - a protein sequence provider
    • getMetrics

      public com.compomics.util.experiment.identification.peptide_shaker.Metrics getMetrics()
      Returns the metrics picked-up while loading the files.
      Returns:
      the metrics picked-up while loading the files
    • getGeneMaps

      public com.compomics.util.experiment.biology.genes.GeneMaps getGeneMaps()
      Returns the gene maps.
      Returns:
      the gene maps
    • getIdentification

      public com.compomics.util.experiment.identification.Identification getIdentification()
      Returns the identification object.
      Returns:
      the identification object
    • getSequenceProvider

      public com.compomics.util.experiment.io.biology.protein.SequenceProvider getSequenceProvider()
      Returns the sequence provider.
      Returns:
      the sequence provider
    • getProteinDetailsProvider

      public com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider getProteinDetailsProvider()
      Returns the protein details provider.
      Returns:
      the protein details provider
    • setGeneMaps

      public void setGeneMaps(com.compomics.util.experiment.biology.genes.GeneMaps geneMaps)
      Sets the gene maps.
      Parameters:
      geneMaps - the new gene maps
    • getIdentificationFeaturesGenerator

      public com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator getIdentificationFeaturesGenerator()
      Returns the identification features generator used when loading the files.
      Returns:
      the identification features generator used when loading the files
    • loadModifications

      public static String loadModifications(com.compomics.util.parameters.identification.search.SearchParameters searchParameters)
      Verifies that the modifications backed-up in the search parameters are loaded and returns an error message if one was already loaded, null otherwise.
      Parameters:
      searchParameters - the search parameters to load
      Returns:
      an error message if one was already loaded, null otherwise
    • getUserPreferencesFile

      public static String getUserPreferencesFile()
      Returns the file used for user preferences storage.
      Returns:
      the file used for user preferences storage
    • getUserPreferencesFolder

      public static String getUserPreferencesFolder()
      Returns the folder used for user preferences storage.
      Returns:
      the folder used for user preferences storage
    • setUserPreferencesFolder

      public static void setUserPreferencesFolder(String userPreferencesFolder)
      Sets the file used for user preferences storage.
      Parameters:
      userPreferencesFolder - the folder used for user preferences storage
    • getMatchesDirectorySubPath

      public static String getMatchesDirectorySubPath()
      Returns the directory used to store the identification matches.
      Returns:
      the directory used to store the identification matches
    • getMatchesDirectoryParent

      public static String getMatchesDirectoryParent()
      Returns the matches directory parent. An empty string if not set. Can be a relative path.
      Returns:
      the matches directory parent
    • getMatchesDirectoryParentFile

      public static File getMatchesDirectoryParentFile()
      Returns the matches directory parent. An empty string if not set.
      Returns:
      the matches directory parent
    • setMatchesDirectoryParent

      public static void setMatchesDirectoryParent(String matchesDirectoryParent) throws IOException
      Sets the matches directory parent.
      Parameters:
      matchesDirectoryParent - the matches directory parent
      Throws:
      IOException - thrown of an exception occurs
    • getMatchesFolder

      public static File getMatchesFolder()
      Returns the path to the matches folder according to the user path settings.
      Returns:
      the path to the match folder according to the user path settings
    • instantiateFacories

      public static void instantiateFacories(com.compomics.util.parameters.UtilitiesUserParameters utilitiesUserPreferences)
      Instantiates the spectrum, sequence, and PTM factories with caches adapted to the memory available as set in the user preferences.
      Parameters:
      utilitiesUserPreferences - the user preferences
    • getVersion

      public static String getVersion()
      Retrieves the version number set in the pom file.
      Returns:
      the version number of PeptideShaker
    • getJarFilePath

      public static String getJarFilePath()
      Retrieves the path to the jar file.
      Returns:
      the path to the jar file
    • getConfigFolder

      public static File getConfigFolder()
      Returns the folder where the configuration files are stored.
      Returns:
      the folder where the configuration files are stored
    • setConfigFolder

      public static void setConfigFolder(File aConfigFolder)
      Set the config folder.
      Parameters:
      aConfigFolder - the config folder