query summary functions

Open
#724 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start with the bcftools query command and compare its format handling with the expressions functionality. Reproduce the supplied FORMAT/AD examples on the multisample VCF, then determine the expected arithmetic and sum behavior; the work is done when the requested VAF calculations can be expressed and return the intended results directly from query.

Written by the indexing model from the issue text.

Description

D1: Difficult enhancement P3: Low priority

I'm trying to extract some variant allele fraction statistics from multisample vcf n~300. I'm getting these through extracting the the REF and ALT allele counts from the FORMAT tag AD and then doing the calculations outside of bcftools. To avoid this it would be helpful if one could apply similar arithmetic operators and summary functions in the query command as in the expressions

bcftools query -f '[\t%AD{1}/(%AD{1}+%AD{0})]\n' tmp.vcf
bcftools query -f 'sum(%AD{1})/(sum(%AD{0})+sum(%AD{1}))' tmp.vcf

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.