Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.unifrac.fast_unifrac.shared_branch_length

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

```from cogent.maths.unifrac.fast_tree import (count_envs, index_tree, index_envs,
get_branch_lengths)
from cogent.maths.unifrac.fast_unifrac import (reshape_by_name,
meta_unifrac, shuffle_tipnames, weight_equally, weight_by_num_tips,
weight_by_branch_length, weight_by_num_seqs, get_all_env_names,
```
```        t = DndParser(t_str, UniFracTreeNode)
exp = {('A',):21.0,('B',):7.0}
obs = shared_branch_length(t, env_counts, 1)
self.assertEqual(obs, exp)

exp = {('A','B'):8.0}
obs = shared_branch_length(t, env_counts, 2)
```

```from cogent.maths.unifrac.fast_tree import (count_envs, index_tree, index_envs,
get_branch_lengths)
from cogent.maths.unifrac.fast_unifrac import (reshape_by_name,
meta_unifrac, shuffle_tipnames, weight_equally, weight_by_num_tips,
weight_by_branch_length, weight_by_num_seqs, get_all_env_names,
```
```        t = DndParser(t_str, UniFracTreeNode)
exp = {('A',):21.0,('B',):7.0}
obs = shared_branch_length(t, env_counts, 1)
self.assertEqual(obs, exp)

exp = {('A','B'):8.0}
obs = shared_branch_length(t, env_counts, 2)
```