|
1 | 1 | import logging |
2 | 2 | import os |
3 | 3 |
|
4 | | -from clockwork import cortex, read_map, read_trim, reference_dir, utils |
| 4 | +from clockwork import cortex, gvcf, read_map, read_trim, reference_dir, utils |
5 | 5 |
|
6 | 6 |
|
7 | 7 | def run( |
@@ -77,7 +77,20 @@ def run( |
77 | 77 | minos_dir = os.path.join(outdir, "minos") |
78 | 78 | cmd = f"minos adjudicate --reads {rmdup_bam} {minos_dir} {refdir.ref_fasta} {samtools_vcf} {cortex_vcf}" |
79 | 79 | utils.syscall(cmd) |
80 | | - os.rename(os.path.join(minos_dir, "final.vcf"), os.path.join(outdir, "final.vcf")) |
| 80 | + final_vcf = os.path.join(outdir, "final.vcf") |
| 81 | + os.rename(os.path.join(minos_dir, "final.vcf"), final_vcf) |
| 82 | + |
| 83 | + samtools_gvcf = os.path.join(outdir, "samtools.gvcf") |
| 84 | + cmd = f"bcftools mpileup -I --output-type u -f {refdir.ref_fasta} {rmdup_bam} | bcftools call -c -O v -o {samtools_gvcf}" |
| 85 | + utils.syscall(cmd) |
| 86 | + final_gvcf = os.path.join(outdir, "final.gvcf") |
| 87 | + gvcf.gvcf_from_minos_vcf_and_samtools_gvcf( |
| 88 | + refdir.ref_fasta, final_vcf, samtools_gvcf, final_gvcf, |
| 89 | + ) |
| 90 | + if not debug: |
| 91 | + os.unlink(samtools_gvcf) |
| 92 | + gvcf.gvcf_to_fasta(final_gvcf, f"{final_gvcf}.fasta") |
| 93 | + |
81 | 94 | if not debug: |
82 | 95 | utils.syscall(f"rm -rf {minos_dir}") |
83 | 96 |
|
|
0 commit comments