$ cat file.lst
31_pep.fas
32_pep.fas
33_pep.fas
$ cat templates/list_command.sh
#!/bin/bash
echo "muscle -in ${seq} -out tmp_out.aln"
echo "t_coffee -other_pg seq_reformat -in tmp_out.aln -output phylip -out ${seq}_AS_${mode}.aln"
touch "${seq}_AS_${mode}.aln"
echo "Done !"
$ cat main.nf
listSeq=params.file
Channel.fromPath(listSeq)
.splitText()
.map { file(it) }
.into { file_list; file_list2 }
file_list2.subscribe { println "[file_list2] ${it}" }
methods = ['muscle', 'mafft', 'clustalo', 'all']
process listAlign {
input:
file seq from
file_list
each mode from methods
output:
file "*.aln" into listeAln, listeAln2, listeAln3, listeAln4, listeAln5
stdout out_list
script:
print "${seq}" > out_list
if( mode == 'muscle' || mode == 'mafft' || mode == 'clustalo' || mode == 'all' ){
template "list_command.sh"
}else
error "Invalid alignment mode: ${mode}"
}
ERROR ~ Error executing process > 'listAlign (7)'
Caused by:
Process `listAlign (7)` terminated with an error exit status (127)
Command executed [/Users/kellys04/projects/nf-example1/templates/list_command.sh]:
#!/bin/bash
echo "muscle -in 32_pep.fas
-out tmp_out.aln"
echo "t_coffee -other_pg seq_reformat -in tmp_out.aln -output phylip -out 32_pep.fas
_AS_clustalo.aln"
touch "32_pep.fas
_AS_clustalo.aln"
echo "Done !"
Command exit status:
127
Command output:
(empty)
Command wrapper:
.command.run: line 64: 32_pep.fas: command not found
Work dir:
/Users/kellys04/projects/nf-example1/work/73/7f4dd907c5d3c090ae8838559bb816
Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`
-- Check '.nextflow.log' file for details
WARN: Killing pending tasks (6)
make: *** [run] Error 1
$ cat -n /Users/kellys04/projects/nf-example1/work/73/7f4dd907c5d3c090ae8838559bb816/.command.run
1 #!/bin/bash
2 # NEXTFLOW TASK: listAlign (7)
3 set -e
4 set -u
5 NXF_DEBUG=${NXF_DEBUG:=0}; [[ $NXF_DEBUG > 1 ]] && set -x
6
...
...
...
59 [[ $NXF_SCRATCH ]] && echo "nxf-scratch-dir $HOSTNAME:$NXF_SCRATCH" && cd $NXF_SCRATCH
60 # stage input files
61 rm -f 32_pep.fas
62
63 ln -s /Users/kellys04/projects/nf-example1/32_pep.fas
64 32_pep.fas
65
$ cat /Users/kellys04/projects/nf-example1/work/73/7f4dd907c5d3c090ae8838559bb816/.command.sh
#!/bin/bash
echo "muscle -in 32_pep.fas
-out tmp_out.aln"
echo "t_coffee -other_pg seq_reformat -in tmp_out.aln -output phylip -out 32_pep.fas
_AS_clustalo.aln"
touch "32_pep.fas
_AS_clustalo.aln"
echo "Done !"
$ cat main.nf
listSeq=params.file
Channel.fromPath(listSeq)
.splitCsv()
.map { row ->
def path = file("${row[0]}")
return path
}
.into { file_list; file_list2 }
file_list2.subscribe { println "[file_list2] ${it}" }
methods = ['muscle', 'mafft', 'clustalo', 'all']
process listAlign {
input:
file seq from
file_list
each mode from methods
output:
file "*.aln" into listeAln, listeAln2, listeAln3, listeAln4, listeAln5
stdout out_list
script:
print "${seq}" > out_list
if( mode == 'muscle' || mode == 'mafft' || mode == 'clustalo' || mode == 'all' ){
template "list_command.sh"
}else
error "Invalid alignment mode: ${mode}"
}
$ make run
./nextflow run main.nf --file file.lst
N E X T F L O W
~ version 0.28.0
Launching `main.nf` [tiny_davinci] - revision: 43295cc830
[file_list2] /Users/kellys04/projects/nf-example1/31_pep.fas
[file_list2] /Users/kellys04/projects/nf-example1/32_pep.fas
[file_list2] /Users/kellys04/projects/nf-example1/33_pep.fas
[warm up] executor > local
falsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalse[e4/6f17f8] Submitted process > listAlign (2)
[b5/847e2a] Submitted process > listAlign (1)
[fb/1a22e7] Submitted process > listAlign (4)
[16/8d36e1] Submitted process > listAlign (5)
[bb/4190dd] Submitted process > listAlign (3)
[db/ae889f] Submitted process > listAlign (6)
[a2/c62ef3] Submitted process > listAlign (7)
[e0/eae221] Submitted process > listAlign (8)
[cc/d897c5] Submitted process > listAlign (12)
[80/11bbde] Submitted process > listAlign (11)
[e7/0c7352] Submitted process > listAlign (10)
[b6/005163] Submitted process > listAlign (9)
Line breaks have been introduced. This is because you are using `splitText` to parse the file; this preserves the trailing line break. The solution is to instead use `splitCsv`, like this:
$ cat main.nf
listSeq=params.file
Channel.fromPath(listSeq)
.splitCsv()
.map { row ->
def path = file("${row[0]}")
return path
}
.into { file_list; file_list2 }
file_list2.subscribe { println "[file_list2] ${it}" }
methods = ['muscle', 'mafft', 'clustalo', 'all']
process listAlign {
input:
file seq from file_list
each mode from methods
output:
file "*.aln" into listeAln, listeAln2, listeAln3, listeAln4, listeAln5
stdout out_list
script:
print "${seq}" > out_list
if( mode == 'muscle' || mode == 'mafft' || mode == 'clustalo' || mode == 'all' ){
template "list_command.sh"
}else
error "Invalid alignment mode: ${mode}"
}
--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Nextflow" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nextflow/cFzr30GkrGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nextflow+u...@googlegroups.com.