Skip to content

Commit

Permalink
Use tuples to ensure expected pair of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
nuno-agostinho committed Mar 3, 2023
1 parent b5d40af commit 9cf8b46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
13 changes: 5 additions & 8 deletions nextflow/ProteinFunction/nf_modules/polyphen2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ process run_pph2_on_all_aminoacid_substitutions {
val peptide

output:
path '*_scores.txt'
path '*_scores.txt', optional: true

afterScript 'rm -rf *.fa *.subs tmp/'

Expand Down Expand Up @@ -78,8 +78,7 @@ process run_weka {
path pph2_out

output:
path '*.txt', emit: results
val "${model}", emit: model
tuple path('*.txt'), val("${model}")

"""
run_weka.pl -l /opt/pph2/models/${model} ${pph2_out} \
Expand All @@ -98,11 +97,10 @@ process store_pph2_scores {
input:
val ready
val species
val peptide
path weka_output
val model
tuple path(weka_output), val(model)

"""
peptide_seq=`sort -u -n -k2,2 ${weka_output} | awk '{ print \$3 }' | sed 1d | tr -d '\n'`
store_polyphen_scores.pl $species ${params.port} ${params.host} \
${params.user} ${params.pass} ${params.database} \
\${peptide_seq} ${weka_output} ${model}
Expand Down Expand Up @@ -132,6 +130,5 @@ workflow run_pph2_pipeline {
"HumVar.UniRef100.NBd.f11.model")
run_weka(weka_model, run_pph2_on_all_aminoacid_substitutions.out)
store_pph2_scores(wait, // wait for data deletion
params.species, translated,
run_weka.out.results, run_weka.out.model)
params.species, run_weka.out)
}
18 changes: 8 additions & 10 deletions nextflow/ProteinFunction/nf_modules/sift.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ process align_peptides {
val blastdb_name

output:
path '*.alignedfasta'
tuple val(peptide), path('*.alignedfasta'), optional: true

afterScript 'rm -rf *.fa *.fa.query.out'

Expand Down Expand Up @@ -72,11 +72,10 @@ process run_sift_on_all_aminoacid_substitutions {
publishDir "${params.outdir}/sift"

input:
val peptide
path aln
tuple val(peptide), path(aln)

output:
path '*.SIFTprediction'
tuple val(peptide), path('*.SIFTprediction'), optional: true

afterScript 'rm -rf *.subs'

Expand All @@ -96,13 +95,12 @@ process store_sift_scores {
input:
val ready
val species
val peptide
path weka_output
tuple val(peptide), path(sift_scores)

"""
store_sift_scores.pl $species ${params.port} ${params.host} \
store_sift_scores.pl ${species} ${params.port} ${params.host} \
${params.user} ${params.pass} ${params.database} \
${peptide.seqString} $weka_output
${peptide.seqString} ${sift_scores}
"""
}

Expand Down Expand Up @@ -138,8 +136,8 @@ workflow run_sift_pipeline {
align_peptides(translated,
file(params.blastdb).parent,
file(params.blastdb).name)
run_sift_on_all_aminoacid_substitutions(translated, align_peptides.out)
run_sift_on_all_aminoacid_substitutions(align_peptides.out)
store_sift_scores(wait, // wait for data deletion
params.species, translated,
params.species,
run_sift_on_all_aminoacid_substitutions.out)
}

0 comments on commit 9cf8b46

Please sign in to comment.