def get_support(target_tree, trees, len_trees=None):
 term_names = sorted((term.name for term in target_tree.find_clades(terminal=True)))
 bitstrs = {}
 size = len_trees
 if (size is None):
  try:
   size = len(trees)
  except TypeError:
   raise TypeError('Trees does not support len(trees), you must provide the number of replicates in trees as the optional parameter len_trees.')
 for clade in target_tree.find_clades(terminal=False):
  bitstr = _clade_to_bitstr(clade, term_names)
  bitstrs[bitstr] = (clade, 0)
 for tree in trees:
  for clade in tree.find_clades(terminal=False):
   bitstr = _clade_to_bitstr(clade, term_names)
   if (bitstr in bitstrs):
    (c, t) = bitstrs[bitstr]
    c.confidence = (((t + 1) * 100.0) / size)
    bitstrs[bitstr] = (c, (t + 1))
 return target_tree

def get_support ( target_tree , trees , len_trees = None ) : term_names = sorted ( ( term . name for term in target_tree . find_clades ( terminal = True ) ) ) bitstrs = { } size = len_trees if ( size is None ) : try : size = len ( trees ) except TypeError : raise TypeError ( 'Trees does not support len(trees), you must provide the number of replicates in trees as the optional parameter len_trees.' ) for clade in target_tree . find_clades ( terminal = False ) : bitstr = _clade_to_bitstr ( clade , term_names ) bitstrs [ bitstr ] = ( clade , 0 ) for tree in trees : for clade in tree . find_clades ( terminal = False ) : bitstr = _clade_to_bitstr ( clade , term_names ) if ( bitstr in bitstrs ) : ( c , t ) = bitstrs [ bitstr ] c . confidence = ( ( ( t + 1 ) * 100.0 ) / size ) bitstrs [ bitstr ] = ( c , ( t + 1 ) ) return target_tree
calculate branch support for a target tree given bootstrap replicate trees .