Question: Calculate the allele frequency of specific sub-population using VEP
0
gravatar for Abdul Rafay Khan
6 months ago by
Karachi, PK
Abdul Rafay Khan1.1k wrote:

I have more than 800 snps with rs ids, i want to calculate the allele frequency of these snps in British (GBR) population from 1000 Genomes Project. The thing is that i can calculate the allele frequencies of super population like European (EUR) using VEP script but unable to find the way to calculate the allele frequency of specific population like British (GBR) population.

vep allele frequency • 301 views
ADD COMMENTlink modified 6 months ago by Emily_Ensembl19k • written 6 months ago by Abdul Rafay Khan1.1k
1
gravatar for Emily_Ensembl
6 months ago by
Emily_Ensembl19k
EMBL-EBI
Emily_Ensembl19k wrote:

Unfortunately VEP doesn't give the sub-population frequencies, only the super-populations. To get the sub-populations, you will need to use the Ensembl REST API. I would recommend using the variation_post endpoint, although you will need to split your variant list into 200 variant chunks. You can then parse the GBR frequency out of the JSON. If you're not already familiar with using REST APIs and parsing JSON, we've got an online course.

ADD COMMENTlink written 6 months ago by Emily_Ensembl19k
1

Thank you, got the answer

Installation of Ensembl Rest API on R:

Install latest Rtools in base R from: https://cran.r-project.org/bin/windows/Rtools/

install.packages("githubinstall")
library(githubinstall)
library(devtools)
devtools::install_github("timyates/EnsemblRest")
library(EnsemblRest)

R code for Ensembl Rest API:

library(httr)
library(jsonlite)
library(xml2)

server <- "https://rest.ensembl.org"
ext <- "/variation/human/rs56116432?pops=1"

r <- GET(paste(server, ext, sep = ""), content_type("application/json"))

stop_for_status(r)

# use this if you get a simple nested list back, otherwise inspect its structure
# head(data.frame(t(sapply(content(r),c))))
head(fromJSON(toJSON(content(r))))
ADD REPLYlink written 6 months ago by Abdul Rafay Khan1.1k
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: 1768 users visited in the last hour