Question: Iterate with getBM(bioMart package) for GO annotation
0
newscient • 20 wrote:
I am trying to use the getBM function for a list of dataframes(or datasets if you prefer) (genes2peaks) and use only a list of gene_ids from there and get the GO annotations for each dataset seperately in a new list, but i get only annotations for the final dataset in my list!
I also retrieve the correct dataset argument for the useMart function from a list i have made (samples.annotationsnew$biomart)!
Can somebody identify any the problem in that iteration?
library(biomaRt) GOannotations<-list() for (i in nrow(samples.annotationsnew)){ mart <- useMart(biomart = "ensembl", dataset = samples.annotationsnew$biomart[i]) values <- genes2peaks[[i]]$feature GOannotations[[i]] <- getBM(attributes = c("ensembl_gene_id", "go_id","name_1006"), filters = "ensembl_gene_id",values = values, mart = mart) }
Thanks in advance!
ADD COMMENT
• link
•
modified 5.9 years ago
by
Devon Ryan ♦ 98k
•
written
5.9 years ago by
newscient • 20