Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter records by presence/absence of GT field? #2361

Open
rajwanir opened this issue Jan 28, 2025 · 0 comments
Open

Filter records by presence/absence of GT field? #2361

rajwanir opened this issue Jan 28, 2025 · 0 comments

Comments

@rajwanir
Copy link

Hi @pd3

Is there a way to filter out records that do not have GT set altogether (not missing GT)? For example, remove a record like below with GT unset:

chr1 13853 cnvi0081369 C . . PASS GC=0.5675;ALLELE_A=-1;ALLELE_B=-1;FRAC_A=0.254902;FRAC_C=0.166667;FRAC_G=0.343137;FRAC_T=0.235294;NORM_ID=0;BEADSET_ID=124;INTENSITY_ONLY;ASSAY_TYPE=0 BAF:LRR:NORMX:NORMY:R:THETA:X:Y 0:-0.493254:0.737172:0.0338293:0.771002:0.0291944:11958:1161

from a BCF that contains most records like below:

chr1 629731 MitoT4562C T C . PASS GC=0.425;ALLELE_A=0;ALLELE_B=1;FRAC_A=0.270492;FRAC_C=0.139344;FRAC_G=0.278689;FRAC_T=0.311475;NORM_ID=5;BEADSET_ID=56;ASSAY_TYPE=0;AC=0;AN=2 GT:GQ:IGC:BAF:LRR:NORMX:NORMY:R:THETA:X:Y 0/0:2:0.381889:0:-0.249051:3.92626:0.30878:4.23504:0.0499641:48920:6639

I think it would be query to simply check FORMAT/GT tag is present but couldn't write the correct expression. I came across an older issue where it seems like it may not be feasible with standard bcftools supported expressions (#1028).

Is this feasible?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant