File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -22,27 +22,25 @@ rule demix_update:
2222
2323rule demix_preprocessing :
2424 threads : 1
25- conda : "../envs/freyja .yaml"
25+ conda : "../envs/var_calling .yaml"
2626 shadow : "minimal"
2727 input :
2828 bam = get_input_bam ,
2929 ref_fasta = lambda wildcards : select_mapping_references_fasta ()
3030 params :
31- minq = config ["DEMIX" ]["MIN_QUALITY" ]
31+ minq = config ["DEMIX" ]["MIN_QUALITY" ],
3232 output :
3333 depth_file = OUTDIR / "demixing" / "{sample}/{sample}_depth.txt" ,
34- variants_file = OUTDIR / "demixing" / "{sample}/{sample}_variants.tsv"
34+ variants_file = OUTDIR / "demixing" / "{sample}/{sample}_variants.tsv" ,
3535 log :
36- LOGDIR / "demix_preprocessing" / "{sample}.log.txt"
36+ pileup = LOGDIR / "demix_preprocessing" / "{sample}_pileup.log.txt" ,
37+ ivar = LOGDIR / "demix_preprocessing" / "{sample}_ivar.log.txt" ,
3738 shell :
38- """
39- freyja variants \
40- "{input.bam}" \
41- --variants {output.variants_file} \
42- --depths {output.depth_file} \
43- --minq {params.minq} \
44- --ref {input.ref_fasta} >{log} 2>&1
45- """
39+ "set -euo pipefail && "
40+ "samtools mpileup -aa -A -d 600000 -Q {params.minq} -q 0 -B -f {input.ref_fasta:q} {input.bam:q} >sample.pileup 2>{log.pileup:q} && "
41+ "ivar variants -p variants -q {params.minq} -r {input.ref_fasta:q} >{log.ivar:q} 2>&1 <sample.pileup && "
42+ "cut -f1-4 sample.pileup >{output.depth_file:q} && "
43+ "mv variants.tsv {output.variants_file:q}"
4644
4745
4846rule demix :
You can’t perform that action at this time.
0 commit comments