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

record.FILTER vs. record.FILTERS #309

Open
jaime11 opened this issue Aug 1, 2024 · 1 comment
Open

record.FILTER vs. record.FILTERS #309

jaime11 opened this issue Aug 1, 2024 · 1 comment

Comments

@jaime11
Copy link

jaime11 commented Aug 1, 2024

Hello:

I am using this library to read a VCF file that has been filtered (GATK Mutect2 + FilterMutectCalls) such as:

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT LH00280_109_22KKWNLT3_3_GAGTTACC LH00280_109_22KKWNLT3_3_GTGCTATG
chr1 610724 . T C . germline;map_qual;weak_evidence AS_FilterStatus=weak_evidence,map_qual;AS_SB_TABLE=3,2|1,1;DP=7;ECNT=1;GERMQ=1;MBQ=20,20;MFRL=204,173;MMQ=52,27;MPOS=18;NALOD=0.477;NLOD=0.601;POPAF=2.13;ROQ=14;TLOD=4.17 GT:AD:AF:DP:F1R2:F2R1:FAD:SB 0/0:4,0:0.250:4:1,0:0,0:2,0:2,2,0,0 0/1:1,2:0.500:3:1,1:0,0:1,1:1,0,1,1
chr1 27006684 . C T . PASS AS_FilterStatus=SITE;AS_SB_TABLE=114,107|3,2;DP=233;ECNT=1;GERMQ=93;MBQ=20,20;MFRL=209,166;MMQ=60,60;MPOS=25;NALOD=1.91;NLOD=24.03;POPAF=6.00;ROQ=22;TLOD=7.14 GT:AD:AF:DP:F1R2:F2R1:FAD:SB 0/0:105,0:0.012:105:36,0:36,0:80,0:58,47,0,0 0/1:116,5:0.047:121:44,1:33,2:80,3:56,60,3,2

In the FILTER column, the file can contain either a list of filters, such as in the first variant (bold) or PASS as in the second.

When I iterate the variants:

vcf = VCF(vcf_file, threads = THREADS)
writer = Writer(output_vcf, vcf)

for record in vcf:

In variants where I have a list of filters, FILTER just contains the ";" separated string and FILTERS contains the list of elements corresponding to that list, however when there is "PASS" in the filter, record.FILTER is None but record.FILTERS is ["PASS"]

Shouldn't the second case have the string "PASS" in record.FILTER?

Thank you.

@brentp
Copy link
Owner

brentp commented Aug 1, 2024

hi, there are other issues on this. It's basically a design mistake that I made when starting out and now am hesitant to change for backward compatibility. If record.FILTER is "PASS", then cyvcf2 thinks there's no FILTER and so returns None.

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

2 participants