Replace missing SNPs of one individual with reference alleles in a VCF file
0
1
Entering edit mode
5.5 years ago

Hello,

I have a vcf file of about 565 individuals. I want to replace the missing SNPs of one of them (Ancient sample) with the reference alleles.

I was thinking about trying out the following-

$ bcftools +fixploidy phasedVCF-short02.vcf.gz -- -f 2|bcftools +missing2ref - -- -p > phasedVCF-short03.vcf

But it will probably replace the missing sites in all the individuals.

I am bit confused if there is any function in vcftools or bcftools which would specify to do this operation in only one individual instead of all.

SNP bcftools VCFtools sequencing • 1.6k views
ADD COMMENT
1
Entering edit mode

Does it make sense to fix it for just one sample?

ADD REPLY
0
Entering edit mode

Good question, I am not so sure. Let me find out how the PCA comes out.

Meanwhile, I have figured out a possible way to do it. I converted my ld-pruned bed, bim and fam file to vcf file in plink. It only has the genotypes without the quality parameters. Probably it would be much easier to convert the "./." to "0/0" using awk for my target sample.

ADD REPLY
0
Entering edit mode

The reason to do so because of that sample being an ancient individual had many missing genotypes, thereby messing up my final pca output.

ADD REPLY

Login before adding your answer.

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