Enrichement with clusterProfiler and biomart
1
0
Entering edit mode
sansan • 0
@d5e5b958
Last seen 7 months ago
Mexico

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)

biomaRt clusterProfiler Zea_mays • 781 views
ADD COMMENT
1
Entering edit mode

Because of the title of your post, I would like to point you to some code I posted on the GitHub pages of clusterProfiler that may be of relevance: https://github.com/YuLab-SMU/clusterProfiler/issues/588#issuecomment-1600652905

ADD REPLY
3
Entering edit mode
@james-w-macdonald-5106
Last seen 14 minutes ago
United States

While biomartr is based (apparently) on the Bioconductor biomaRt package, it is not a Bioconductor package, so your question is off-topic. In general, you should direct this sort of question to biostars.org. Or maybe just use biomaRt directly, but that's up to you. Also, all that stuff you do at the beginning is unnecessary (for you, or to show us, or anybody at biostars). The only thing you needed to show is the last three lines of code.

That said, there is never an attribute at Biomart that is all caps, so 'SYMBOL' by definition will not work (although maybe if you use the select interface for biomaRt? I never use that, so don't know). Anyway, SYMBOL isn't a thing. In addition, there doesn't appear to be a 'symbol' like thing for Z. mays anyway. In addition, the IDs you have are Ensembl Gene IDs, so the correct call is

>   biomart("Zm00001eb002010", "plants_mart", "zmays_eg_gene", c("entrezgene_id"), "ensembl_gene_id")
Starting BioMart query ...


Please cite: Drost HG, Paszkowski J. Biomartr: genomic data retrieval with R. Bioinformatics (2017) 33(8): 1216-1217. doi:10.1093/bioinformatics/btw821.
  ensembl_gene_id entrezgene_id
1 Zm00001eb002010            NA

And the way you would do that same query using biomaRt is

> mart <- useMart("plants_mart", "zmays_eg_gene", host = "https://plants.ensembl.org")
> getBM(c("ensembl_gene_id", "entrezgene_id"), "ensembl_gene_id", "Zm00001eb002010", mart)
  ensembl_gene_id entrezgene_id
1 Zm00001eb002010            NA

And checking for 'symbol'

> z <- listAttributes(mart)
> head(z)
                   name
1       ensembl_gene_id
2 ensembl_transcript_id
3    ensembl_peptide_id
4       ensembl_exon_id
5           description
6       chromosome_name
               description
1           Gene stable ID
2     Transcript stable ID
3        Protein stable ID
4           Exon stable ID
5         Gene description
6 Chromosome/scaffold name
          page
1 feature_page
2 feature_page
3 feature_page
4 feature_page
5 feature_page
6 feature_page
> grep("symbol", z[,1], value = TRUE, ignore.case = TRUE)
character(0)

> zz <- listFilters(mart)
> grep("symbol", zz[,1], value = TRUE, ignore.case = TRUE)
character(0)

So there's no symbol of any sort that you can return (an attribute) or filter on (a filter).

ADD COMMENT

Login before adding your answer.

Traffic: 1026 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6