Skip to content

Commit

Permalink
Fix design and tag renaming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfeuffer committed May 5, 2022
1 parent bfd1389 commit 8361c38
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
4 changes: 4 additions & 0 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ export_plots: true
custom_logo: "./nf-core-quantms_logo_light.png"
custom_logo_url: "https://github.com/bigbio/quantms"
custom_logo_title: "quantms"

sp:
quantms/exp_design:
fn: "*_design.tsv"
14 changes: 7 additions & 7 deletions modules/local/openms/proteomicslfq/main.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process PROTEOMICSLFQ {
tag "$expdes.Name"
tag "${expdes.baseName - ~/_design$/}"
label 'process_high'

conda (params.enable_conda ? "bioconda::openms=2.8.0" : null)
Expand All @@ -14,8 +14,8 @@ process PROTEOMICSLFQ {
path(fasta)

output:
path "${expdes.baseName}.mzTab", emit: out_mztab
path "${expdes.baseName}.consensusXML", emit: out_consensusXML
path "${expdes.baseName - ~/_design$/}.mzTab", emit: out_mztab
path "${expdes.baseName - ~/_design$/}.consensusXML", emit: out_consensusXML
path "*out_msstats.csv", emit: out_msstats optional true
path "*out_triqler.tsv", emit: out_triqler optional true
path "debug_mergedIDs.idXML", emit: debug_mergedIDs optional true
Expand All @@ -29,8 +29,8 @@ process PROTEOMICSLFQ {

script:
def args = task.ext.args ?: ''
def msstats_present = params.quantification_method == "feature_intensity" ? "-out_msstats ${expdes.baseName}_msstats_in.csv" : ""
def triqler_present = (params.quantification_method == "feature_intensity") && (params.add_triqler_output) ? "-out_triqler ${expdes.baseName}_triqler_in.tsv" : ""
def msstats_present = params.quantification_method == "feature_intensity" ? "-out_msstats ${expdes.baseName - ~/_design$/}_msstats_in.csv" : ""
def triqler_present = (params.quantification_method == "feature_intensity") && (params.add_triqler_output) ? "-out_triqler ${expdes.baseName - ~/_design$/}_triqler_in.tsv" : ""
def decoys_present = (params.quantify_decoys || ((params.quantification_method == "feature_intensity") && params.add_triqler_output)) ? '-PeptideQuantification:quantify_decoys' : ''

"""
Expand All @@ -47,12 +47,12 @@ process PROTEOMICSLFQ {
-protein_quantification ${params.protein_quant} \\
-alignment_order ${params.alignment_order} \\
-picked_proteinFDR true \\
-out ${expdes.baseName}.mzTab \\
-out ${expdes.baseName - ~/_design$/}.mzTab \\
-threads ${task.cpus} \\
${msstats_present} \\
${triqler_present} \\
${decoys_present} \\
-out_cxml out.consensusXML \\
-out_cxml ${expdes.baseName - ~/_design$/}.consensusXML \\
-proteinFDR ${params.protein_level_fdr_cutoff} \\
$args \\
|& tee proteomicslfq.log
Expand Down
6 changes: 3 additions & 3 deletions modules/local/pmultiqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ process PMULTIQC {

output:
path "*.html", emit: ch_pmultiqc_report
path "*.db", optional:true, emit: ch_pmultiqc_db
path "*.db", optional: true, emit: ch_pmultiqc_db
path "versions.yml", emit: versions
path "*_data", emit: data
path "*_plots", optional:true, emit: plots
path "*_plots", optional: true, emit: plots

script:
def args = task.ext.args ?: ''
def disable_pmultqic = params.enable_pmultiqc ? "": "--disable_plugin"
def disable_pmultqic = params.enable_pmultiqc ? "" : "--disable_plugin"

"""
multiqc \\
Expand Down
11 changes: 6 additions & 5 deletions modules/local/preprocess_expdesign.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@
process PREPROCESS_EXPDESIGN {
label 'process_very_low'
label 'process_single_thread'
tag "$design.Name"

container "frolvlad/alpine-bash"

input:
path design, stageAs: '${design.baseName}_raw.tsv'
path design

output:
path "experimental_design.tsv", emit: ch_expdesign
path "config.tsv", emit: ch_config
path "${design.baseName}_design.tsv", emit: ch_expdesign
path "${design.baseName}_config.tsv", emit: ch_config

script:

"""
# since we know that we will need to convert from raw to mzML for all tools that need the design (i.e., OpenMS tools)
# we edit the design here and change the endings.
sed 's/.raw\\t/.mzML\\t/I' ${design.baseName}_raw.tsv > ${design.baseName}.tsv
sed 's/.raw\\t/.mzML\\t/I' ${design} > ${design.baseName}_design.tsv
# here we extract the filenames and fake an empty config (since the config values will be deduced from the workflow params)
a=\$(grep -n '^\$' ${design.baseName}_raw.tsv | head -n1| awk -F":" '{print \$1}'); sed -e ''"\${a}"',\$d' ${design.baseName}_raw.tsv > ${design.baseName}_config.tsv
a=\$(grep -n '^\$' ${design} | head -n1| awk -F":" '{print \$1}'); sed -e ''"\${a}"',\$d' ${design} > ${design.baseName}_config.tsv
"""
}

0 comments on commit 8361c38

Please sign in to comment.