diff --git a/main.nf b/main.nf index 210d26c..7164e81 100644 --- a/main.nf +++ b/main.nf @@ -112,6 +112,12 @@ workflow { all_mzml_ch = wide_mzml_ch } + // save details about this run + input_files = all_mzml_ch.map{ it -> ['Spectra File', it.baseName] } + version_files = Channel.empty() + save_run_details(input_files.collect(), version_files.collect()) + run_details_file = save_run_details.out.run_details + // if requested, upload mzMLs to panorama if(params.panorama.upload) { @@ -124,13 +130,6 @@ workflow { ) } - - // save details about this run - input_files = all_mzml_ch.map{ it -> ['Spectra File', it.baseName] } - version_files = Channel.empty() - save_run_details(input_files.collect(), version_files.collect()) - run_details_file = save_run_details.out.run_details - return } diff --git a/modules/skyline.nf b/modules/skyline.nf index 29ae0d0..de1b18c 100644 --- a/modules/skyline.nf +++ b/modules/skyline.nf @@ -17,7 +17,8 @@ process SKYLINE_ADD_LIB { output: path("results.sky.zip"), emit: skyline_zipfile - path("skyline_add_library.log"), emit: log + path("skyline_add_library.stdout"), emit: stdout + path("skyline_add_library.stderr"), emit: stderr path("pwiz_versions.txt"), emit: version shell: @@ -25,14 +26,14 @@ process SKYLINE_ADD_LIB { unzip !{skyline_template_zipfile} wine SkylineCmd \ - --in="!{skyline_template_zipfile.baseName}" \ - --log-file=skyline_add_library.log \ + --in="!{skyline_template_zipfile.baseName}" --memstamp \ --import-fasta="!{fasta}" \ --add-library-path="!{elib}" \ --out="results.sky" \ --save \ --share-zip="results.sky.zip" \ - --share-type="complete" + --share-type="complete" \ + > >(tee 'skyline_add_library.stdout') 2> >(tee 'skyline_add_library.stderr' >&2) # parse Skyline version info wine SkylineCmd --version > version.txt @@ -59,7 +60,7 @@ process SKYLINE_ADD_LIB { stub: ''' touch "results.sky.zip" - touch "skyline_add_library.log" + touch "skyline_add_library.stderr" "skyline_add_library.stdout" # parse Skyline version info wine SkylineCmd --version > version.txt @@ -99,7 +100,8 @@ process SKYLINE_IMPORT_MZML { output: path("*.skyd"), emit: skyd_file - path("${mzml_file.baseName}.log"), emit: log_file + path("${mzml_file.baseName}.stdout"), emit: stdout + path("${mzml_file.baseName}.stderr"), emit: stderr script: """ @@ -108,15 +110,15 @@ process SKYLINE_IMPORT_MZML { cp ${mzml_file} /tmp/${mzml_file} wine SkylineCmd \ - --in="${skyline_zipfile.baseName}" \ + --in="${skyline_zipfile.baseName}" --memstamp \ --import-no-join \ - --log-file="${mzml_file.baseName}.log" \ --import-file="/tmp/${mzml_file}" \ + > >(tee '${mzml_file.baseName}.stdout') 2> >(tee '${mzml_file.baseName}.stderr' >&2) """ stub: """ - touch "${mzml_file.baseName}.log" "${mzml_file.baseName}.skyd" + touch "${mzml_file.baseName}.stdout" "${mzml_file.baseName}.stderr" "${mzml_file.baseName}.skyd" """ } @@ -135,14 +137,15 @@ process SKYLINE_MERGE_RESULTS { output: path("${params.skyline.document_name}.sky.zip"), emit: final_skyline_zipfile - path("skyline-merge.log"), emit: log + path("skyline-merge.stdout"), emit: stdout + path("skyline-merge.stderr"), emit: stderr env(sky_zip_hash), emit: file_hash script: import_files_params = "--import-file=${(mzml_files as List).collect{ "/tmp/" + file(it).name }.join(' --import-file=')}" protein_parsimony_args = "--import-fasta=${fasta} --associate-proteins-shared-peptides=DuplicatedBetweenProteins --associate-proteins-min-peptides=1 --associate-proteins-remove-subsets --associate-proteins-minimal-protein-list" if(params.skyline.group_by_gene) { - protein_parsimony_args += ' --associate-proteins-gene-level-parsimony' + protein_parsimony_args += ' --associate-proteins-gene-level-parsimony' } """ @@ -151,14 +154,14 @@ process SKYLINE_MERGE_RESULTS { cp -v ${skyd_files} /tmp/ wine SkylineCmd \ - --in="${skyline_zipfile.baseName}" \ - --log-file="skyline-merge.log" \ + --in="${skyline_zipfile.baseName}" --memstamp \ ${import_files_params} \ ${params.skyline.protein_parsimony ? protein_parsimony_args : ''} \ --out="${params.skyline.document_name}.sky" \ --save \ --share-zip="${params.skyline.document_name}.sky.zip" \ - --share-type="complete" + --share-type="complete" \ + > >(tee 'skyline-merge.stdout') 2> >(tee 'skyline-merge.stderr' >&2) sky_zip_hash=\$( md5sum ${params.skyline.document_name}.sky.zip |awk '{print \$1}' ) """ @@ -166,7 +169,7 @@ process SKYLINE_MERGE_RESULTS { stub: """ touch "${params.skyline.document_name}.sky.zip" - touch "skyline-merge.log" + touch "skyline-merge.stderr" "skyline-merge.stdout" sky_zip_hash=\$( md5sum ${params.skyline.document_name}.sky.zip |awk '{print \$1}' ) """ } @@ -214,7 +217,7 @@ process SKYLINE_MINIMIZE_DOCUMENT { unzip ${skyline_zipfile} wine SkylineCmd \ - --in="${skyline_zipfile.baseName}" \ + --in="${skyline_zipfile.baseName}" --memstamp \ --chromatograms-discard-unused \ --chromatograms-limit-noise=1 \ --out="${sky_basename(skyline_zipfile)}_minimized.sky" \ @@ -255,7 +258,7 @@ process SKYLINE_ANNOTATE_DOCUMENT { unzip ${skyline_zipfile} # Create Skyline batch file with annotation definitions - echo '--in="${skyline_zipfile.baseName}"' > add_annotations.bat + echo '--in="${skyline_zipfile.baseName}" --memstamp' > add_annotations.bat cat ${annotation_definitions} >> add_annotations.bat echo '--import-annotations="${annotation_csv}"' >> add_annotations.bat echo '--save --out="${sky_basename(skyline_zipfile)}_annotated.sky"' >> add_annotations.bat @@ -295,7 +298,7 @@ process SKYLINE_RUN_REPORTS { unzip !{skyline_zipfile} # generate skyline batch file to export reports - echo "--in=\\"!{skyline_zipfile.baseName}\\"" > export_reports.bat + echo "--in=\\"!{skyline_zipfile.baseName}\\" --memstamp" > export_reports.bat for skyrfile in ./*.skyr; do # Add report to document