scphylo.ul.to_cfmatrix#

scphylo.ul.to_cfmatrix(tree)[source]#

Convert phylogenetic tree to conflict-free matrix.

This function converts a phylogenetic tree in which mutations are at edges and cells are at nodes to a conflict-free matrix where rows are cells, columns are mutations and each entry is either zero or one representing the absence or presence of the mutation in the cell.

Parameters

tree (networkx.DiGraph) – The phylogenetic tree.

Returns

The conflict-free matrix.

Return type

pandas.DataFrame