This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SnpSift: Annotate vcf file using GNOMAD

Hi,

I am trying to annotate my vcf file (my.vcf.gz) with gnomad using SnpEff/SnpSift. I downloaded gnomad (3.1.1) as given in the instructions GNOMAD download

I now want to annotate my vcf.gz file, containing variants from all chromosomes, with this data. The SnpSift example page SnpSift gives the example:

java -jar SnpSift.jar annotate dbSnp132.vcf variants.vcf > variants_annotated.vcf

However, the vcf file downloaded from gnomad is not a single file, but one file for each chromosome. For example:

gnomad.genomes.v3.1.1.sites.chr10.vcf.bgz.tbi gnomad.genomes.v3.1.1.sites.chr19.vcf.bgz.tbi gnomad.genomes.v3.1.1.sites.chr5.vcf.bgz.tbi

What command do I need so that it uses all the vcfs in the downloaded gnomad directory?

Thanks for your help!

gnomad snpeff snpsift

What command do I need so that it uses all the vcfs in the downloaded gnomad directory?

run a loop per chromosome in your vcf and then concatenate each resulting vcf/chromosome

1 answer

Hi,

I use a loop for that. Something like this to inspire you:

# Enter folder where gnomAD data are here:

gnomAD="/path/to/gnomAD/database/release/3.1.2/gnomad.genomes.v3.1.2.sites."

# Enter the folder where your results are and will be annotated further

cd /path/to/your/results/folder/

# Enter the name of the final results' file from SnpSift

ann="results.ann.gnomAD.genomes.v3.1.2.vcf"

# The loop (to annotate with some fields from the INFO column for example)

for i in {1..22};
do
java -jar SnpSift.jar annotate -info AF,AF_nfe,popmax,AF_popmax ${gnomAD}chr${i}.vcf.bgz temp > temp1
mv temp1 temp
done


java -jar SnpSift.jar annotate -info AF,AF_nfe,popmax,AF_popmax ${gnomAD}chrX.vcf.bgz temp > temp1
mv temp1 temp

java -jar SnpSift.jar annotate -info AF,AF_nfe,popmax,AF_popmax ${gnomAD}chrY.vcf.bgz temp > temp1
mv temp1 temp

mv temp $ann

Hope that helps

Best

/Nawar

Log in to answer this question.