Closed mw55309 closed 2 years ago
You can use a workaround by running it with a different folder and moving it to the right spot at the end. I have found it here. Looks very ugly, but works.
shell:
"""
mkdir assemblies/{wildcards.sample}
touch assemblies/{wildcards.sample}/final.contigs.fa
megahit {params} -o assemblies/tmp
rm -r assemblies/{wildcards.sample}
mv assemblies/tmp assemblies/{wildcards.sample}
"""
In fact --force
or -f
exist. I did not realize that it is missing from the helping message...
Hello
As we all know, megahit will fail if the directory given to -o exists.
This can be overcome by using --continue, but this still fails if options.json is missing
Here's the thing. We use megahit within Snakemake, and in Snakemake you tell it what the output directory is, and Snakemake creates that directory before running megahit
The result is that megahit then doesn't run because the output directory is empty
I also cannot use --continue because the empty directory doesn't contain options.json
What would be really good would be a --force option which just makes megahit run no matter what, and clobber the output even if there is something already there
Cheers Mick