Class PsdbParent

All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
FollowUpCLI, MzidCLI, PeptideShakerCLI, ReportCLI

public class PsdbParent extends UserPreferencesParent implements AutoCloseable
Implementing this abstract class allows interacting with a psdb files.
Author:
Marc Vaudel, Harald Barsnes
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected File
    The folder where the database is stored.
    The display parameters.
    protected com.compomics.util.gui.filtering.FilterParameters
    The filter parameters.
    protected com.compomics.util.experiment.biology.genes.GeneMaps
    The gene maps.
    protected com.compomics.util.experiment.identification.Identification
    The identification.
    protected com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator
    The identification features generator.
    protected com.compomics.util.parameters.identification.IdentificationParameters
    The identification parameters.
    protected com.compomics.util.experiment.identification.peptide_shaker.Metrics
    The metrics stored during processing.
    protected com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler
    The mass spectrometry file handler.
    protected ProjectDetails
    The project details.
    com.compomics.util.experiment.ProjectParameters
    All parameters of a project.
    protected com.compomics.util.parameters.peptide_shaker.ProjectType
    The project type.
    protected com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider
    The protein details provider.
    protected File
    The currently loaded psdb file.
    protected com.compomics.util.experiment.io.biology.protein.SequenceProvider
    The sequence provider.
    protected com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters
    The spectrum counting preferences.

    Fields inherited from class eu.isas.peptideshaker.preferences.UserPreferencesParent

    userPreferences
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor for instantiation purposes.
    PsdbParent​(File dbFolder)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Returns the folder where the database is stored.
    Returns the display preferences.
    getExtendedProjectReport​(String waitingHandlerReport)
    Returns an extended HTML project report.
    com.compomics.util.gui.filtering.FilterParameters
    Returns the filter preferences.
    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 object.
    com.compomics.util.parameters.identification.IdentificationParameters
    Returns the identification parameters.
    com.compomics.util.experiment.identification.peptide_shaker.Metrics
    Returns the metrics object.
    Returns the project details.
    com.compomics.util.experiment.ProjectParameters
    Returns the project parameters.
    com.compomics.util.parameters.peptide_shaker.ProjectType
    Returns the project type.
    com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider
    Returns the protein details provider.
    Returns the psdb file.
    boolean
    Returns the psdb import from zip.
    com.compomics.util.experiment.io.biology.protein.SequenceProvider
    Returns the sequence provider.
    com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters
    Returns the spectrum counting preferences.
    com.compomics.util.experiment.mass_spectrometry.SpectrumProvider
    Returns the spectrum provider.
    Returns the user preferences.
    com.compomics.util.experiment.io.biology.protein.FastaSummary
    loadFastaFile​(com.compomics.util.waiting.WaitingHandler waitingHandler)
    Loads the FASTA file.
    void
    loadPsdbFile​(File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler, boolean openFromZip)
    Loads the information from a psdb file.
    void
    loadPsdbFromZipFile​(File zipFile, File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler)
    Loads the information from a psdb file.
    void
    loadSpectrumFile​(File spectrumFile, com.compomics.util.waiting.WaitingHandler waitingHandler)
    Adds a spectrum file to the spectrum provider.
    boolean
    loadSpectrumFile​(String spectrumFileName, ArrayList<File> spectrumFiles, com.compomics.util.waiting.WaitingHandler waitingHandler)
    Loads the spectrum file.
    boolean
    loadSpectrumFiles​(com.compomics.util.waiting.WaitingHandler waitingHandler)
    Loads the spectra in the spectrum factory.
    boolean
    loadSpectrumFiles​(File folder, com.compomics.util.waiting.WaitingHandler waitingHandler)
    Loads the spectrum files.
    void
    Resets the feature generator.
    void
    saveProject​(com.compomics.util.waiting.WaitingHandler waitingHandler, boolean emptyCache)
    Saves the project in the psdb file.
    void
    setDbFolder​(File dbFolder)
    Sets the folder where the database is stored.
    void
    Sets the default preferences.
    void
    setDisplayParameters​(DisplayParameters displayPreferences)
    Sets the display preferences.
    void
    setFilterParameters​(com.compomics.util.gui.filtering.FilterParameters filterPreferences)
    Sets the filter preferences.
    void
    setGeneMaps​(com.compomics.util.experiment.biology.genes.GeneMaps geneMaps)
    Sets the gene maps.
    void
    setIdentification​(com.compomics.util.experiment.identification.Identification identification)
    Sets the identification object.
    void
    setIdentificationFeaturesGenerator​(com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator)
    Sets the identification feature generator.
    void
    setIdentificationParameters​(com.compomics.util.parameters.identification.IdentificationParameters identificationParameters)
    Sets new identification parameters.
    void
    setMetrics​(com.compomics.util.experiment.identification.peptide_shaker.Metrics metrics)
    Sets the metrics.
    void
    setMsFileHandler​(com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler msFileHandler)
    Sets the mass spectrometry file handler.
    void
    setProject​(com.compomics.util.experiment.ProjectParameters projectParameters)
    Sets the project parameters.
    void
    setProjectDetails​(ProjectDetails projectDetails)
    Sets the project details.
    void
    setProjectType​(com.compomics.util.parameters.peptide_shaker.ProjectType projectType)
    Sets the project type.
    void
    setProteinDetailsProvider​(com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider)
    Sets the protein details provider.
    void
    setPsdbFile​(File psdbFile)
    Sets the psdb file.
    void
    setPsdbImportFromZip​(boolean importFromZip)
    Sets that the psdb file is imported from a zip file.
    void
    setSequenceProvider​(com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider)
    Sets the sequence provider.
    void
    setSpectrumCountingParameters​(com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingPreferences)
    Sets the spectrum counting preferences.

    Methods inherited from class eu.isas.peptideshaker.preferences.UserPreferencesParent

    loadUserParameters, saveUserParameters

    Methods inherited from class java.lang.Object

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

    • identification

      protected com.compomics.util.experiment.identification.Identification identification
      The identification.
    • identificationFeaturesGenerator

      protected com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator
      The identification features generator.
    • identificationParameters

      protected com.compomics.util.parameters.identification.IdentificationParameters identificationParameters
      The identification parameters.
    • spectrumCountingParameters

      protected com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParameters
      The spectrum counting preferences.
    • projectDetails

      protected ProjectDetails projectDetails
      The project details.
    • metrics

      protected com.compomics.util.experiment.identification.peptide_shaker.Metrics metrics
      The metrics stored during processing.
    • sequenceProvider

      protected com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider
      The sequence provider.
    • proteinDetailsProvider

      protected com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider
      The protein details provider.
    • msFileHandler

      protected com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler msFileHandler
      The mass spectrometry file handler.
    • geneMaps

      protected com.compomics.util.experiment.biology.genes.GeneMaps geneMaps
      The gene maps.
    • filterParameters

      protected com.compomics.util.gui.filtering.FilterParameters filterParameters
      The filter parameters.
    • displayParameters

      protected DisplayParameters displayParameters
      The display parameters.
    • dbFolder

      protected File dbFolder
      The folder where the database is stored.
    • psdbFile

      protected File psdbFile
      The currently loaded psdb file.
    • projectParameters

      public com.compomics.util.experiment.ProjectParameters projectParameters
      All parameters of a project.
    • projectType

      protected com.compomics.util.parameters.peptide_shaker.ProjectType projectType
      The project type.
  • Constructor Details

    • PsdbParent

      public PsdbParent()
      Empty constructor for instantiation purposes.
    • PsdbParent

      public PsdbParent(File dbFolder)
      Constructor.
      Parameters:
      dbFolder - the folder where the database is stored.
  • Method Details

    • loadPsdbFromZipFile

      public void loadPsdbFromZipFile(File zipFile, File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Loads the information from a psdb file.
      Parameters:
      zipFile - the zip file containing the psdb file
      dbFolder - the folder where to extract the project
      waitingHandler - a waiting handler displaying feedback to the user. Ignored if null
      Throws:
      IOException - thrown if an error occurred while reading the file
    • loadPsdbFile

      public void loadPsdbFile(File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler, boolean openFromZip) throws IOException
      Loads the information from a psdb file.
      Parameters:
      dbFolder - the folder where to untar the project
      waitingHandler - a waiting handler displaying feedback to the user. Ignored if null
      openFromZip - flag determining if pdsb file was opened from a zip file
      Throws:
      IOException - thrown of IOException occurs exception thrown whenever an error occurred while reading or writing a file
    • saveProject

      public void saveProject(com.compomics.util.waiting.WaitingHandler waitingHandler, boolean emptyCache) throws IOException
      Saves the project in the psdb file.
      Parameters:
      waitingHandler - waiting handler displaying feedback to the user. can be null.
      emptyCache - if true the cache will be emptied
      Throws:
      IOException - thrown of IOException occurs exception thrown whenever an error occurred while writing the file
    • loadSpectrumFiles

      public boolean loadSpectrumFiles(com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Loads the spectra in the spectrum factory.
      Parameters:
      waitingHandler - a waiting handler displaying progress to the user. Can be null.
      Returns:
      a boolean indicating whether the loading was successful
      Throws:
      IOException - thrown of IOException occurs exception thrown whenever an error occurred loading the spectrum files
    • loadSpectrumFiles

      public boolean loadSpectrumFiles(File folder, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Loads the spectrum files.
      Parameters:
      folder - The folder to look into. Can be null.
      waitingHandler - The waiting handler displaying progress to the user. Can be null.
      Returns:
      a boolean indicating whether the loading was successful
      Throws:
      IOException - Exception thrown whenever an error occurred while reading or writing a file.
    • loadSpectrumFile

      public boolean loadSpectrumFile(String spectrumFileName, ArrayList<File> spectrumFiles, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Loads the spectrum file.
      Parameters:
      spectrumFileName - The name of the spectrum file.
      spectrumFiles - The list to add the detected spectrum files to.
      waitingHandler - The waiting handler displaying progress to the user. Can be null.
      Returns:
      A boolean indicating whether the loading was successful.
      Throws:
      IOException - Exception thrown whenever an error occurred while reading or writing a file
    • loadSpectrumFile

      public void loadSpectrumFile(File spectrumFile, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Adds a spectrum file to the spectrum provider.
      Parameters:
      spectrumFile - The spectrum file to add.
      waitingHandler - The waiting handler.
      Throws:
      IOException - Exception thrown whenever an error occurred while reading or writing a file
    • loadFastaFile

      public com.compomics.util.experiment.io.biology.protein.FastaSummary loadFastaFile(com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException
      Loads the FASTA file.
      Parameters:
      waitingHandler - a waiting handler displaying progress to the user. Can be null
      Returns:
      the FASTA summary
      Throws:
      IOException - exception thrown if an error occurred while reading or writing the file
    • getIdentification

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

      public com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator getIdentificationFeaturesGenerator()
      Returns the identification features generator object.
      Returns:
      the identification features generator object
    • getSpectrumCountingParameters

      public com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters getSpectrumCountingParameters()
      Returns the spectrum counting preferences.
      Returns:
      the spectrum counting preferences
    • getProjectDetails

      public ProjectDetails getProjectDetails()
      Returns the project details.
      Returns:
      the project details
    • getMetrics

      public com.compomics.util.experiment.identification.peptide_shaker.Metrics getMetrics()
      Returns the metrics object.
      Returns:
      the metrics object
    • getGeneMaps

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

      public com.compomics.util.gui.filtering.FilterParameters getFilterParameters()
      Returns the filter preferences.
      Returns:
      the filter preferences
    • getDisplayParameters

      public DisplayParameters getDisplayParameters()
      Returns the display preferences.
      Returns:
      the display preferences
    • getPsdbFile

      public File getPsdbFile()
      Returns the psdb file.
      Returns:
      the psdb file
    • getPsdbImportFromZip

      public boolean getPsdbImportFromZip()
      Returns the psdb import from zip.
      Returns:
      the psdb import from zip
    • setIdentificationFeaturesGenerator

      public void setIdentificationFeaturesGenerator(com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator)
      Sets the identification feature generator.
      Parameters:
      identificationFeaturesGenerator - the identification feature generator
    • setSpectrumCountingParameters

      public void setSpectrumCountingParameters(com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingPreferences)
      Sets the spectrum counting preferences.
      Parameters:
      spectrumCountingPreferences - the spectrum counting preferences
    • setProjectDetails

      public void setProjectDetails(ProjectDetails projectDetails)
      Sets the project details.
      Parameters:
      projectDetails - the project details
    • setMetrics

      public void setMetrics(com.compomics.util.experiment.identification.peptide_shaker.Metrics metrics)
      Sets the metrics.
      Parameters:
      metrics - the metrics
    • setGeneMaps

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

      public com.compomics.util.experiment.ProjectParameters getProjectParameters()
      Returns the project parameters.
      Returns:
      the project parameters
    • setProject

      public void setProject(com.compomics.util.experiment.ProjectParameters projectParameters)
      Sets the project parameters.
      Parameters:
      projectParameters - the project parameters
    • setFilterParameters

      public void setFilterParameters(com.compomics.util.gui.filtering.FilterParameters filterPreferences)
      Sets the filter preferences.
      Parameters:
      filterPreferences - the filter preferences
    • setDisplayParameters

      public void setDisplayParameters(DisplayParameters displayPreferences)
      Sets the display preferences.
      Parameters:
      displayPreferences - the display preferences
    • setPsdbFile

      public void setPsdbFile(File psdbFile)
      Sets the psdb file.
      Parameters:
      psdbFile - the psdb file
    • setPsdbImportFromZip

      public void setPsdbImportFromZip(boolean importFromZip)
      Sets that the psdb file is imported from a zip file.
      Parameters:
      importFromZip - if the psdb was extracted from a zip file
    • getUserParameters

      public UserParameters getUserParameters()
      Returns the user preferences.
      Returns:
      the user preferences
    • setIdentification

      public void setIdentification(com.compomics.util.experiment.identification.Identification identification)
      Sets the identification object.
      Parameters:
      identification - the identification object
    • setDefaultParameters

      public void setDefaultParameters()
      Sets the default preferences.
    • resetIdentificationFeaturesGenerator

      public void resetIdentificationFeaturesGenerator()
      Resets the feature generator.
    • getIdentificationParameters

      public com.compomics.util.parameters.identification.IdentificationParameters getIdentificationParameters()
      Returns the identification parameters.
      Returns:
      the identification parameters
    • setIdentificationParameters

      public void setIdentificationParameters(com.compomics.util.parameters.identification.IdentificationParameters identificationParameters)
      Sets new identification parameters.
      Parameters:
      identificationParameters - the new identification parameters
    • getDbFolder

      public File getDbFolder()
      Returns the folder where the database is stored.
      Returns:
      the folder where the database is stored
    • setDbFolder

      public void setDbFolder(File dbFolder)
      Sets the folder where the database is stored.
      Parameters:
      dbFolder - the folder where the database is stored
    • getSequenceProvider

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

      public com.compomics.util.experiment.mass_spectrometry.SpectrumProvider getSpectrumProvider()
      Returns the spectrum provider.
      Returns:
      the spectrum provider
    • setMsFileHandler

      public void setMsFileHandler(com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler msFileHandler)
      Sets the mass spectrometry file handler.
      Parameters:
      msFileHandler - The mass spectrometry file handler.
    • setSequenceProvider

      public void setSequenceProvider(com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider)
      Sets the sequence provider.
      Parameters:
      sequenceProvider - the sequence provider
    • getProteinDetailsProvider

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

      public void setProteinDetailsProvider(com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider)
      Sets the protein details provider.
      Parameters:
      proteinDetailsProvider - the protein details provider
    • getProjectType

      public com.compomics.util.parameters.peptide_shaker.ProjectType getProjectType()
      Returns the project type.
      Returns:
      the project type
    • setProjectType

      public void setProjectType(com.compomics.util.parameters.peptide_shaker.ProjectType projectType)
      Sets the project type.
      Parameters:
      projectType - the project type
    • getExtendedProjectReport

      public String getExtendedProjectReport(String waitingHandlerReport)
      Returns an extended HTML project report.
      Parameters:
      waitingHandlerReport - the progress report, if null the report from the project details will be used
      Returns:
      an extended HTML project report
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable