This preview shows page 1. Sign up to view the full content.
Unformatted text preview: To add to an internal node, follow the appropriate right paren with a colon. For example, here is the above tree with branch lengths added: "(a:3,((b:1,c:1):1,(d:1,e:1):1):1):1;" In this (and most subsequent) homework, you will be responsible for adding functions to an existing codebase. You can download the appropriate Python codebase from the class website. Your function, which will print out Newick formatted strings including branch lengths, will have the following form: def tree2String(tree): ...your code here. .. and will be called by the 'wrapper' function: def printTree(tree): treeStr = tree2String(tree) print tree2String + ";" Finally, your code should detect whether there are branch lengths to report (!= None), otherwise it should output a standard Newick formatted file without lengths. 1 of 1 9/11/06 12:17 AM...
View Full Document
This note was uploaded on 11/11/2011 for the course BIO 20.010j taught by Professor Lindagriffith during the Spring '06 term at MIT.
- Spring '06