Skip to content

Commit 6a64fc7

Browse files
committed
fix VAF
1 parent 1995fe8 commit 6a64fc7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vcf_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ int write_var_to_vcf(var_t *vars, const struct call_var_opt_t *opt, bam_chunk_t
218218
len += snprintf(buffer + len, buf_m - len, "%d", var.AD[j]);
219219
}
220220
// VAF
221-
for (int j = 0; j < 1 + var.n_alt_allele; j++) {
221+
for (int j = 0; j < var.n_alt_allele; j++) {
222222
if (j == 0) len += snprintf(buffer + len, buf_m - len, ":");
223223
if (j > 0) len += snprintf(buffer + len, buf_m - len, ",");
224-
float vaf = (float)var.AD[j] / var.DP;
224+
float vaf = (float)var.AD[j+1] / var.DP;
225225
len += snprintf(buffer + len, buf_m - len, "%.3f", vaf);
226226
}
227227
// GQ

0 commit comments

Comments
 (0)