Incorrect interpretation of fixed ALT homozygotes from bcftools filter?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- shell
- Domain
- bioinformatics, cli
Research direction
Start by reproducing the two pipelines in the issue, including creation of sample_list.txt, and compare the VCF streams before and after bcftools view. Check how AF is interpreted by bcftools filter in each case and verify the reported sites against the 1/1 genotypes. Done means explaining the discrepancy and establishing a reliable way to count fixed ALT homozygotes.
Written by the indexing model from the issue text.
Description
Hi all,
Not completely sure if this is an issue, if it is the expected function for the two bcftools commands (filter and view) or if I am misunderstanding something.
I want to get the number of sites that are fixed ALT homozygotes and to do that I used
bcftools filter -i 'AF=1' my_species.vcf | grep -v "^#" | wc -l which returns 0.
If I use bcftools view first to "subsample" using a list of all my samples as such:
bcftools query -l my_species.vcf > sample_list.txt ; bcftools view -S sample_list.txt my_species.vcf | bcftools filter -i 'AF=1' - | grep -v "^#" | wc -l it returns 8, while essentially I am running the same command.
Why does that happen? This number seems to be right, in the sense that the samples are all homozygous for ALT (1/1) but I am not sure if there are other sites missing from the final number. In the vcf I have kept biallelic snps and monomorphic sites. Some genotypes are missing but if I filter for missingness (say F_MISSINGNESS < 0.6) the result remains the same. Do you have any other suggestion on how to do this?
Thanks for your help!
- Dominant language
- C
- Stars
- 891
- Forks
- 277
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samtools/bcftools
-
needs-feedback
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
htslib-dependent P2: Desirable
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
needs-feedback requires-test-case
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in samtools/bcftools
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100