Class PSExportFactory

java.lang.Object
eu.isas.peptideshaker.export.PSExportFactory
All Implemented Interfaces:
com.compomics.util.io.export.ExportFactory

public class PSExportFactory extends Object implements com.compomics.util.io.export.ExportFactory
The PeptideShaker export factory.
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.
    static com.compomics.util.io.export.ExportScheme
    Returns the desired default export scheme.
    static String[]
    Returns a list of the default export schemes.
    static String
    getDefaultReportName(String experiment, String exportName, boolean gzipped)
    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(PSExportFactory psExportFactory)
    Saves the factory in the user folder.
    static void
    setJsonFolder(String serializationFolder)
    Sets the file 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, 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.

    Methods inherited from class java.lang.Object

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

    • getInstance

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

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

      public static PSExportFactory 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
    • getDefaultExportScheme

      public static com.compomics.util.io.export.ExportScheme getDefaultExportScheme(String schemeName)
      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

      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 static 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, 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 export
      destinationFile - the destination file
      exportFormat - the format of export to use
      gzip - if true export text as gzipped file
      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)
      geneMaps - the gene maps
      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)
      nSurroundingAA - the number of surrounding amino acids to export (mandatory for the Peptide section)
      identificationParameters - the identification parameters
      sequenceProvider - a provider for the protein sequences
      proteinDetailsProvider - the protein details provider
      spectrumProvider - the spectrum provider
      spectrumCountingPreferences - 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 report
      exportFormat - the export format chosen by the user
      destinationFile - the destination file where to write the documentation
      Throws:
      IOException - thrown 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, boolean gzipped)
      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
      gzipped - whether the report should be gzipped
      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 serializationFolder)
      Sets the file where to save the implemented export schemes.
      Parameters:
      serializationFolder - the folder where to save the implemented export schemes