YuLab-SMU / DOSE

:mask: Disease Ontology Semantic and Enrichment analysis
https://yulab-smu.top/biomedical-knowledge-mining-book/
114 stars 35 forks source link

own genelist; too dump top proceed #55

Open mocherry opened 2 years ago

mocherry commented 2 years ago

Dear Clusterprofiler-Team,

being quite new to R I am struggling with the following problem: I have prepared a comma-delimited Excel file (.csv) with gene expression data: first column Gene Symbol, second column FC as described. It the looks like this (first three rows): ID,FC CXCL3,12.95135115 MMP3,12.40100107 IL6,11.1025565

Then I run: d <- read.csv("C:/users/kirsch/Desktop/clusterprofiler.csv") geneList = d[,2] names(geneList) = as.character(d[,1]) geneList = sort(geneList, decreasing = TRUE) gene <- names(geneList)[abs(geneList) > 2] ggo <- groupGO(gene = gene, OrgDb = org.Hs.eg.db, ont = "CC", level = 3, readable = TRUE)

and get the error: Error in .testForValidKeys(x, keys, keytype, fks) :

None of the keys entered are valid keys for 'ENTREZID'. Please use the keys method to see a listing of valid arguments

I guess I miss something important or just do not understand enough to solve the problem. Maybe someone can help. Thanks and ebst, Matthias

huerqiang commented 2 years ago

Use ?groupGO to get the doc of this function. Since your gene id is gene symbol, you should add the parameter: keyType = SYMBOL .

mocherry commented 2 years ago

Dear Huerqiang,

I have added keyType = "SYMBOL" to the script:

d <- read.csv("C:/users/kirsch/Desktop/clusterprofiler.csv") geneList = d[,2] names(geneList) = as.character(d[,1]) geneList = sort(geneList, decreasing = TRUE) gene <- names(geneList)[abs(geneList) > 2] ggo <- groupGO(gene = gene, OrgDb = org.Hs.eg.db, keyType = "SYMBOL", ont = "CC", level = 3, readable = TRUE)

and get the following error: Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

The geneList produced by this script looks like this: Type value CxCL3 double(1) 12.95135

I really do not know where to start to solve this. Admittedly, I am rather inexperienced with R and new to ClusterProfiler.

Help would really be appreciated, Matthias

huerqiang commented 2 years ago

Please send the "clusterprofiler.csv" file to me: 13766876214@163.com, and I will give the suitable code.