Question: add gene name from bed file to vcf in vcftools
0
gravatar for bioguy24
3.6 years ago by
bioguy24190
Chicago
bioguy24190 wrote:

I am trying to add gene information to a vcf file using vcftools:

vcftools annotate \
  -a genes.bed.gz \
  -c CHROM,FROM,TO,GENE \
  -h <(echo '##INFO=<ID=GENE,Number=1,Type=String,Description="Gene name">') \
  TSVC_001.vcf.gz

genes.bed.gz is compressed using bzip, sorted, and indexed by tabix

for f in /home/cmccabe/Desktop/tabix/*.bed ; do
    bname=$(basename $f)
    vcf-sort $f | bgzip -c > $f.gz ; tabix -p bed $f.gz
done

genes.bed.gz

chr1    955543  955763  AGRN
chr1    957571  957852  AGRN
chr1    970621  970740  AGRN

The vcftools command runs but I do not see that the vcf.gz was updated with the gene information from the bed file. At a later time I want to use those gene names to filter the vcf. Thank you .

vcftools • 1.4k views
ADD COMMENTlink modified 13 months ago by RamRS24k • written 3.6 years ago by bioguy24190
1

Just for clarification, what is bash for loop doing here? If you have only one bed file, why to use a loop? And why are you using vcf-sort on a bed file? According to manual indexing should be done in some other way. Check this

ADD REPLYlink modified 13 months ago by RamRS24k • written 3.6 years ago by venu6.3k

Since I will eventually have multiple bed files I use a loop, but will start with one at a time.  Thank you for the link:).

ADD REPLYlink modified 13 months ago by RamRS24k • written 3.6 years ago by bioguy24190
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1693 users visited in the last hour