-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The README mentions NEXUS, but there are no functions that help to read or write this format in this repo.
However, you can grab the newick(s) from within the nexus and convert them using
with open("myfile.nexus") as nex:
tags = "begin trees;", "end;"
newicks = None
for line in nex:
line = line.strip()
if newicks is not None:
if line[:len(tags[1])].lower().startswith(tags[1]):
break
p = line.find("=")
if p >= 0:
newicks[line[:p].strip()] = line[p+1:] if line.endswith(";") else f"{line[p+1:]};"
elif line[:len(tags[0])].lower().startswith(tags[0]):
newicks = {}
tree_seqs = {k: tsconvert.from_newick(line, min_edge_length=1e-10) for k, line in newicks.items()}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels