Biostar Beta. Not for public use.
Calculate the allele frequency of specific sub-population using VEP
0
Entering edit mode
14 months ago
Karachi, PK

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.

ADD COMMENTlink
1
Entering edit mode
14 months ago
EMBL-EBI

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
1
Entering edit mode

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

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3