Inconsistent consensus calling with -I and -s options

Open
#643 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Reproduce the report with the linked test archive using samtools 1.3 and bcftools 1.5, then run the shown bcftools consensus command. Compare positions 6 and 45: the heterozygous A/T site at position 6 should receive an ambiguous call like the C/T site at position 45, rather than only the reference allele.】【。

Written by the indexing model from the issue text.

Description

needs-feedback

Hello,

So I have been using bcftools to produce a consensus call for particular samples and possibly found a small bug.

Essentially I found when I specify -i (ambiguous calls) and -s ( apply variants of the given sample) for sites where I have a heterozygous SNP (e.g. A and T) with one allele being the same as the reference allele (A), only the reference allele is reported (A) (even if the T allele has greater coverage).

This does not happen if the two alleles differ from the reference allele (e.g. C and T). In this case bcftools consensus reports a Y (as expected).

I have made some test files to demonstrate this, along with the code to generate this.

Any help you could provide on this issue would be greatly appreciated,

Darren


Test files here

Code: (using test files above)

### samtools version 1.3
### bcftools version 1.5
samtools mpileup -uf EXP_01_test_ref.fa THE_test_aln-se.sorted.bam | bcftools call -mv -Oz -o THE_test_calls.vcf.gz
tabix THE_test_calls.vcf.gz
cat EXP_01_test_ref.fa | bcftools consensus -i -s THE_test_aln-se.sorted.bam THE_test_calls.vcf.gz  > EXP_08_cns.fa

Excerpt from the mpileup file: (can be see using samtools mpileup -f EXP_01_test_ref.fa THE_test_aln-se.sorted.bam)

test_ref 3 G 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 4 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 5 C 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 6 A 27 TTTTTTTTTTTTTT............. @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 7 G 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 8 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 9 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 10 G 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 11 G 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
...
test_ref 41 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 42 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 43 C 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 44 C 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 45 A 27 CCCCCCCCCCCCCTTTTTTTTTTTTTT @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 46 T 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@
test_ref 47 A 27 ........................... @@@@@@@@@@@@@@@@@@@@@@@@@@@

Using the code above bcftools consensus gives an A (incorrectly?) for position 6 , and a Y at position 45 (correctly).

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.