Convert association data from gwas catalog to vcf format
1
1
Entering edit mode
5.4 years ago
hsiaoyi0504 ▴ 70

Hi there, I have a tsv file from GWAS-Catalog like this one in tsv format: ftp://ftp.ebi.ac.uk/pub/databases/gwas/releases/2018/11/05/gwas-catalog-associations_ontology-annotated.tsv

However, for many annotation tools, they require input data as vcf format. Therefore, I would like to convert those SNPs into vcf format. Is there any tools I can use to directly do that ?

gwas vcf gwas-catalog SNP • 2.2k views
ADD COMMENT
2
Entering edit mode
5.4 years ago

use awk to generate a header and create the VCF field. Here is a basic script.

 wget -q -O - "ftp://ftp.ebi.ac.uk/pub/databases/gwas/releases/2018/11/05/gwas-catalog-associations_ontology-annotated.tsv" | awk -F '     ' 'BEGIN{printf("##fileformat=VCFv4.2\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n");}/^DATE ADDED/{next}{printf("%s\t%s\t%s\tN\t.\t.\t.\t.\n",$12,$13,$37);}'

##fileformat=VCFv4.2
#CHROM  POS ID  REF ALT QUAL    FILTER  INFO
6   32251212    GCST001156  N   .   .   .   .
6   32441753    GCST001156  N   .   .   .   .
6   33075103    GCST001156  N   .   .   .   .
6   32623148    GCST001156  N   .   .   .   .
6   31039078    GCST001181  N   .   .   .   .
6   31125810    GCST001181  N   .   .   .   .
6   31168676    GCST001181  N   .   .   .   .
6   31440051    GCST001181  N   .   .   .   .
ADD COMMENT

Login before adding your answer.

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