Hi, I am trying to filtering a vcf file by --minDP however the log file indicates that it is not filtering out any SNP, any clue about this problem? I tried different values for DP but is not working any of them (I do have DP information in my vcf file)
you should try --min-meanDP instead of --minDP if you didn't solve that problem.
I'm also wondering why vcftools write some argument making user a little bit confusing.
I have a script that can do what you need.
#! python
import sys
import os
import vcf
vcf_reader = vcf.Reader(open("file.vcf", 'r'))
vcf_writer = vcf.Writer(open('out.vcf', 'w'), vcf_reader)
for record in vcf_reader:
if record.INFO['DP']>100:
vcf_writer.write_record(record)
Hope it helps,
Best,
Agata
You need to install PyVCF module for example from here https://pypi.python.org/pypi/PyVCF
Make sure that it is compatible with your python version!
Best,
Agata
you should try --min-meanDP instead of --minDP if you didn't solve that problem. I'm also wondering why vcftools write some argument making user a little bit confusing.
Like --min-meanDP & --minDP or --minQ and --minGQ