Biomart error while convertint transcript ID.
library("biomaRt")
ensembl<- useMart("ensembl", dataset="hsapiens_gene_ensembl")
value =read.csv("Refseq.txt", strip.white=TRUE)
colnames(value) = c("name")
values <- as.vector(value$name)
getBM(attributes=c("refseq_mrna", "ensembl_gene_id", "hgnc_symbol"), filters = "refseq_mrna", values = values,
mart= ensembl)
and I am getting below error .
[1] refseq_mrna ensembl_gene_id hgnc_symbol
<0 rows> (or 0-length row.names)
While its working fine if I am using something like below :
values<- c("NM_001101", "NM_001256799", "NM_000594")
getBM(attributes=c("refseq_mrna", "ensembl_gene_id", "hgnc_symbol"), filters = "refseq_mrna", values = values,
mart= ensembl)
any idea about this problem ?
• 1,832 views
•
link
1 answer
Thanks, Every one. I got the answer for this one actually my transcript was like
values<- c("NM_000350.2","NM_000016.5","NM_004924.4","NM_001106.3","NM_000022.2") and it was not maching with any of records so i just converted this into
values = c("NM_000350","NM_000016","NM_004924","NM_001106.3","NM_000022") so I removed all version information on this. Here is my complete script if some want to use that:
library("biomaRt")
library("tidyr")
ensembl<- useMart("ensembl", dataset="hsapiens_gene_ensembl")
value =read.csv("/Users/nsyed/Refseq.txt", strip.white=TRUE)
colnames(value) = c("name")
values = separate(data = value, col = name, into = c("left", "right"), sep = "\\.")
valuesleft <- as.vector(values$left)
nameTranscript <- getBM(attributes=c("refseq_mrna", "ensembl_gene_id", "hgnc_symbol"), filters = "refseq_mrna", values = valuesleft, mart= ensembl)
write.table(nameTranscript, "nameTranscript.txt", row.names = FALSE, quote= FALSE)
• 0 views
•
link
Log in to answer this question.