evolbioinfo / gotree Goto Github PK
View Code? Open in Web Editor NEWGotree is a set of command line tools and an API to manipulate phylogenetic trees. It is implemented in Go language.
License: GNU General Public License v2.0
Gotree is a set of command line tools and an API to manipulate phylogenetic trees. It is implemented in Go language.
License: GNU General Public License v2.0
Hi, I am a big fan of gotree
!
Are there any plans to have a Robinson-Foulds distance? Kendall-Colijn?
I think that I can use gotree compare distances
but the output is so verbose and so I do not know how I will convert that spreadsheet to a summary statistic.
Hey all:
I just noticed the recent commit of the function Monophyletic in stats option, and curious when will that be released in the binary file?
Li
Thanks
While installing goalign using
go get -u github.com/evolbioinfo/goalign/
I got this error message related to gotree::
v0.3.0b: Could not introduce github.com/evolbioinfo/[email protected], as its subpackage
github.com/evolbioinfo/gotree/models/protein is missing. (Package is required by (root).)
I had installed gotree succesfully before hand using
go get -u github.com/evolbioinfo/gotree
Love this tool!
Noticed some tools handle quoites labels in .nwk
But other tools don't
Be good to be able to convert between them
Quoted: ('label1':0.231, ...);
Unquoted: (label1:0.231, ...);`
For the case of a label having a a space (EVIL!)
perhaps allow replacing it with underscore (_
) ?
Hello, thanks for a nice library!
I'm trying to implement a neighbour-joining example and I come across this issue on the penultimate step:
+---------- F
|
| +--------------------------------- E
|----------|ED
| +---------------------- D
|
| +---------- B
| +----------------------|BA
+----------|BAC +-------------------------------------------- A
|
+---------- C
--- FAIL: TestNJ (0.00s)
panic: We cannot add the bipartition, it already exists [recovered]
It is attempting to join F and ED at this point. Can I detect this situation and do something different perhaps?
Hello.
Thank you for gotree.
At the moment, the installation of version 0.4.0 from Bioconda seems to have a bug where the version string is not displayed:
% gotree version
I am wondering if this an issue with how Bioconda is producing the binary, or is this a real bug? I noticed that the version string is generated at compile time (I think --- if I read the code correctly).
Thank you.
Anders.
I noticed that if there was any whitespace after the semicolon, parsing fails and gotree
returns a EOF
error.
gotree generate yuletree --seed 42 | sed 's/;/; /g' | gotree stats
Yields the following error:
tree nodes tips edges meanbrlen sumbrlen meansupport mediansupport rooted nbcherries colless sackin
[Error] in cmd/stats.go (line 45), message: EOF
Error: EOF
Usage:
gotree stats [flags]
gotree stats [command]
Available Commands:
edges Displays statistics on edges of input tree
monophyletic Tells wether input tips form a monophyletic group in each of the input trees
nodes Displays statistics on nodes of input tree
rooted Tells wether the tree is rooted or unrooted
splits Prints all the splits from an input tree
tips Displays statistics on tips of input tree
Flags:
-h, --help help for stats
-i, --input string Input tree (default "stdin")
-o, --output string Output file (default "stdout")
Global Flags:
--format string Input tree format (newick, nexus, phyloxml, or nextstrain) (default "newick")
--seed int Random Seed: -1 = nano seconds since 1970/01/01 00:00:00 (default -1)
-t, --threads int Number of threads (Max=10) (default 1)
Use "gotree stats [command] --help" for more information about a command.
EOF
I believe it is due to the ReadUntilSemiColon
function that only checks if the last character of a line is a semicolon, instead of the last non-whitespace character.
I have submitted a pull request to fix it.
Related to #10, could you add gotree compare distances
documentation under the detailed documentation? Thank you!
Hi,
My question is not really aboat gotree, just want to know do you have any idea to deal with those negative distance branches on NJ tree?
Replace all negative value using 0, or all branches plus the smallest distances ?
Best,
Kun
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)
?
Hi,
Is it possible to use gotree to add constrain information to a tree to prepare mcmctree input file
For example, change
((((agl,(cma,dvi)),sor),((tmo,zmo),tca)),ota);
to
8 1
((((agl,(cma,dvi)'B(79.2, 152.8, 1e-300, 1e-300)')'B(89.7, 220.9, 1e-300, 1e-300)',sor),((tmo,zmo),tca))'B(152.3, 236.2, 1e-300, 1e-300)',ota)'B(250.999938, 302.8938, 0.025, 0.025)';
Best,
Kun
I have been running gotree prune
on a 2 million tip SARS-CoV-2 tree to remove what is now quite a long list of tips. For some tips it crashes, but for all of these I can manually update the newick file to successfully prune the tree. I noticed that the strings I am deleting manually all look very similar:
Command run:
gotree prune -i cog_global.2021-11-18.clean.tree -f cog_global_master.filtered.clean.tips.txt -r -o "cog_global.2021-11-18.clean.pruned.newick"
Error message:
Command error:
2021/11/25 19:46:52 Newick : Support values attached to root node are ignored
2021/11/25 19:46:52 Newick : Branch lengths attached to root node are ignored
[Error] in cmd/prune.go (line 137), message: After tip removal, this node should not have degre 1 without being the root
Error: After tip removal, this node should not have degre 1 without being the root
Examples of the newick substrings which result in successful removal:
,(South_Africa/NICD-N5963/2021:6)14061:8
(Italy/CAM_IZSM_RD20702688967/2021:0)426532:12,
,(Italy/CAM_IZSM_RD20702444133/2021:0)276441:1
,(USA/NY-PA-PBRI-CT-1137/2021:0)164683:1
(USA/OR-TRACE-POLK-011821-680/2021:1)474168:2,
,(Italy/PIE-15858188/2021:2)418163:1
,(Italy/CAM_IZSM_RD20702444262_CAM_IZSM_COLLI_TIGEM/2021:8)198146:2
,(USA/NJ-CDC-IBX578468886599/2021:9)485193:3
,(England/PHEC-3K03FKB2/2021:12)320221:1
,(USA/OR-OHSU-10264/2021:1)460724:1
,(Italy/CAM_IZSM_RD20702644357/2021:7)173146:5
,(USA/WA-UW-63337/2021:0)488838:3
,(((Italy/CAM_IZSM_RD20702444259_CAM_IZSM_COLLI_TIGEM/2021:17)198151:5)198150:2)198147:1
,(USA/FL-CDC-ASC210122855/2021:0)456085:2
(((Italy/CAM_IZSM_RD00363110/2021:18)429187:7)429182:2)429181:14,
(Mexico/SON_InDRE_FB45320_S8846/2021:8)144466:5,
,(England/PHEC-3K040K63/2021:6)320222:6
ie it looks like the problem is being caused by the tip being the only descendent of an internal node. I don't know enough about newick format to really understand if this meets the spec or not, so I assume it does make sense (in any case, it would be a real headache to regenerate the tree given that it now has 2 million sequences in it and is currently being updated with UShER every week, then some tips pruned out with gotree).
As a secondary fix/handle attempt, I plan to try and parse the string to remove the internal nodes with a single descendant, but I don't know if the resulting tree will be handled by UShER/other tree tools.
Hey
Originally posted by @JLD1982 in evolbioinfo/booster#5 (comment)
Got this issue on travis today 2d Aug 2018.
github.com/fredericlemoine/gotree/tree/tree.go:1637:17: undefined: math.Round
dear,
I have successfully managed to apply gotree to a set of >200 bacterial genomes. However, the results I have obtained are incongruent to those I obtained with a multiple-locus sequence analysis. I was wondering if you could help me find an explanation for this occurrence? My main issue is that the similarity distances (branch distances) between clusters are too short. Do you have any idea of what a good similarity threshold is advisable for this kind of output, e.g. 97% similarity?
Cheers,
Pablo
Got the above error when running
go get github.com/evolbioinfo/gotree/
I want to emulate nw_labels -I
whicj prints each tip label (not internal nodes) labels one per line.
But I have looked many times over but can not see how to do this in gotree.
Hope you can point me in the right direction.
So ((A,B),C(
woukld print
A
B
C
Hello -
I've noticed when writing trees to file with gotree draw svg
and gotree draw png
tip labels get cut off. I think, for SVG at least, this is because only +60 is added to the width (and height) parameters. This can be fixed by editing the svg attribute width="100%"
or replacing width with overflow="visible"
. Could one of these be made default, or added as an option? This is also an issue with PNGs, but I do not have a workaround for that.
Another issue with PNGs is that the transparent background appears gray in Dark Mode. Could an option be added to create PNGs with a white background?
I tested the above with the following newick (sorry, .nwk not an accepted upload):
(long-label-20:0.0001775,(long-label-21:0,((long-label-12:0,long-label-13:0.000076,long-label-08:0,long-label-08-1:0,(long-label-09:0,really-long-label-11:0.000034):0.000069,long-label-07:0,long-label-19:0):0.000034,long-label-10:0,long-label-10-1:0,long-label-10-2:0,long-label-06:0,long-label-05:0,long-label-17:0,long-label-02:0,long-label-04:0,long-label-03:0,long-label-01:0):0.000102):0.0001775);
Using:
gotree draw svg < in.nwk
gotree draw png < in.nwk
Thanks,
Sara
When drawing radial (-r) svg images from newick trees labels get placed too close to tips and get rotated strangely.
I guess it looks kind of OK with the fixed 8px font-size (which is way to small for presentations) but after enlarging the labels it looks awkward. Labels overwrite branches etc.
An example: echo "((Axx,Bxx),Cxx,(Dxx,Exx));" |/usr/local/bin/gotree draw svg -r
So, as a feature request: additional options to manipulate font size for labels, text rotation and text placement would be highly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.