diff --git a/docs/source/workflow_parameters.rst b/docs/source/workflow_parameters.rst index c88bee9..2b53e28 100644 --- a/docs/source/workflow_parameters.rst +++ b/docs/source/workflow_parameters.rst @@ -101,6 +101,9 @@ The ``params`` Section * - - ``msconvert.do_simasspectra`` - If starting with raw files, this is the value used by ``msconvert`` for the ``do_simasspectra`` parameter. Default: ``true``. + * - + - ``msconvert.mz_shift_ppm`` + - If starting with raw files, ``msconvert`` will shift all mz values by ``n`` ppm when converting to ``mzML``. If ``null`` the mz values are not shifed. Default: ``null``. * - - ``encyclopedia.chromatogram.params`` - If you are generating a chromatogram library for quantification, this is the command line options passed to EncyclopeDIA during the chromatogram generation step. Default: ``'-enableAdvancedOptions -v2scoring'`` If you do not wish to pass any options to EncyclopeDIA, this must be set to ``''``. diff --git a/modules/msconvert.nf b/modules/msconvert.nf index 38e9935..3eec184 100644 --- a/modules/msconvert.nf +++ b/modules/msconvert.nf @@ -1,5 +1,30 @@ + +/** + * Generate the msconvert command based off user defined parameters. + */ +def msconvert_command() { + return """ + wine msconvert -v --zlib --mzML --64 \ + --ignoreUnknownInstrumentError --filter "peakPicking true 1-" \ + ${params.msconvert.do_demultiplex ? '--filter "demultiplex optimization=overlap_only"' : ''} \ + ${params.msconvert.do_simasspectra ? '--simAsSpectra' : ''} \ + ${params.msconvert.mz_shift_ppm == null ? '' : '--filter "mzShift ' + "${params.msconvert.mz_shift_ppm}" + 'ppm msLevels=1-"'} \ + """ +} + +/** + * Calculate a unique hash for msconvert configuration. + * + * The hash combines the text of the msconvert command without the raw file and + * the proteowizard container. + */ +def msconvert_cache_dir() { + def str = params.images.proteowizard + msconvert_command() + return str.md5() +} + process MSCONVERT { - storeDir "${params.mzml_cache_directory}/${workflow.commitId}/${params.msconvert.do_demultiplex}/${params.msconvert.do_simasspectra}" + storeDir "${params.mzml_cache_directory}/${msconvert_cache_dir()}" publishDir params.output_directories.msconvert, pattern: "*.mzML", failOnError: true, mode: 'copy', enabled: params.msconvert_only && !params.panorama.upload label 'process_medium' label 'process_high_memory' @@ -8,26 +33,14 @@ process MSCONVERT { input: path raw_file - val do_demultiplex - val do_simasspectra output: path("${raw_file.baseName}.mzML"), emit: mzml_file script: - demultiplex_param = do_demultiplex ? '--filter "demultiplex optimization=overlap_only"' : '' - simasspectra = do_simasspectra ? '--simAsSpectra' : '' - """ - wine msconvert \ - ${raw_file} \ - -v \ - --zlib \ - --mzML \ - --ignoreUnknownInstrumentError \ - --filter "peakPicking true 1-" \ - --64 ${simasspectra} ${demultiplex_param} + ${msconvert_command()} ${raw_file} """ stub: diff --git a/modules/skyline.nf b/modules/skyline.nf index 844e5c4..8de7886 100644 --- a/modules/skyline.nf +++ b/modules/skyline.nf @@ -304,7 +304,7 @@ process SKYLINE_RUN_REPORTS { for skyrfile in ./*.skyr; do # Add report to document - echo "--report-add=\\"${skyrfile}\\"" >> export_reports.bat + echo "--report-add=\\"${skyrfile}\\" --report-conflict-resolution=overwrite" >> export_reports.bat # Export report awk -F'"' '/ tuple(row.url, row.file_name, row.md5sum)} \ | GET_FILE - MSCONVERT(GET_FILE.out.downloaded_file, - params.msconvert.do_demultiplex, - params.msconvert.do_simasspectra) + MSCONVERT(GET_FILE.out.downloaded_file) wide_mzml_ch = MSCONVERT.out.mzml_file }