fixed undefined gtr and move the ignore_gaps to arguments
@@ -22,7 +22,8 @@ class TreeAnc(object):
alignment, making ancestral state inferrence
"""
- def __init__(self, tree=None, aln=None, gtr=None, fill_overhangs=True, verbose = ttconf.VERBOSE, **kwargs):
+ def __init__(self, tree=None, aln=None, gtr=None, fill_overhangs=True,
+ verbose = ttconf.VERBOSE, ignore_gaps=True, **kwargs):
"""
TreeAnc constructor. It prepares tree, attach sequences to the leaf nodes,
and sets some configuration parameters.
@@ -51,9 +52,12 @@ class TreeAnc(object):
filled with the gap sign('-'). As we suppose that the most
appropriate way to deal with the missing data is to assign it to the
"unknown" character ('N' for nucleotides, 'X' for aminoacids). If the
- parameter is set to True, the end-gaps are converted to unknonwn
+ parameter is set to True, the end-gaps are converted to unknown
symbols. Otherwise, the alignment is treated as-is
+ ignore_gaps: bool
+ ignore gaps in branch length calculations
+
verbose : int
verbosity level as number from 0 (lowest) to 10 (highest).
@@ -74,10 +78,8 @@ class TreeAnc(object):
self.one_mutation = None
self.fill_overhangs = fill_overhangs
- # TODO: set explicitly
- self.ignore_gaps = True
- if gtr is not None:
- self.set_gtr(gtr, **kwargs)
+ self.ignore_gaps = ignore_gaps
+ self.set_gtr(gtr if gtr is not None else 'JC69', **kwargs)
if tree is None:
self.logger("TreeAnc: tree loading failed! exiting",0)
return
