This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Enrichement with clusterProfiler and biomartr

Hello,

I am trying to perform functional enrichment with clusterProfiler and BioMart but I am having the following error:

**Starting BioMart query ...
Error in biomaRt::getBM(attributes = as.character(c(filters, attributes)), :
   Invalid attribute(s): SYMBOL, SYMBOL
Please use the function 'listAttributes' to get valid attribute names**

I understand that it is for SYMBOL, but I don't know which one is correct.

My identifiers are like this: Zm00001eb002010

Could you help me?

My code:

# Set working directory
setwd("C:/todos/Diferenciales_lgn")
list.files()

# Read the DESeq2 table
diff_genes <- read_delim(file = "UP_lgn_vs_WT_filtrado_estricto.csv", delim = ",")

# Assign names to the first column
colnames(diff_genes)[1] <- "genes"

# Create a new table with the columns of interest
diff_genes <- diff_genes[, c("genes", "log2FoldChange")]

# Save the new table to a file
write.table(diff_genes, file = "diff_genes_up_maiz.tsv", sep = "\t", row.names = FALSE, quote = FALSE)

# We retrieved the zmays_eg_gene dataset from genome annotation version of the plant_mart mart.
biomartr::organismBM(organism = "zea mays")

#We retrieve attributes from zmays_eg_gene for Zea mays
zea_attributes <- biomartr::organismAttributes("zea mays") %>% 
  filter(dataset == "zmays_eg_gene")

# We obtain the correspondence between the Zea mays gene identifier and the NCBI Entrez gene identifier.
attributes_to_retrieve <- c("SYMBOL", "entrezgene_id")

result_BM <- biomartr::biomart(
  genes = diff_genes$genes,
  mart = "plants_mart",
  dataset = "zmays_eg_gene",
  attributes = attributes_to_retrieve,
  filters = "SYMBOL"
)

head(result_BM)
listAttributes (mart, zmays)
clusterprofiler biomartr zea-mays

You're using biomartr, not biomart. Please correct your question title and tag

1 answer

As pointed out in the answer you received on Bioconductor, there is no attribute called SYMBOL that you can retrieve.

Have you looked at MaizeDB? There is a tool "Translate Gene Model IDs - download" on https://www.maizegdb.org/gene_center/gene where you can paste your list of Zm... identifiers (up to 8000 at a time). There are a few options for what to convert your identifier to, but if you are planning to use clusterProfiler you'll want to select "GeneBank Gene Accessions (Entrez)" to get entrez gene ids.

Log in to answer this question.