Skip to content

Commit c5d5ba1

Browse files
committed
Revert alignstats to CRAM-only input per user direction
1 parent 6d7d844 commit c5d5ba1

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

workflow/rules/alignstats.smk

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,10 @@ import os
1313
def fetch_alnr(wildcards):
1414
return wildcards.alnr
1515

16-
17-
def _alignstats_input(wildcards):
18-
"""Return alignment file + index, choosing BAM for BAM_ALIGNERS else CRAM."""
19-
base = MDIR + f"{wildcards.sample}/align/{wildcards.alnr}/{wildcards.ddup}/{wildcards.sample}.{wildcards.alnr}.{wildcards.ddup}"
20-
if wildcards.alnr in BAM_ALIGNERS:
21-
return {"aln": base + ".bam", "idx": base + ".bam.bai"}
22-
return {"aln": base + ".cram", "idx": base + ".cram.crai"}
23-
24-
25-
def _alignstats_format(wildcards):
26-
"""Return 'bam' or 'cram' for the alignstats -j flag."""
27-
return "bam" if wildcards.alnr in BAM_ALIGNERS else "cram"
28-
29-
3016
rule alignstats:
3117
input:
32-
unpack(_alignstats_input),
18+
cram=MDIR + "{sample}/align/{alnr}/{ddup}/{sample}.{alnr}.{ddup}.cram",
19+
crai=MDIR + "{sample}/align/{alnr}/{ddup}/{sample}.{alnr}.{ddup}.cram.crai",
3320
output:
3421
json=MDIR
3522
+ "{sample}/align/{alnr}/{ddup}/alignqc/alignstats/{sample}.{alnr}.{ddup}.alignstats.json",
@@ -47,7 +34,6 @@ rule alignstats:
4734
huref=config["supporting_files"]["files"]["huref"]["fasta"]["name"],
4835
n=config["alignstats"]["num_reads_in_mem"],
4936
cluster_sample=ret_sample,
50-
aln_format=_alignstats_format,
5137
ld_preload=" "
5238
if "ld_preload" not in config["malloc_alt"]
5339
else config["malloc_alt"]["ld_preload"],
@@ -56,7 +42,7 @@ rule alignstats:
5642
conda:
5743
config["alignstats"]["env_yaml"]
5844
shell:
59-
"alignstats -C -U -i {input.aln} -T {params.huref} -o {output.json} -j {params.aln_format} -v -P {threads} -p {threads} > {log};"
45+
"alignstats -C -U -i {input.cram} -T {params.huref} -o {output.json} -j cram -v -P {threads} -p {threads} > {log};"
6046

6147

6248
localrules:

0 commit comments

Comments
 (0)