Package eu.isas.peptideshaker.utils
Class PsdbParent
java.lang.Object
eu.isas.peptideshaker.preferences.UserPreferencesParent
eu.isas.peptideshaker.utils.PsdbParent
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
FollowUpCLI,MzidCLI,PeptideShakerCLI,ReportCLI
Implementing this abstract class allows interacting with a psdb files.
- Author:
- Marc Vaudel, Harald Barsnes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileThe folder where the database is stored.protected DisplayParametersThe display parameters.protected com.compomics.util.gui.filtering.FilterParametersThe filter parameters.protected com.compomics.util.experiment.biology.genes.GeneMapsThe gene maps.protected com.compomics.util.experiment.identification.IdentificationThe identification.protected com.compomics.util.experiment.identification.features.IdentificationFeaturesGeneratorThe identification features generator.protected com.compomics.util.parameters.identification.IdentificationParametersThe identification parameters.protected com.compomics.util.experiment.identification.peptide_shaker.MetricsThe metrics stored during processing.protected com.compomics.util.experiment.io.mass_spectrometry.MsFileHandlerThe mass spectrometry file handler.protected ProjectDetailsThe project details.com.compomics.util.experiment.ProjectParametersAll parameters of a project.protected com.compomics.util.parameters.peptide_shaker.ProjectTypeThe project type.protected com.compomics.util.experiment.io.biology.protein.ProteinDetailsProviderThe protein details provider.protected FileThe currently loaded psdb file.protected com.compomics.util.experiment.io.biology.protein.SequenceProviderThe sequence provider.protected com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParametersThe spectrum counting preferences.Fields inherited from class eu.isas.peptideshaker.preferences.UserPreferencesParent
userPreferences -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for instantiation purposes.PsdbParent(File dbFolder) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.FilterParametersReturns the filter preferences.com.compomics.util.experiment.biology.genes.GeneMapsReturns the gene maps.com.compomics.util.experiment.identification.IdentificationReturns the identification object.com.compomics.util.experiment.identification.features.IdentificationFeaturesGeneratorReturns the identification features generator object.com.compomics.util.parameters.identification.IdentificationParametersReturns the identification parameters.com.compomics.util.experiment.identification.peptide_shaker.MetricsReturns the metrics object.Returns the project details.com.compomics.util.experiment.ProjectParametersReturns the project parameters.com.compomics.util.parameters.peptide_shaker.ProjectTypeReturns the project type.com.compomics.util.experiment.io.biology.protein.ProteinDetailsProviderReturns the protein details provider.Returns the psdb file.booleanReturns the psdb import from zip.com.compomics.util.experiment.io.biology.protein.SequenceProviderReturns the sequence provider.com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParametersReturns the spectrum counting preferences.com.compomics.util.experiment.mass_spectrometry.SpectrumProviderReturns the spectrum provider.Returns the user preferences.com.compomics.util.experiment.io.biology.protein.FastaSummaryloadFastaFile(com.compomics.util.waiting.WaitingHandler waitingHandler) Loads the FASTA file.voidloadPsdbFile(File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler, boolean openFromZip) Loads the information from a psdb file.voidloadPsdbFromZipFile(File zipFile, File dbFolder, com.compomics.util.waiting.WaitingHandler waitingHandler) Loads the information from a psdb file.voidloadSpectrumFile(File spectrumFile, com.compomics.util.waiting.WaitingHandler waitingHandler) Adds a spectrum file to the spectrum provider.booleanloadSpectrumFile(String spectrumFileName, ArrayList<File> spectrumFiles, com.compomics.util.waiting.WaitingHandler waitingHandler) Loads the spectrum file.booleanloadSpectrumFiles(com.compomics.util.waiting.WaitingHandler waitingHandler) Loads the spectra in the spectrum factory.booleanloadSpectrumFiles(File folder, com.compomics.util.waiting.WaitingHandler waitingHandler) Loads the spectrum files.voidResets the feature generator.voidsaveProject(com.compomics.util.waiting.WaitingHandler waitingHandler, boolean emptyCache) Saves the project in the psdb file.voidsetDbFolder(File dbFolder) Sets the folder where the database is stored.voidSets the default preferences.voidsetDisplayParameters(DisplayParameters displayPreferences) Sets the display preferences.voidsetFilterParameters(com.compomics.util.gui.filtering.FilterParameters filterPreferences) Sets the filter preferences.voidsetGeneMaps(com.compomics.util.experiment.biology.genes.GeneMaps geneMaps) Sets the gene maps.voidsetIdentification(com.compomics.util.experiment.identification.Identification identification) Sets the identification object.voidsetIdentificationFeaturesGenerator(com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator) Sets the identification feature generator.voidsetIdentificationParameters(com.compomics.util.parameters.identification.IdentificationParameters identificationParameters) Sets new identification parameters.voidsetMetrics(com.compomics.util.experiment.identification.peptide_shaker.Metrics metrics) Sets the metrics.voidsetMsFileHandler(com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler msFileHandler) Sets the mass spectrometry file handler.voidsetProject(com.compomics.util.experiment.ProjectParameters projectParameters) Sets the project parameters.voidsetProjectDetails(ProjectDetails projectDetails) Sets the project details.voidsetProjectType(com.compomics.util.parameters.peptide_shaker.ProjectType projectType) Sets the project type.voidsetProteinDetailsProvider(com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider) Sets the protein details provider.voidsetPsdbFile(File psdbFile) Sets the psdb file.voidsetPsdbImportFromZip(boolean importFromZip) Sets that the psdb file is imported from a zip file.voidsetSequenceProvider(com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider) Sets the sequence provider.voidsetSpectrumCountingParameters(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
-
Field Details
-
identification
protected com.compomics.util.experiment.identification.Identification identificationThe identification. -
identificationFeaturesGenerator
protected com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGeneratorThe identification features generator. -
identificationParameters
protected com.compomics.util.parameters.identification.IdentificationParameters identificationParametersThe identification parameters. -
spectrumCountingParameters
protected com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParametersThe spectrum counting preferences. -
projectDetails
The project details. -
metrics
protected com.compomics.util.experiment.identification.peptide_shaker.Metrics metricsThe metrics stored during processing. -
sequenceProvider
protected com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProviderThe sequence provider. -
proteinDetailsProvider
protected com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProviderThe protein details provider. -
msFileHandler
protected com.compomics.util.experiment.io.mass_spectrometry.MsFileHandler msFileHandlerThe mass spectrometry file handler. -
geneMaps
protected com.compomics.util.experiment.biology.genes.GeneMaps geneMapsThe gene maps. -
filterParameters
protected com.compomics.util.gui.filtering.FilterParameters filterParametersThe filter parameters. -
displayParameters
The display parameters. -
dbFolder
The folder where the database is stored. -
psdbFile
The currently loaded psdb file. -
projectParameters
public com.compomics.util.experiment.ProjectParameters projectParametersAll parameters of a project. -
projectType
protected com.compomics.util.parameters.peptide_shaker.ProjectType projectTypeThe project type.
-
-
Constructor Details
-
PsdbParent
public PsdbParent()Empty constructor for instantiation purposes. -
PsdbParent
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 filedbFolder- the folder where to extract the projectwaitingHandler- 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 projectwaitingHandler- a waiting handler displaying feedback to the user. Ignored if nullopenFromZip- 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
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
Returns the display preferences.- Returns:
- the display preferences
-
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
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
Sets the display preferences.- Parameters:
displayPreferences- the display preferences
-
setPsdbFile
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
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
Returns the folder where the database is stored.- Returns:
- the folder where the database is stored
-
setDbFolder
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
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:
closein interfaceAutoCloseable
-