Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Parsing phylogenetic trees (newick format)

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

The issue asks for a new phylo.rs module that parses Newick strings into a struct and prints them back; the payload names no existing file to edit. Start by reading the Newick examples in the issue body and decide on the node representation. Done means the listed examples, from the unnamed tree through the rooted-on-a-leaf tree, parse and print back equivalently, with tests for each.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

Would like to add parsing of newick format just to print the newick in the first place. Newick is described here:https://en.wikipedia.org/wiki/Newick_format. It is possible to get multiple newick trees inside a single file, they each finish with a semicolon. Some trees can have many nodes, the structure is a graph-type with nodes, edges and leaves. There is an XML format that some python programs parse newick into, phyloXML

Describe the solution you'd like

Looking to start a module phylo.rs with a parse of newick into some type of good struct or hashmap in the first place, with just ability to print it out.

Describe alternatives you've considered

There are some newick tree parsers in crates.io but they all seem to be a few years old, for example newick_0.11.0

Additional context

Various types of newick tree to parse: The one below marked as "popular" is the one I've seen much the most often, so we could concentrate on that structure and allow the others if possible. There are multiple nodes.
(,,(,)); no nodes are named
(A,B,(C,D)); leaf nodes are named
(A,B,(C,D)E)F; all nodes are named
(:0.1,:0.2,(:0.3,:0.4):0.5); all but root node have a distance to parent
(:0.1,:0.2,(:0.3,:0.4):0.5):0.0; all have a distance to parent
(A:0.1,B:0.2,(C:0.3,D:0.4):0.5); distances and leaf names (popular)
(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F; distances and all names
((B:0.2,(C:0.3,D:0.4)E:0.5)F:0.1)A; a tree rooted on a leaf node (rare)

Dominant language
Rust
Stars
38
Forks
15
Avg merge
21h 33m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LCrossman/microBioRust

All issues in LCrossman/microBioRust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.