Unable to convert Uniprot ID to Gene IDs using Biomart
1
0
Entering edit mode
@rohitsatyam102-24390
Last seen 2 days ago
India

Hi Everyone!!

I was trying to convert the Plasmodium Uniprot IDs to Gene Symbols (or Gene IDs) but my Converted object is coming empty. What am I doing wrong? Is there an alternative??

Below given is a code to reproduce the behaviour


# From STRING
url <- "https://stringdb-static.org/download/protein.links.v11.5/36329.protein.links.v11.5.txt.gz"
path2file <- file.path(tempdir(check = TRUE), "STRING.txt.gz")
download.file(url, path2file)
pfa_string_df <- read.table(path2file, header = TRUE)
## filter using combined_score cut-off value of 800
pfa_string_df <- pfa_string_df[pfa_string_df$combined_score >= 800, ]

## fix ids
pfa_string_pin <- data.frame(Interactor_A = sub("^36329\\.", "", pfa_string_df$protein1),
                             Interactor_B = sub("^36329\\.", "", pfa_string_df$protein2))
##
library(biomaRt)
all <- biomaRt::listDatasets(biomaRt::useMart( biomart="protists_mart", host="https://protists.ensembl.org"))
pfa_ensembl <- useMart(biomart="protists_mart", host="https://protists.ensembl.org",dataset = "pfalciparum_eg_gene")
temp <- listAttributes(pfa_ensembl)
converted <- getBM(attributes = c("uniprotsptrembl", "external_gene_name"),
                   filters = "uniprotsptrembl",
                   values = unique(unlist(pfa_string_pin)),
                   mart = db)
biomaRt • 212 views
ADD COMMENT
3
Entering edit mode
Mike Smith ★ 5.7k
@mike-smith
Last seen 2 hours ago
EMBL Heidelberg / de.NBI

I'm not sure you want the external_gene_name attribute. Perhaps try ensembl_gene_id instead e.g.

library(biomaRt)
pfa_ensembl <- useEnsemblGenomes(biomart = "protists_mart", dataset = "pfalciparum_eg_gene")

example_uniprot_ids <- c("C0H4X1", "C0H5C7")
converted <- getBM(attributes = c("uniprotsptrembl", "ensembl_gene_id"),
                   filters = "uniprotsptrembl",
                   values = example_uniprot_ids,
                   mart = pfa_ensembl)

converted
#>   uniprotsptrembl ensembl_gene_id
#> 1          C0H4X1   PF3D7_0822800
#> 2          C0H5C7   PF3D7_1320900
ADD COMMENT
0
Entering edit mode

Thanks, it worked like charm!!

ADD REPLY

Login before adding your answer.

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