Setting genotypes to missing for certain positions in vcf file
1
0
Entering edit mode
3.1 years ago
jtull • 0

Hi,

Is there a way to set genotypes to missing for a list of positions using vcftools? Thanks!

Best,

vcf vcftools • 2.2k views
ADD COMMENT
0
Entering edit mode
3.1 years ago

bcftools plugin setGT : https://samtools.github.io/bcftools/howtos/plugins.html

Sets genotypes according to the specified criteria and filtering expressions. For example, missing genotypes can be set to ref, but much more than that.

ADD COMMENT
0
Entering edit mode

Thanks for your answer, however, these solutions all seem to rely on the info in other columns. What I want to do is to set certain genotypes to missing based solely on their position because I have a list positions (that I created using info that isn't in the other columns).

ADD REPLY
0
Entering edit mode

So, for instance, I have a file called X.pos that includes positions to be set to missing, it looks like below: head X.pos: 18863 34659 47022 61505 ... (each pos is a separate line)

In this link http://samtools.github.io/bcftools/bcftools.html, I saw that ID=@file selects the lines with ID present in the file and with similar logic I tried the following to filter the positions in the file:

bcftools filter -e 'POS=@X.pos' my.vcf.gz

It is just to see if I can filter the vcf to only include the positions in the file but no luck so far. I know the number of positions in X.pos and the output generated is far larger, so I am making a mistake somewhere. maybe the X.pos format is wrong? Any idea?

If It it worked, I was going to try setGT.

ADD REPLY
1
Entering edit mode

split the vcf in two regions , fix the genotypes of one vcf, merge both vcfs.

ADD REPLY
0
Entering edit mode

Solved it with python, thanks!

ADD REPLY

Login before adding your answer.

Traffic: 2369 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