Skip to content

Commit e4429e9

Browse files
committed
refactor: require FASTA index as input for all-sites VCF
build: update bcftools version for all-sites VCF
1 parent fb50bc6 commit e4429e9

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

workflow/envs/var_calling.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ channels:
44
dependencies:
55
- ivar==1.4.2
66
- samtools==1.17
7-
- bcftools==1.17

workflow/rules/fasta.smk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ rule read_bam_refs:
1717
"""
1818

1919

20+
rule index_fasta:
21+
conda:
22+
"../envs/tools.yaml"
23+
input:
24+
fasta="{name}.fasta",
25+
output:
26+
fai=temp("{name}.fasta.fai"),
27+
sizes=temp("{name}.sizes.txt"),
28+
shell:
29+
"samtools faidx {input.fasta} -o {output.fai} && cut -f1,2 {output.fai} >{output.sizes}"
30+
31+
2032
rule rename_fastas:
2133
input:
2234
fasta = get_input_fasta

workflow/rules/sites.smk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ rule problematic_vcf_to_bed:
1818

1919
rule bcftools_mpileup_all_sites:
2020
threads: 1
21-
conda: "../envs/var_calling.yaml"
21+
conda: "../envs/tools.yaml"
2222
params:
2323
min_mq = 0,
2424
min_bq = config["VC"]["MIN_QUALITY"],
2525
mpileup_extra = "--no-BAQ"
2626
input:
2727
bam = get_input_bam,
2828
reference = OUTDIR/"vaf"/"{sample}.reference.fasta",
29+
reference_index = OUTDIR/"vaf"/"{sample}.reference.fasta.fai",
2930
output:
3031
mpileup = temp(OUTDIR / "all_sites" / "{sample}.mpileup.vcf"),
3132
query = temp(OUTDIR / "all_sites" / "{sample}.query.tsv"),

0 commit comments

Comments
 (0)