i had to find find the gene names of each probeset given in a leukemia dataset, and used the following code:
I have installed and loaded BiocManager and BioMaRt.
# define the biomart object for the human genome
mart <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
# read the CSV file into a data frame
dat <- read.csv("full path", header = TRUE)
# extract the probe set IDs from columns
probes <- colnames(dat)[3:ncol(dat)]
# get the gene symbols for the probe set IDs
symbols <- unlist(mapIds(mart, probes, "hgnc_symbol", "affy_hg_u133a"))
The last command gives the error:
Error in mapIds(mart, probes, "hgnc_symbol", "affy_hg_u133a") :
could not find function "mapIds"
The variables mart, dat and probes have values in them, which means the corresponding commands were executed correctly.
Could anyone figure out what is the error here with the mapIds function?