# HG changeset patch # User proteore # Date 1537276827 14400 # Node ID b25f272d3505b07d5bce86d56c483c75b6df8641 # Parent 2b14f4f8e1285985b62777bc736b6ded8e0587e1 planemo upload commit 46cd1d44f3be3058caa036851d95194ebff3caaf-dirty diff -r 2b14f4f8e128 -r b25f272d3505 GO-enrich.R --- a/GO-enrich.R Tue Sep 18 08:28:16 2018 -0400 +++ b/GO-enrich.R Tue Sep 18 09:20:27 2018 -0400 @@ -47,16 +47,18 @@ ont=ontology, level=level, readable=TRUE) - - ggo@result$Description <- sapply(ggo@result$Description, function(x) {ifelse(nchar(x)>100, substr(x,1,100),x)},USE.NAMES = FALSE) - nb_max_char = max_str_length_10_first(ggo$Description) - width = width_by_max_char(nb_max_char) - name <- paste("GGO_", ontology, "_bar-plot", sep = "") - png(name,height = 720, width = width) - p <- barplot(ggo, showCategory=10) - print(p) - dev.off() - return(ggo) + + if (length(ggo@result$ID) > 0 ) { + ggo@result$Description <- sapply(as.vector(ggo@result$Description), function(x) {ifelse(nchar(x)>100, substr(x,1,100),x)},USE.NAMES = FALSE) + nb_max_char = max_str_length_10_first(ggo$Description) + width = width_by_max_char(nb_max_char) + name <- paste("GGO_", ontology, "_bar-plot", sep = "") + png(name,height = 720, width = width) + p <- barplot(ggo, showCategory=10) + print(p) + dev.off() + return(ggo) + } } # GO over-representation test @@ -75,6 +77,8 @@ #if there are enriched GopTerms if (length(ego$ID)>0){ + print ('ego') + print (ego@result$Description) ego@result$Description <- sapply(ego@result$Description, function(x) {ifelse(nchar(x)>100, substr(x,1,100),x)},USE.NAMES = FALSE) nb_max_char = max_str_length_10_first(ego$Description) width = width_by_max_char(nb_max_char) diff -r 2b14f4f8e128 -r b25f272d3505 cluster_profiler.xml --- a/cluster_profiler.xml Tue Sep 18 08:28:16 2018 -0400 +++ b/cluster_profiler.xml Tue Sep 18 09:20:27 2018 -0400 @@ -1,4 +1,4 @@ - + GO terms classification and enrichment analysis