Giter Club home page Giter Club logo

gotree's People

Contributors

albertyw avatar fredericlemoine avatar krtab avatar lucblassel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gotree's Issues

Robinson-Foulds or other

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.

gotree new release

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

Issue installating goalign/gotree

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

Convert between (un)quoted taxon labels

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 (_) ?

Bipartition question

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?

Version string not displayed

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.

Newick parsing failing if there is trailing whitespace after semicolon

I noticed that if there was any whitespace after the semicolon, parsing fails and gotree returns a EOF error.

MWE

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

Potential fix

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.

Bug of generate.

Hi,

No options to give tip number when using generate, I think there is a bug.

image

Best,
Kun

About negative branches on NJ tree

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

Possible bug with gotree prune

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).

  1. Could this be being caused by gotree's pruning method run hundreds of times over to remove tips?
  2. If so, could it be handled by gotree pruning?

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.

issue in gotree

Got this issue on travis today 2d Aug 2018.

github.com/fredericlemoine/gotree/tree/tree.go:1637:17: undefined: math.Round

strange results tree

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

Output list of taxon labels?

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

Added width and background options for svg and png

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

Strange label placement on radial svg

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.

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.