Git Product home page Git Product logo

Comments (4)

huerqiang avatar huerqiang commented on June 11, 2024 1

@guidohooiveld Will be fixed in #260
test_treeplot.pdf

from enrichplot.

guidohooiveld avatar guidohooiveld commented on June 11, 2024

You did not show your full code, but if you create the input list for the function compareCluster using the order you would like to, these order is retained in the resulting treeplot.

Admittedly, the resulting plot is not nice; ideally the labels should be rotated 90 degrees, and also the dots are positioned outside the colored clusterPanel...

@huerqiang : could you please have a look at these 2 issues (option to rotate labels, and correct position dots)?
Thanks!

> ## load libraries
> library(clusterProfiler)
> library(enrichplot)
> library(org.Hs.eg.db)
> library(ggplot2)
> 
> ## load sample data
> data(gcSample)
> 
> ## keep first 5 samples
> gcSample1 <- gcSample[c(1:5)]
> 
> ## rename first 5 samples
> ## use increasing order
> names(gcSample1)[1:5] <- c("12", "146", "682", "1450", "1960")
> 
> ## run enrichGO
> data.out.bp1 <- compareCluster(gcSample1, fun="enrichGO",
+                      OrgDb="org.Hs.eg.db", ont="BP", pvalueCutoff=0.05) 
> 
> data.out.bp1 <- pairwise_termsim(data.out.bp1)
> 
> 
> ## make treeplot
> ## note: changed showCategory to 3
> 
> 
> p1 <- treeplot(data.out.bp1,showCategory=3,
+                       clusterPanel.params = list(clusterPanel = "dotplot") )
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
ℹ invalid tbl_tree object. Missing column: parent,node.
ℹ invalid tbl_tree object. Missing column: parent,node.
> 
> ## show picture
> p1
> 

image

> ## rename samples, but now use random order
> gcSample2 <- gcSample[c(1:5)]
> names(gcSample2)[1:5] <- c("146", "12", "682", "1960", "1450")
> 
> ## run enrichGO again
> data.out.bp2 <- compareCluster(gcSample2, fun="enrichGO",
+                      OrgDb="org.Hs.eg.db", ont="BP", pvalueCutoff=0.05) 
> 
> data.out.bp2 <- pairwise_termsim(data.out.bp2)
> 
> p2 <- treeplot(data.out.bp2,showCategory=3,
+                       clusterPanel.params = list(clusterPanel = "dotplot") )
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
! # Invaild edge matrix for <phylo>. A <tbl_df> is returned.
ℹ invalid tbl_tree object. Missing column: parent,node.
ℹ invalid tbl_tree object. Missing column: parent,node.
> 
> ## show picture
> p2
> 
> 

image

from enrichplot.

huerqiang avatar huerqiang commented on June 11, 2024

@guidohooiveld It will be fixed in a few days.

from enrichplot.

guidohooiveld avatar guidohooiveld commented on June 11, 2024

@huerqiang : thanks for implementing a fix for this so quickly! Much appreciated.

from enrichplot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.