Skip to content

Handling of node labels should be consistent across Phylo export formats #1817

Closed

Description

@jeromekelleher

As discussed in #1803 (comment) it's probably a good idea if we establish the convention that nodes are labelled with a string like tsk{node.id}, and this should be the consistent default across phylo export, i.e., in

Activity

  1. jeromekelleher commented on Oct 22, 2021

    @jeromekelleher
    MemberAuthor

    After discussing with @hyanwong we think a good way forward for the default node labels would be f"n{node.id}. The advantages are:

    • The prefix "n" indicates that this object is a node. The prefix tsk doesn't actually give any real information (other than where the data came from), and it helps us to disambiguate integer IDs from the different entities in the data model. (This convention is already used in the SVG tree structures)
    • It's much less likely that confusion will arise when comparing trees with VCF output, which uses the labels tsk_{some integer}. The way things are done in VCF is complicated, so a clean break from this would be quite helpful.
    • The labels are as concise as possible, without being bare integers.

    I propose we use this as the default form then across newick, nexus and Fasta (we're deprecating the existing newick method, #1671 )

    Does this sounds like a good default labelling strategy @jeetsukumaran?

  2. jeetsukumaran commented on Oct 22, 2021

    @jeetsukumaran
    Contributor

    After discussing with @hyanwong we think a good way forward for the default node labels would be f"n{node.id}. The advantages are:

    • The prefix "n" indicates that this object is a node. The prefix tsk doesn't actually give any real information (other than where the data came from), and it helps us to disambiguate integer IDs from the different entities in the data model. (This convention is already used in the SVG tree structures)
    • It's much less likely that confusion will arise when comparing trees with VCF output, which uses the labels tsk_{some integer}. The way things are done in VCF is complicated, so a clean break from this would be quite helpful.
    • The labels are as concise as possible, without being bare integers.

    I propose we use this as the default form then across newick, nexus and Fasta (we're deprecating the existing newick method, #1671 )

    Does this sounds like a good default labelling strategy @jeetsukumaran?

    In terms of just Nexus syntax itself -- yep, it's trouble free, robust, unambiguous, and easily parsed. Only consideration is if ever you will want to attach labels to internal nodes and distinguish them from tip labels by another prefix. But that's easily solved (e.g., using "i" as for the internal node label prefix).

  3. benjeffery commented on Oct 25, 2021

    @benjeffery
    Member

    Sounds good to me, I also think that the tsk_ was redundant.

  4. jeromekelleher commented on May 25, 2022

    @jeromekelleher
    MemberAuthor

    Closing this, resolved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions