Skip to content

Commit

Permalink
[FIX] specify container for bash-only modules for AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfeuffer authored May 2, 2022
1 parent 57da6b1 commit 84aa31a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 11 additions & 2 deletions modules/local/preprocess_expdesign.nf
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
// Fixing file endings only necessary if the experimental design is user-specified
// TODO can we combine this with another step? Feels like a waste to spawn a worker for this.
// Maybe the renaming can be done in the rawfileconversion step? Or check if the OpenMS tools
// accept different file endings already?
process PREPROCESS_EXPDESIGN {
label 'process_very_low'
label 'process_single_thread'

container "frolvlad/alpine-bash"

input:
path design

output:
path "experimental_design.tsv", emit: ch_expdesign
path "process_experimental_design.tsv", emit: process_ch_expdesign
path "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 > experimental_design.tsv
a=\$(grep -n '^\$' $design | head -n1| awk -F":" '{print \$1}'); sed -e ''"\${a}"',\$d' $design > process_experimental_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 | head -n1| awk -F":" '{print \$1}'); sed -e ''"\${a}"',\$d' $design > config.tsv
"""
}
8 changes: 4 additions & 4 deletions subworkflows/local/create_input_channel.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ workflow CREATE_INPUT_CHANNEL {
if (is_sdrf.toString().toLowerCase().contains("true")) {
SDRFPARSING ( ch_sdrf_or_design )
ch_versions = ch_versions.mix(SDRFPARSING.out.version)
ch_in_design = SDRFPARSING.out.ch_sdrf_config_file
ch_config = SDRFPARSING.out.ch_sdrf_config_file

ch_expdesign = SDRFPARSING.out.ch_expdesign
} else {
PREPROCESS_EXPDESIGN( ch_sdrf_or_design )
ch_in_design = PREPROCESS_EXPDESIGN.out.process_ch_expdesign
ch_config = PREPROCESS_EXPDESIGN.out.ch_config

ch_expdesign = PREPROCESS_EXPDESIGN.out.ch_expdesign
ch_expdesign = PREPROCESS_EXPDESIGN.out.ch_expdesign
}

Set enzymes = []
Expand All @@ -38,7 +38,7 @@ workflow CREATE_INPUT_CHANNEL {
wrapper.labelling_type = ""
wrapper.acquisition_method = ""

ch_in_design.splitCsv(header: true, sep: '\t')
ch_config.splitCsv(header: true, sep: '\t')
.map { create_meta_channel(it, is_sdrf, enzymes, files, wrapper) }
.branch {
ch_meta_config_dia: it[0].acquisition_method.contains("dia")
Expand Down

0 comments on commit 84aa31a

Please sign in to comment.