snakemake-wrappers icon indicating copy to clipboard operation
snakemake-wrappers copied to clipboard

bwa-mem2 incorrect index

Open lczech opened this issue 3 years ago • 6 comments

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.

lczech avatar Jul 13 '22 22:07 lczech

@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).

christopher-schroeder avatar Jul 18 '22 22:07 christopher-schroeder

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.

christopher-schroeder avatar Jul 19 '22 05:07 christopher-schroeder

I agree, all input files needed by the rule should be explicitely specified.

fgvieira avatar Jul 19 '22 08:07 fgvieira

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...

dlaehnemann avatar Jul 19 '22 12:07 dlaehnemann

This issue was marked as stale because it has been open for 6 months with no activity.

github-actions[bot] avatar Nov 01 '23 01:11 github-actions[bot]

Bump to remove stale label.

lczech avatar Nov 01 '23 04:11 lczech