I'm working with the following R code where I'm returning gene ontology terms pertinent to the biological process (BP) category:
> source("https://bioconductor.org/biocLite.R")
> biocLite("mygene")
> xli <- c('BRCA1', 'BRCA2', 'SOX2', 'MYC')
> res <- queryMany(xli, scopes='symbol', fields=c('go'), species='rat')
Finished
> unlist(unlist(res$go.BP)[names(unlist(res$go.BP)) == 'term'], use.names = F)
[1] "double-strand break repair via homologous recombination"
[2] "double-strand break repair via homologous recombination"
[3] "double-strand break repair via homologous recombination"
[4] "DNA replication"
[5] "DNA replication"
.
.
.
[378] "positive regulation of DNA biosynthetic process"
[379] "positive regulation of response to DNA damage stimulus"
[380] "positive regulation of response to DNA damage stimulus"
[381] "positive regulation of ATP biosynthetic process"
[382] "positive regulation of apoptotic signaling pathway"
Please see: Is there an R package that pulls up gene functional annotations with gene symbols as input?. But then when I try adding gene CARNS1 to xli
:
> xli <- c('BRCA1', 'BRCA2', 'SOX2', 'MYC', 'CARNS1')
> res <- queryMany(xli, scopes='symbol', fields=c('go'), species='rat')
Finished
> unlist(unlist(res$go.BP)[names(unlist(res$go.BP)) == 'term'], use.names = F)
Error in rbind(deparse.level, ...) :
numbers of columns of arguments do not match
Anyone know why this error happens? At first, I thought it was because of the scopes
argument in queryMany()
, but playing around with the parameters of http://mygene.info/doc/query_service.html#available-fields did not help clarify the issue.
Any suggestions would be appreciated.
P.S. I would also welcome suggestions and/or minimal working (code) examples for using other R packages to get the job done.
Hello Bohdan Khomtchouk!
It appears that your post has been cross-posted to another site: https://support.bioconductor.org/p/98138/
This is typically not recommended as it runs the risk of annoying people in both communities.