|
Imported modules
|
|
import SeqIO
import copy
import cp
import os
import pre
import string
import sys
|
|
Functions
|
|
|
|
|
|
addNodeCounts
|
addNodeCounts ( origDict )
Add labels at the nodes corresponding to the numbers of the
node keys in origDict. Returns a NEW treeDict -
does not modify the original
|
|
|
findChildren
|
findChildren ( treeDict, v=1 )
Modifies the named treeDict so that that children field reflects
the actual list of names and not the node tags. Also changes all
children lists to tuples
|
|
|
main
|
main ()
%(filename)s
Modifies Newick format trees from PAUP (NEXUS format) and phylip phylogenetics
programs. Can be used to change taxon names, node labels, and branch lengths. The
default input format is from PAUP 4.0b10.
{{out name of outfile. Prints to stdout by default.}}
{{intree input tree}}
{{fmt tree format
nex nexus format
none file contains nothing but the parenthesized expression for the tree: "( ... );"}}
{{brlen add branch labels to intree from this tree in nexus format}}
{{nodelab add node labels to intree. -nodelab with no argument assigns (fairly arbitrary) integer values to internal nodes. -nodelab=treefile adds node labels (eg bootstrap values) specified in a Newick format tree contained in treefile. Labels are transferred only if a node has an identical set of terminal taxa in both intree and the tree specified by -nodelab.}}
{{rmbrlen remove branch lengths from intree}}
{{rmnode remove node labels from intree}}
{{namerpl file directing replacement of names in tree. Format is [old name] [new name] Sequence names not found in the tree are ignored.}}
{{h Prints documentation.}}
{{v verbosity
1}}
{{version print version info and exit}}
%(version)s
|
|
|
nodeToDict
|
nodeToDict ( node, v=1 )
Parses a single node and returns a dict
Typical node structure:
(3:0.008906,4:0.001323)100
|
|
|
readNexusFile
|
readNexusFile ( instring )
Reads one tree from a nexus format file. A dictionary with the keys
treename, tag, and treestring.
|
|
|
reconstructNode
|
reconstructNode ( nodeDict )
Reconstructs a node from a nodeDict having typical structure
(3:0.008906,4:0.001323)100
{'taxa': [(3, :0.008906), (4, :0.001323)], 'nodelab': '100'}
|
|
|
reconstructTree
|
reconstructTree ( treeDict )
Reconstructs a dictionary of nodeDict dictionaries
(ie, output from treeparse()) into a tree.
|
|
|
removeBranchLenghts
|
removeBranchLenghts ( origDict )
Remove branch lengths from a treedict. Returns a NEW treeDict -
does not modify the original
|
|
|
removeNodeLabels
|
removeNodeLabels ( origDict )
Remove node labels (eg, bootstrap values) from a treedict. Returns a NEW treeDict -
does not modify the original
|
|
|
transferNodeLabels
|
transferNodeLabels (
toTreeDict,
fromTreeDict,
v=0,
)
Transfer node labels at all nodes having all terminal taxa (children) in common
|
|
|
treeparse
|
treeparse ( treestring, v=1 )
Parse a Newick format tree, break it down into nodes, and return a dictionary.
|