bwa-mem2 incorrect index
The wrapper 1.7.0 for bwa-mem2 contains the following code:
index = snakemake.input.get("index", "")
if isinstance(index, str):
index = path.splitext(snakemake.input.idx)[0]
else:
index = path.splitext(snakemake.input.idx[0])[0]
which mixes index and idx, clearly a bug.
PS: The command uses samtools sort, which would benefit from offering a temp directory.
@dlaehnemann @johanneskoester @tdayris Blame shows you as author of this snippet. I can modify / fix that, but I don't see the point having this at all. bwa mem 2 requires a list of files as index. Allowing a single string implies that the user may only provide one of the index files. It would be even cleaner if we require input.ref (fasta file) and input.index (all the index files).
I slept on it and realised that I'm going to modify the wrapper for cram output anyway. Since samtools sort needs the reference, input.ref makes sense. I am still against the "allow only one of the index files". A rule should request all the files it needs to execute its command. If we start allowing only parts of it and imply that the rest is available, this could backfire badly in the future.
I agree, all input files needed by the rule should be explicitely specified.
Absolutely agreed, that all necessary input files should be required. That was even part of the original PR that got this snippet in there, but that buggy snippet slipped through review, sorry. The only part that was adjusted to require all index files was the example Snakefile...
This issue was marked as stale because it has been open for 6 months with no activity.
Bump to remove stale label.