Search in sources :

Example 1 with PSExportFactory

use of eu.isas.peptideshaker.export.PSExportFactory in project peptide-shaker by compomics.

the class CLIExportMethods method exportReport.

/**
 * Writes an export according to the command line settings contained in the
 * reportCLIInputBean.
 *
 * @param reportCLIInputBean the command line settings
 * @param reportType the report type
 * @param experiment the experiment of the project
 * @param projectDetails the project details of the project
 * @param identification the identification of the project
 * @param geneMaps the gene maps
 * @param identificationFeaturesGenerator the identification features
 * generator
 * @param identificationParameters the identification parameters used
 * @param sequenceProvider the sequence provider
 * @param proteinDetailsProvider the protein details provider
 * @param spectrumProvider The spectrum provider.
 * @param nSurroundingAA the number of amino acids to export on the side of
 * peptide sequences
 * @param spectrumCountingPreferences the spectrum counting preferences
 * @param waitingHandler waiting handler displaying feedback to the user
 * @return File file containing the exported report
 *
 * @throws IOException exception thrown whenever an IO exception occurred
 * while reading or writing to a file
 */
public static File exportReport(ReportCLIInputBean reportCLIInputBean, String reportType, String experiment, ProjectDetails projectDetails, Identification identification, GeneMaps geneMaps, IdentificationFeaturesGenerator identificationFeaturesGenerator, IdentificationParameters identificationParameters, SequenceProvider sequenceProvider, ProteinDetailsProvider proteinDetailsProvider, SpectrumProvider spectrumProvider, int nSurroundingAA, SpectrumCountingParameters spectrumCountingPreferences, WaitingHandler waitingHandler) throws IOException {
    PSExportFactory exportFactory = PSExportFactory.getInstance();
    ExportScheme exportScheme = exportFactory.getExportScheme(reportType);
    String reportName = reportType.replaceAll(" ", "_");
    reportName = PSExportFactory.getDefaultReportName(experiment, reportName);
    if (reportCLIInputBean.getReportNamePrefix() != null) {
        reportName = reportCLIInputBean.getReportNamePrefix() + reportName;
    }
    File reportFile = new File(reportCLIInputBean.getReportOutputFolder(), reportName);
    // @TODO: allow format selection
    PSExportFactory.writeExport(exportScheme, reportFile, ExportFormat.text, reportCLIInputBean.isGzip(), experiment, projectDetails, identification, identificationFeaturesGenerator, geneMaps, null, null, null, nSurroundingAA, identificationParameters, sequenceProvider, proteinDetailsProvider, spectrumProvider, spectrumCountingPreferences, waitingHandler);
    return reportFile;
}
Also used : PSExportFactory(eu.isas.peptideshaker.export.PSExportFactory) ExportScheme(com.compomics.util.io.export.ExportScheme) File(java.io.File)

Example 2 with PSExportFactory

use of eu.isas.peptideshaker.export.PSExportFactory in project peptide-shaker by compomics.

the class CLIExportMethods method exportDocumentation.

/**
 * Writes the documentation corresponding to an export given the command
 * line arguments.
 *
 * @param reportCLIInputBean the command line arguments
 * @param reportType the type of report of interest
 * @param waitingHandler waiting handler displaying feedback to the user
 *
 * @throws IOException exception thrown whenever an IO exception occurred
 * while reading or writing to a file
 */
public static void exportDocumentation(ReportCLIInputBean reportCLIInputBean, String reportType, WaitingHandler waitingHandler) throws IOException {
    PSExportFactory exportFactory = PSExportFactory.getInstance();
    ExportScheme exportScheme = exportFactory.getExportScheme(reportType);
    File reportFile = new File(reportCLIInputBean.getReportOutputFolder(), PSExportFactory.getDefaultDocumentation(reportType));
    // @TODO: allow format selection
    PSExportFactory.writeDocumentation(exportScheme, ExportFormat.text, reportFile);
}
Also used : PSExportFactory(eu.isas.peptideshaker.export.PSExportFactory) ExportScheme(com.compomics.util.io.export.ExportScheme) File(java.io.File)

Aggregations

ExportScheme (com.compomics.util.io.export.ExportScheme)2 PSExportFactory (eu.isas.peptideshaker.export.PSExportFactory)2 File (java.io.File)2