Search in sources :

Example 1 with CSVExportTask

use of net.sf.mzmine.modules.peaklistmethods.io.csvexport.CSVExportTask in project mzmine2 by mzmine.

the class GnpsGcExportAndSubmitTask method addQuantTableTask.

/**
 * Export quant table
 *
 * @param parameters
 * @param tasks
 */
private AbstractTask addQuantTableTask(ParameterSet parameters, Collection<Task> tasks) {
    File full = parameters.getParameter(GnpsGcExportAndSubmitParameters.FILENAME).getValue();
    String name = FileAndPathUtil.eraseFormat(full.getName());
    full = FileAndPathUtil.getRealFilePath(full.getParentFile(), name + "_quant", "csv");
    ExportRowCommonElement[] common = new ExportRowCommonElement[] { ExportRowCommonElement.ROW_ID, ExportRowCommonElement.ROW_MZ, ExportRowCommonElement.ROW_RT };
    // height or area?
    ExportRowDataFileElement[] rawdata = new ExportRowDataFileElement[] { peakMeasure.equals(PeakMeasurementType.AREA) ? ExportRowDataFileElement.PEAK_AREA : ExportRowDataFileElement.PEAK_HEIGHT };
    CSVExportTask quanExport = new CSVExportTask(new PeakList[] { peakList }, full, ",", common, rawdata, false, ";", RowFilter.ALL);
    if (tasks != null)
        tasks.add(quanExport);
    return quanExport;
}
Also used : ExportRowCommonElement(net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowCommonElement) File(java.io.File) ExportRowDataFileElement(net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowDataFileElement) CSVExportTask(net.sf.mzmine.modules.peaklistmethods.io.csvexport.CSVExportTask)

Example 2 with CSVExportTask

use of net.sf.mzmine.modules.peaklistmethods.io.csvexport.CSVExportTask in project mzmine2 by mzmine.

the class GnpsFbmnExportAndSubmitTask method addQuantTableTask.

/**
 * Export quant table
 *
 * @param parameters
 * @param tasks
 */
private AbstractTask addQuantTableTask(ParameterSet parameters, Collection<Task> tasks) {
    File full = parameters.getParameter(GnpsFbmnExportAndSubmitParameters.FILENAME).getValue();
    String name = FileAndPathUtil.eraseFormat(full.getName());
    full = FileAndPathUtil.getRealFilePath(full.getParentFile(), name + "_quant", "csv");
    ExportRowCommonElement[] common = new ExportRowCommonElement[] { ExportRowCommonElement.ROW_ID, ExportRowCommonElement.ROW_MZ, ExportRowCommonElement.ROW_RT };
    ExportRowDataFileElement[] rawdata = new ExportRowDataFileElement[] { ExportRowDataFileElement.PEAK_AREA };
    RowFilter filter = parameters.getParameter(GnpsFbmnExportAndSubmitParameters.FILTER).getValue();
    CSVExportTask quanExport = new CSVExportTask(parameters.getParameter(GnpsFbmnExportAndSubmitParameters.PEAK_LISTS).getValue().getMatchingPeakLists(), full, ",", common, rawdata, false, ";", filter);
    if (tasks != null)
        tasks.add(quanExport);
    return quanExport;
}
Also used : RowFilter(net.sf.mzmine.modules.peaklistmethods.io.gnpsexport.fbmn.GnpsFbmnExportAndSubmitParameters.RowFilter) ExportRowCommonElement(net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowCommonElement) File(java.io.File) ExportRowDataFileElement(net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowDataFileElement) CSVExportTask(net.sf.mzmine.modules.peaklistmethods.io.csvexport.CSVExportTask)

Aggregations

File (java.io.File)2 CSVExportTask (net.sf.mzmine.modules.peaklistmethods.io.csvexport.CSVExportTask)2 ExportRowCommonElement (net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowCommonElement)2 ExportRowDataFileElement (net.sf.mzmine.modules.peaklistmethods.io.csvexport.ExportRowDataFileElement)2 RowFilter (net.sf.mzmine.modules.peaklistmethods.io.gnpsexport.fbmn.GnpsFbmnExportAndSubmitParameters.RowFilter)1