Package eu.isas.reporter.export.report
Class ReporterExportFactory
java.lang.Object
eu.isas.reporter.export.report.ReporterExportFactory
- All Implemented Interfaces:
com.compomics.util.io.export.ExportFactory
public class ReporterExportFactory
extends Object
implements com.compomics.util.io.export.ExportFactory
The reporter export factory manages the reports available from Reporter.
- 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.Returns a list of the default export schemes.static StringgetDefaultReportName(String experiment, String exportName) 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 ReporterExportFactoryStatic 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 ReporterExportFactoryloadFromFile(File file) Loads an export factory from a file.voidremoveExportScheme(String schemeName) static voidsaveFactory(ReporterExportFactory reporterExportFactory) Saves the factory in the user folder.static voidsetJsonFolder(String jsonFolder) Sets the folder 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, String experiment, eu.isas.peptideshaker.preferences.ProjectDetails projectDetails, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider, com.compomics.util.experiment.biology.genes.GeneMaps geneMaps, QuantificationFeaturesGenerator quantificationFeaturesGenerator, com.compomics.util.experiment.quantification.reporterion.ReporterIonQuantification reporterIonQuantification, ReporterSettings reporterSettings, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, ArrayList<String> proteinKeys, long[] peptideKeys, long[] psmKeys, String proteinMatchKey, int nSurroundingAA, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParameters, com.compomics.util.waiting.WaitingHandler waitingHandler) Writes the desired export in text format.If an argument is not needed, provide null (at your own risks).
-
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:
reporterExportFactory- the export factory- Throws:
IOException- exception thrown whenever an error occurred while saving the ptmFactory
-
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
-
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, String experiment, eu.isas.peptideshaker.preferences.ProjectDetails projectDetails, com.compomics.util.experiment.identification.Identification identification, com.compomics.util.experiment.identification.features.IdentificationFeaturesGenerator identificationFeaturesGenerator, com.compomics.util.experiment.io.biology.protein.SequenceProvider sequenceProvider, com.compomics.util.experiment.mass_spectrometry.SpectrumProvider spectrumProvider, com.compomics.util.experiment.io.biology.protein.ProteinDetailsProvider proteinDetailsProvider, com.compomics.util.experiment.biology.genes.GeneMaps geneMaps, QuantificationFeaturesGenerator quantificationFeaturesGenerator, com.compomics.util.experiment.quantification.reporterion.ReporterIonQuantification reporterIonQuantification, ReporterSettings reporterSettings, com.compomics.util.parameters.identification.IdentificationParameters identificationParameters, ArrayList<String> proteinKeys, long[] peptideKeys, long[] psmKeys, String proteinMatchKey, int nSurroundingAA, com.compomics.util.parameters.quantification.spectrum_counting.SpectrumCountingParameters spectrumCountingParameters, com.compomics.util.waiting.WaitingHandler waitingHandler) throws IOException, SQLException, ClassNotFoundException, InterruptedException, org.apache.commons.math.MathException 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 export formatexperiment- 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)sequenceProvider- the sequence providerspectrumProvider- the spectrum providerproteinDetailsProvider- the protein details providergeneMaps- the gene mapsquantificationFeaturesGenerator- the object generating the quantification featuresreporterIonQuantification- the reporter ion quantification object containing the quantification configurationreporterSettings- the reporter settingsidentificationParameters- the identification parametersproteinKeys- 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)proteinMatchKey- the protein match key when exporting peptides from a single protein match (optional for the Peptide sections)nSurroundingAA- the number of surrounding amino acids to export (mandatory for the Peptide section)spectrumCountingParameters- 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 fileInterruptedException- exception thrown whenever a threading issue occurred while interacting with the databaseSQLException- exception thrown whenever an SQL exception occurred while interacting with the databaseClassNotFoundException- exception thrown whenever an exception occurred while deserializing an objectorg.apache.commons.math.MathException- exception thrown whenever an exception occurred while estimating the theoretical coverage of a protein
-
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- 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 type- 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 folder where to save the implemented export schemes.- Parameters:
jsonFolder- the folder where to save the implemented export schemes
-