Entering edit mode
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)
Thanks, it worked like charm!!