I have a multi-column csv file. In the first column are ensembl IDs that I would like to annotate using biomaRt in RStudio.
After reading the csv file into R as a dataframe I have converted the first column with the IDs to a character vector, since the getBM() parameter, values, requires a list of vectors as an argument. However, after running getBM() function it outputs 0 observations of 4 variables, thus not recognizing my character vector as the appropriate values to assigned the annotation to.
Any input as to how this can be resolved? Does it have to do with the data frame or character vector?
(file structure and R code below)
#load matched id file into R as csv dat=read.csv("/Users/cindyxu/Desktop/test/rbh_healthy_vs_unhealthy.csv", header=TRUE) #set column with gene IDs as a list of character vectors geneid=as.character(dat$rbh) #load biomart and acar dataset library("biomaRt") ensembl=useMart("ensembl", dataset="acarolinensis_gene_ensembl") genemap=getBM(attributes=c("ensembl_gene_id", "entrezgene", "hgnc_symbol", "description"), filters="ensembl_gene_id", values=geneid, mart=ensembl)
Output: genemap 0 obs. of 4 variables