Hi,
I would like to run a simple bash script I created and dockerised it. But when I want to run it via Nextflow, it throw me an error.
Could you help me please ?
Thank you
Dockerfile:
FROM ubuntu:kinetic-20220602
WORKDIR /scripts
COPY neisseria_typing.sh .
Nextflow code:
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
process fetchProfile {
echo true
input:
path(sequence)
"""
./neisseria_typing.sh ${sequence}
"""
}
workflow {
input_ch = Channel.fromPath(params.input)
fetchProfile(input_ch)
}
nextflow.config:
params.input = "sequence.fasta"
docker.enabled = true
docker.runOptions = '-u $(id -u):$(id -g)'
process {
withName: fetchProfile {
container = 'myDocker/genomics_scripts:v1.0'
}
}
Error:
Command error:
.command.sh: line 2: ./neisseria_typing.sh: No such file or directory
Thank you guys. You are right, I don't see how Nextflow could get the scripts. I created images with, trimmomatic and skesa for instance, and it did work well so I assumed it will be the same with simple scripts that I wrote. Clearly I misunderstood how Nextflow works with Docker, I need to get back to docs :)
Thank you very much for your help
No worries. The beauty of Nextflow is that it exactly takes that burden from you. You just provide the code outside of any container and Nextflow then takes care of all the mounting and copying/staging. If you put the actual code on GitHub you have the full package, so code version control via GitHub, automatized processing by Nextflow and software-wise reproducibility via the container. Nextflow can directly pull repository code from GitHub, so essentially you could launch a pipeline without even copying the code manually once it is in a GitHub repo.
Very nice! Thanks for the explanations