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 Type
    Method
    Description
    void
    addExportScheme(com.compomics.util.io.export.ExportScheme exportScheme)
     
    Returns the list of implemented reports as command line option.
    static String
    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 String
    getDefaultReportName(String experiment, String exportName)
    Returns the default file name for the export of a report based on the project details
    ArrayList<com.compomics.util.io.export.ExportFeature>
    getExportFeatures(String sectionName, boolean includeSubFeatures)
     
    com.compomics.util.io.export.ExportScheme
    getExportScheme(String schemeName)
     
    Returns the export type based on the number used in command line.
     
    Static method to get the instance of the factory.
    static String
    Returns the file where to save the implemented export schemes.
    static String
    Returns the folder where to save the implemented export schemes.
    Returns a list of the name of the available user schemes.
    Loads an export factory from a file.
    void
     
    static void
    saveFactory(ReporterExportFactory reporterExportFactory)
    Saves the factory in the user folder.
    static void
    setJsonFolder(String jsonFolder)
    Sets the folder where to save the implemented export schemes.
    static void
    writeDocumentation(com.compomics.util.io.export.ExportScheme exportScheme, com.compomics.util.io.export.ExportFormat exportFormat, File destinationFile)
    Writes the documentation related to a report.
    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)
    Writes the desired export in text format.If an argument is not needed, provide null (at your own risks).

    Methods inherited from class java.lang.Object

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

    • getInstance

      public static ReporterExportFactory getInstance()
      Static method to get the instance of the factory.
      Returns:
      the instance of the factory
    • saveFactory

      public static void saveFactory(ReporterExportFactory reporterExportFactory) throws IOException
      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

      public static ReporterExportFactory loadFromFile(File file) throws IOException
      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

      public ArrayList<String> getUserSchemesNames()
      Returns a list of the name of the available user schemes.
      Returns:
      a list of the implemented user schemes
    • getExportScheme

      public com.compomics.util.io.export.ExportScheme getExportScheme(String schemeName)
      Specified by:
      getExportScheme in interface com.compomics.util.io.export.ExportFactory
    • removeExportScheme

      public void removeExportScheme(String schemeName)
      Specified by:
      removeExportScheme in interface com.compomics.util.io.export.ExportFactory
    • addExportScheme

      public void addExportScheme(com.compomics.util.io.export.ExportScheme exportScheme)
      Specified by:
      addExportScheme in interface com.compomics.util.io.export.ExportFactory
    • getImplementedSections

      public ArrayList<String> getImplementedSections()
      Specified by:
      getImplementedSections in interface com.compomics.util.io.export.ExportFactory
    • getExportFeatures

      public ArrayList<com.compomics.util.io.export.ExportFeature> getExportFeatures(String sectionName, boolean includeSubFeatures)
      Specified by:
      getExportFeatures in interface com.compomics.util.io.export.ExportFactory
    • getDefaultExportSchemesNames

      public ArrayList<String> 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 export
      destinationFile - the destination file
      exportFormat - the export format
      experiment - 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 provider
      spectrumProvider - the spectrum provider
      proteinDetailsProvider - the protein details provider
      geneMaps - the gene maps
      quantificationFeaturesGenerator - the object generating the quantification features
      reporterIonQuantification - the reporter ion quantification object containing the quantification configuration
      reporterSettings - the reporter settings
      identificationParameters - the identification parameters
      proteinKeys - 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 file
      InterruptedException - exception thrown whenever a threading issue occurred while interacting with the database
      SQLException - exception thrown whenever an SQL exception occurred while interacting with the database
      ClassNotFoundException - exception thrown whenever an exception occurred while deserializing an object
      org.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 report
      exportFormat - the export format chosen by the user
      destinationFile - the destination file where to write the documentation
      Throws:
      IOException - if an IOException occurs
    • getCommandLineOptions

      public String getCommandLineOptions()
      Returns the list of implemented reports as command line option.
      Returns:
      the list of implemented reports
    • getDefaultReportName

      public static String getDefaultReportName(String experiment, String exportName)
      Returns the default file name for the export of a report based on the project details
      Parameters:
      experiment - the experiment of the project
      exportName - the name of the report type
      Returns:
      the default file name for the export
    • getDefaultDocumentation

      public static String getDefaultDocumentation(String exportName)
      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

      public String getExportTypeFromCommandLineOption(int commandLine)
      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

      public static String getJsonFile()
      Returns the file where to save the implemented export schemes.
      Returns:
      the file where to save the implemented export schemes
    • getJsonFolder

      public static String getJsonFolder()
      Returns the folder where to save the implemented export schemes.
      Returns:
      the folder where to save the implemented export schemes
    • setJsonFolder

      public static void setJsonFolder(String jsonFolder)
      Sets the folder where to save the implemented export schemes.
      Parameters:
      jsonFolder - the folder where to save the implemented export schemes