how do I enable nextflow to read scripts in bin folder? #4651
-
Hi there, I've a python script in a process test {
maxForks 3
debug true
errorStrategy 'retry'
maxRetries 2
publishDir path: "/data1/users/sanjeev/nextflow/learn_nextflow/", mode: 'copy'
output:
stdout
script:
"""
echo "hello"
python2 parse_cnvs_V2.py
"""
}
workflow {
test()
}
nextflow run test.nf I get error as:
How do I have nextflow pick script from the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You have to add a shebang ( """
echo "hello"
parse_cnvs_V2.py
""" |
Beta Was this translation helpful? Give feedback.
-
ah, wonderful. Thank you for your reply. It worked. |
Beta Was this translation helpful? Give feedback.
-
Hello, process select_contig{
debug true
publishDir params.outdir, mode: 'copy'
input:
path filtring_polish_fasta
output:
path '*_contig.fasta'
script:
"""
python3 $projectDir/select_contigs.py -input_file $filtring_polish_fasta -output_file "$filtring_polish_fasta.baseName"_contig.fasta""
"""
}
process multifasta_to_fasta{
debug true
publishDir params.outdir, mode: 'copy'
input:
path filtring_polish_fasta
output:
path 'mashtree_ref'
script:
"""
python3 $projectDir/multifasta_to_fasta.py -input_file "$filtring_polish_fasta.baseName."fasta"" -output_dir "mashtree_ref"
"""
}
Workflow{
select_contig(filtring_polish)
multifasta_to_fasta(select_contig.out)
} Terminal:
|
Beta Was this translation helpful? Give feedback.
You have to add a shebang (
#!/user/bin/env python2
) to the first line of your python script, make it executable, and execute it directly in your process: