Skip to content

reading species-tree without edge-data #14

@igel-kun

Description

@igel-kun

Hi, the Newick format allows trees without any data (such as branch-lengths) attached to the edges. However, your Newick parser complains that something is wrong with the tree if not all branches have a ':' attached to it. This is because n_branches is only increased when a colon is found.

I suppose there are 3 possibilities. Either

  1. you really need branch-lengths in the input to process the species tree, in which case the user should be properly informed of this fact, (keeping in mind that each branch having a ':' doesn't guarantee that there is a number following the colon and that this number represents a branch-length)
  2. the simulation algorithm really needs branch-lengths, but they could be derived from the species tree by assuming that it's ultrametric and then evenly distributing branch-lengths depending on the lengths of the paths to the leaves.
  3. the simulation doesn't need branch-lengths, in which case it's a bug in the Newick parser preventing the parsing of valid Newick without branch-lengths.

PS: forgot to mention, I'm trying to generate gene-trees for a given species tree that I'm trying to pass to simphy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions