GithubHelp home page GithubHelp logo

sysbiolab / treeandleaf Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 3.0 8.04 MB

An R package for displaying binary trees, aiming to represent multiple layers of information on dendrogram leaves.

R 100.00%
reorganizing-dendrograms binary-tree binary-tree-visualization dendrogram r-package

treeandleaf's People

Contributors

milena-andreuzo avatar nturaga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

treeandleaf's Issues

Calling igraph::edge_betweenness() on a graph where all edge weights are zeros will be disallowed from igraph 1.2.7

We are preparing the next patch release of igraph's R interface and as we were doing reverse-dependency checks before submission, we noticed that TreeAndLeaf calls igraph's edge_betweenness() function on a graph where the weights of all edges are zeros. This is disallowed in igraph's C core as the shortest paths are not well-defined in a graph where all weights are zeros (essentially any simple or non-simple path from any node to any other node is a shortest path).

The issue can be fixed easily with the following patch, but I am not familar with the algorithm well enough to judge whether this was the original intention or not:

diff --git a/R/treeAndLeaf.R b/R/treeAndLeaf.R
index 479d03a..5fa00f6 100644
--- a/R/treeAndLeaf.R
+++ b/R/treeAndLeaf.R
@@ -66,7 +66,7 @@ treeAndLeaf <- function(obj){
     V(gg)$isLeaf <- V(gg)$name%in%coords$phylo$tip.label
     gg$centralVertex <- coords$centralVertex
     #--- set edge weights
-    E(gg)$weight <- 0
+    E(gg)$weight <- 1
     bt <- igraph::edge_betweenness(gg, directed = T)
     bt <- (1 - bt/max(bt))
     E(gg)$weight <- bt

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.