cassiopeia.data.compute_phylogenetic_weight_matrix#
- cassiopeia.data.compute_phylogenetic_weight_matrix(tree, inverse=False, inverse_fn=<function <lambda>>)[source]#
Computes the phylogenetic weight matrix.
Computes the distances between all leaves in a tree. The user has the option to return the inverse matrix, (i.e., transform distances to proximities) and specify an appropriate inverse function.
This function computes the phylogenetic weight matrix in O(n^2 logn) time.
An NxN weight matrix is returned.
- Parameters:
- tree <module ‘cassiopeia.data.CassiopeiaTree’ from ‘/home/docs/checkouts/readthedocs.org/user_builds/cassiopeia-lineage/checkouts/latest/cassiopeia/data/CassiopeiaTree.py’>
CassiopeiaTree
- inverse
bool
(default:False
) Convert distances to proximities
- inverse_fn
Callable
[[Union
[int
,float
]],float
] (default:<function <lambda> at 0x76660cb05b80>
) Inverse function (default = 1 / x)
- Return type:
- Returns:
An NxN phylogenetic weight matrix