Variant calling analysis
0
0
Entering edit mode
18 months ago
namck • 0

I am trying to filter a VCF file so that the filtered file has a VAF of less than 50% and a depth of at least 200 for variant supporting bases. The output VCF file should be sorted by chromosome and should retain the VCF header, so that it can be used as input for other tools that accept VCF files.

So far, I have tried running this code using Pandas library, but that only resulted in an empty dataframe.

Could you please let me know what I am doing wrong?

Thank you so much!

I am also attaching the format of my VCF file here.

My input file is in this format

My code snippet

vcf variant-calling wgs • 849 views
ADD COMMENT
1
Entering edit mode

Did you try bcftools view ?

E.g.,

bcftools view -i 'INFO/AF < 0.5 & FORMAT/DP >= 200' input.vcf > filtered.vcf

Or, use SnpEff

java -jar snpEff/SnpSift.jar filter "(AF < 0.5) & (DP >= 200)" input.vcf > filtered.vcf

Note: This is just an example I did not test the command myself.

ADD REPLY
0
Entering edit mode

There must be tools which would do the job easily, but I was just wondering if I could do that using Python.

ADD REPLY
0
Entering edit mode

There are already Python packages for that, as an example cyvcf2

ADD REPLY

Login before adding your answer.

Traffic: 2589 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6