Hi, it shows character(0)...But I searched several genes manually and they did exist in term2gene$V2, what could be the problem?
I am using the enricher function of clusterprofiler for GO enrichment of my non-model organism.
First I have my DE genes (n=638, converted as character):
gene <- read.csv("list.csv", header = F,sep=",")
gene <- as.character(gene[,1])
head(gene)
[1] "BANY.1.2.t20473" "BANY.1.2.t12787" "BANY.1.2.t10473" "BANY.1.2.t10472"
[5] "BANY.1.2.t08098" "BANY.1.2.t04432"
Then I have the term2gene:
term2gene <- read.csv("GO2gene.csv",header=F,sep=",")
head(term2gene)
V1 V2
1 GO:0002119 BANY.1.2.t15918
2 GO:0003916 BANY.1.2.t01379
3 GO:0005344 BANY.1.2.t10849
4 GO:0005344 BANY.1.2.t10852
5 GO:0005344 BANY.1.2.t10851
6 GO:0005344 BANY.1.2.t11738
and also term2name:
term2name <- read.csv("GO2name.csv",header=F,sep=",")
head(term2name)
V1 V2
1 GO:0000001 mitochondrion inheritance
2 GO:0000002 mitochondrial genome maintenance
3 GO:0000003 reproduction
4 GO:0000006 high-affinity zinc transmembrane transporter activity
5 GO:0000007 low-affinity zinc ion transmembrane transporter activity
6 GO:0000009 alpha-1,6-mannosyltransferase activity
Then run it:
x <- enricher(gene,TERM2GENE=term2gene,TERM2NAME=term2name,pvalueCutoff = 0.05, pAdjustMethod = "BH",qvalueCutoff = 0.1)
And I got this...
--> No gene can be mapped....
--> Expected input gene ID: BANY.1.2.t09827, BANY.1.2.t01112, BANY.1.2.t16389, BANY.1.2.t23551, BANY.1.2.t13938, BANY.1.2.t11911
--> return NULL...
Everything seems fine so I really hope to know what the problem is, thank you.
1 answer
Hello, can you run intersect(term2gene$V2, gene) ? Maybe no gene hit by any pathway.
Maybe try print(head(term2gene$V2), quote=TRUE) to see whether maybe some spaces around your string.
You are right...a space ahead of each term...
print(head(term2gene$V2), quote=TRUE)
[1] " BANY.1.2.t15918" " BANY.1.2.t01379" " BANY.1.2.t10849" " BANY.1.2.t10852"
[5] " BANY.1.2.t10851" " BANY.1.2.t11738"
This solved it?
Yes, space was introduced in front of each term, when I removed it everything went well!
Excuse me,I dont know how to remove space.Could you show the method you use in this problem?Thank you !
sub('^\\ ', '', c(' BANY.1.2.t15918', ' BANY.1.2.t01379'))
[1] "BANY.1.2.t15918" "BANY.1.2.t01379"
^ is a special character that matches the beginning of a string [of text]. The two \\ are needed to properly indicate a character space.
In my case, I was using a data frame as input instead of a character vector. I did not think about checking the input until I saw this comment.
Log in to answer this question.
Are these gene identifiers official gene symbols? Is your species supported by the tool?
No, they are not, thats why I used enricher since that's for my customized datasets
Thank you for your help, I try today,but it seems not work as we excepted.And I wonder if "\" is right ?I'm I used RStudio to analysis my data.And it give me an error like this "Trailing backslash".T-T