Package eu.isas.peptideshaker.export
Class PSExportFactory
java.lang.Object
eu.isas.peptideshaker.export.PSExportFactory
- All Implemented Interfaces:
com.compomics.util.io.export.ExportFactory
The PeptideShaker export factory.
- Author:
- Marc Vaudel, Harald Barsnes
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddExportScheme(com.compomics.util.io.export.ExportScheme exportScheme) Returns the list of implemented reports as command line option.static StringgetDefaultDocumentation(String exportName) Returns the default file name for the export of the documentation of the given report export type.static com.compomics.util.io.export.ExportSchemegetDefaultExportScheme(String schemeName) Returns the desired default export scheme.static String[]Returns a list of the default export schemes.static StringgetDefaultReportName(String experiment, String exportName, boolean gzipped) Returns the default file name for the export of a report based on the project detailsArrayList<com.compomics.util.io.export.ExportFeature> getExportFeatures(String sectionName, boolean includeSubFeatures) com.compomics.util.io.export.ExportSchemegetExportScheme(String schemeName) getExportTypeFromCommandLineOption(int commandLine) Returns the export type based on the number used in command line.static PSExportFactoryStatic method to get the instance of the factory.static StringReturns the file where to save the implemented export schemes.static StringReturns the folder where to save the implemented export schemes.Returns a list of the name of the available user schemes.static PSExportFactoryloadFromFile(File file) Loads an export factory from a file.voidremoveExportScheme(String schemeName) static voidsaveFactory(PSExportFactory psExportFactory) Saves the factory in the user folder.static voidsetJsonFolder(String serializationFolder) Sets the file where to save the implemented export schemes.static voidwriteDocumentation(com.compomics.util.io.export.ExportScheme exportScheme, com.compomics.util.io.export.ExportFormat exportFormat, File destinationFile) Writes the documentation related to a report.static voidwriteExport(com.compomics.util.io.export.ExportScheme exportScheme, File destinationFile, com.compomics.util.io.export.ExportFormat exportFormat, boolean gzip, String experiment, ProjectDetails projectDetails, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator, com.compomics.util.experiment.biology.genes.GeneMaps geneMaps, long[] proteinKeys, long[] peptideKeys, long[] psmKeys, int nSurroundingAA, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingPreferences, com.compomics.util.waiting.WaitingHandler waitingHandler) Writes the desired export in text format.
-
Method Details
-
getInstance
Static method to get the instance of the factory.- Returns:
- the instance of the factory
-
saveFactory
Saves the factory in the user folder.- Parameters:
psExportFactory- the instance of the factory to save- Throws:
IOException- exception thrown whenever an error occurred while saving the PSExportFactory
-
loadFromFile
Loads an export factory from a file. The file must be an export of the factory in the json format.- Parameters:
file- the file to load- Returns:
- the export factory saved in file
- Throws:
IOException- exception thrown whenever an error occurred while loading the file
-
getUserSchemesNames
Returns a list of the name of the available user schemes.- Returns:
- a list of the implemented user schemes
-
getDefaultExportScheme
Returns the desired default export scheme. Null if not found.- Parameters:
schemeName- the name of the default export scheme- Returns:
- the default export scheme
-
getExportScheme
- Specified by:
getExportSchemein interfacecom.compomics.util.io.export.ExportFactory
-
removeExportScheme
- Specified by:
removeExportSchemein interfacecom.compomics.util.io.export.ExportFactory
-
addExportScheme
public void addExportScheme(com.compomics.util.io.export.ExportScheme exportScheme) - Specified by:
addExportSchemein interfacecom.compomics.util.io.export.ExportFactory
-
getImplementedSections
- Specified by:
getImplementedSectionsin interfacecom.compomics.util.io.export.ExportFactory
-
getExportFeatures
public ArrayList<com.compomics.util.io.export.ExportFeature> getExportFeatures(String sectionName, boolean includeSubFeatures) - Specified by:
getExportFeaturesin interfacecom.compomics.util.io.export.ExportFactory
-
getDefaultExportSchemesNames
Returns a list of the default export schemes.- Returns:
- a list of the default export schemes
-
writeExport
public static void writeExport(com.compomics.util.io.export.ExportScheme exportScheme, File destinationFile, com.compomics.util.io.export.ExportFormat exportFormat, boolean gzip, String experiment, ProjectDetails projectDetails, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator, com.compomics.util.experiment.biology.genes.GeneMaps geneMaps, long[] proteinKeys, long[] peptideKeys, long[] psmKeys, int nSurroundingAA, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingPreferences, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException Writes the desired export in text format. If an argument is not needed, provide null (at your own risks).- Parameters:
exportScheme- the scheme of the exportdestinationFile- the destination fileexportFormat- the format of export to usegzip- if true export text as gzipped fileexperiment- the experiment corresponding to this project (mandatory for the Project section)projectDetails- the project details (mandatory for the Project section)identification- the identification (mandatory for the Protein, Peptide and PSM sections)identificationFeaturesGenerator- the identification features generator (mandatory for the Protein, Peptide and PSM sections)geneMaps- the gene mapsproteinKeys- the protein keys to export (mandatory for the Protein section)peptideKeys- the peptide keys to export (mandatory for the Peptide section)psmKeys- the keys of the PSMs to export (mandatory for the PSM section)nSurroundingAA- the number of surrounding amino acids to export (mandatory for the Peptide section)identificationParameters- the identification parameterssequenceProvider- a provider for the protein sequencesproteinDetailsProvider- the protein details providerspectrumProvider- the spectrum providerspectrumCountingPreferences- the spectrum counting preferences (mandatory for the spectrum counting section)waitingHandler- the waiting handler- Throws:
IOException- exception thrown whenever an IO exception occurred while reading or writing to a file
-
writeDocumentation
public static void writeDocumentation(com.compomics.util.io.export.ExportScheme exportScheme, com.compomics.util.io.export.ExportFormat exportFormat, File destinationFile) throws IOException Writes the documentation related to a report.- Parameters:
exportScheme- the export scheme of the reportexportFormat- the export format chosen by the userdestinationFile- the destination file where to write the documentation- Throws:
IOException- thrown if an IOException occurs
-
getCommandLineOptions
Returns the list of implemented reports as command line option.- Returns:
- the list of implemented reports
-
getDefaultReportName
Returns the default file name for the export of a report based on the project details- Parameters:
experiment- the experiment of the projectexportName- the name of the report typegzipped- whether the report should be gzipped- Returns:
- the default file name for the export
-
getDefaultDocumentation
Returns the default file name for the export of the documentation of the given report export type.- Parameters:
exportName- the export name- Returns:
- the default file name for the export
-
getExportTypeFromCommandLineOption
Returns the export type based on the number used in command line.- Parameters:
commandLine- the number used in command line option. See getCommandLineOptions().- Returns:
- the corresponding export name
-
getJsonFile
Returns the file where to save the implemented export schemes.- Returns:
- the file where to save the implemented export schemes
-
getJsonFolder
Returns the folder where to save the implemented export schemes.- Returns:
- the folder where to save the implemented export schemes
-
setJsonFolder
Sets the file where to save the implemented export schemes.- Parameters:
serializationFolder- the folder where to save the implemented export schemes
-