Skip to content

Add "daylight" layout method for unrooted trees.#124

Merged
GuangchuangYu merged 3 commits intoYuLab-SMU:masterfrom
JustGitting:master
Apr 10, 2017
Merged

Add "daylight" layout method for unrooted trees.#124
GuangchuangYu merged 3 commits intoYuLab-SMU:masterfrom
JustGitting:master

Conversation

@JustGitting
Copy link
Copy Markdown
Contributor

Hi Guang Chuang Yu and ggtree devs,

I started learning R a few months back (I have programmed in a bunch of other languages though) and this will be my first github commit. So any tips, tricks or suggestions on how to contribute will be very welcome.

The aim of this commit is to provide alternative layout methods for unrooted trees. I've added the "daylight" algorithm described in Inferring Phylogenies by Joseph Felsenstein, but his description is not very detailed and open to interpretation.

I looked at the Phylip program implementation of the daylight algorithm (in drawtree.c), but I could not understand it as it was not documented.

Hence, I started from scratch...

I've added an option to ggtree() layout.method so the same layout type (eg. unrooted) can have different layout methods used (e.g. equal-angle, daylight, n-body, etc).

As I'm not experienced in R, I'm not sure of the best conventions, but followed GCY's style.

I had to refactor the layout.unrooted() function so different layout methods can be added and called. Is there a better way to do this?

The daylight algorithm is my own implementation so I'm sure there is room for optimization.

Suggestion: It would be really helpful for a "developers guide" on how to contribute to this project. It could include an overview of architecture, conventions, dos/don't. This would save contributors from making common mistakes or taking time to reverse engineer the program to figure out how to do stuff.

Anyway, I hope this helps.

JustGitting added 3 commits April 6, 2017 14:42
…ut method (unrooted).

Modified method-fortify.R to accommodate layout.method parameter.
Refactored and added various functions to tidytree.R for the "daylight" layout algorithm for unrooted trees.
Merge branch 'master' of https://github.com/JustGitting/ggtree

# Conflicts:
#	.Rbuildignore
@GuangchuangYu GuangchuangYu merged commit 3f54202 into YuLab-SMU:master Apr 10, 2017
@GuangchuangYu
Copy link
Copy Markdown
Member

thanks for your contribution. You can make a pull request to add your name in author list as a contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants