VCF modifications before plink analysis
1
0
Entering edit mode
5.1 years ago
hrora • 0

Hi everyone, I am adding new vcf files to a previously made bcf file in which the ID field in the VCF had been set to CHR:POS:POS:REF:ALT ? How do I set the ID field in the VCF to CHR:POS:POS:REF:ALT ?

Thanks

vcf • 900 views
ADD COMMENT
0
Entering edit mode
5.1 years ago

Hey hrora,

You can set the VCF ID field to CHR:POS:POS:REF:ALT with:

bcftools annotate -Ob -x 'ID' -I +'%CHROM:%POS:%POS:%REF:%ALT' MyVCF.vcf > out.bcf ;

To output VCF, use -Ov, not -Ob.

May I also recommend that you normalise your VCF by splitting multi-alleles into separate records and also left-aligning indels with the following piped commands:

bcftools norm -m-any MyVCF.vcf | \
bcftools norm --check-ref w -f human_g1k_v37.fasta | \
bcftools annotate -Ob -x 'ID' -I +'%CHROM:%POS:%POS:%REF:%ALT' > out.bcf ;

The middle command requires a reference genome - this is for left-aligning indels. If it's not needed, then simply remove that middle command.

Kevin

ADD COMMENT

Login before adding your answer.

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