Skip to content

Add node_labels argument to TreeSequence.to_nexus #1812

Closed as not planned
Closed as not planned

Description

@jeromekelleher

This should have the same semantics as the Tree.newick node_labels argument.

There's a question here about whether we should automatically quote the labels so that they are valid nexus or not. Maybe we have an extra argument quote_labels=None which

  • If None, quotes labels if they contain characters like "_" that need quoting
  • If True quotes unconditionally
  • if False never quotes

Any thoughts @jeetsukumaran?

Activity

  1. added
    enhancement
    Python API
    on Oct 18, 2021
  2. jeetsukumaran commented on Oct 18, 2021

    @jeetsukumaran
    Contributor

    Yep, this makes sense to me. For reference here is the interface for writing trees in DendroPy: https://dendropy.org/schemas/nexus.html#tree-write

  3. jeromekelleher commented on Oct 25, 2021

    @jeromekelleher
    MemberAuthor

    This might not be something we want to put in the first version, depending on what we decide for #1840. I think it's best to leave it out entirely initially, unless we're certain we'll never want to output the alignments in nexus.

    The main motivation for this issue was to fix the broken labelling scheme, which has been done in #1838.

  4. benjeffery commented on Jun 9, 2025

    @benjeffery
    Member

    Closing for inactivity

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

    Python APIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions