Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gotree collpase length not working? #12

Open
tseemann opened this issue Jan 14, 2021 · 2 comments
Open

gotree collpase length not working? #12

tseemann opened this issue Jan 14, 2021 · 2 comments

Comments

@tseemann
Copy link

tseemann commented Jan 14, 2021

cat foo.nwk
((A:0.1,B:0.1),C:0.1);

 gotree collapse length -l 0.2  < foo.nwk
((A:0.1,B:0.1),C:0.1);

I was expecting to see (A:0,B:0,C:0) ?

@fredericlemoine
Copy link
Collaborator

fredericlemoine commented Jan 14, 2021

I see.
First of all, gotree collapse length removes internal branches that are shorter than a given threshold. For example:

$ echo "((A:0.2,B:0.2):0.1,C:0.2,D:0.2);" | gotree collapse length -l 0.2
(C:0.2,D:0.2,A:0.2,B:0.2);
C --0.2-- +       +--0.2-- A     C --0.2-- +  +--0.2-- A
           \     /                          \/
            -0.1-             =>            /\            
           /     \                D --0.2--+  +--0.2-- B
D --0.2--+        +--0.2-- B     

It currently does not remove branches that are connected to the root for rooted tree (root node having degree > 2), because when the root is a polytomy we tend to consider it as unrooted.
It is possible to change this behavior though, but will need testing.

@fredericlemoine
Copy link
Collaborator

I added options --rootand -tips to collapse brlength, you can have a look at the command documentation. This pre-release implements it.
Let me know if it solves your issue.

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

No branches or pull requests

2 participants