Note
Go to the end to download the full example code.
Reconstruct tree by Trisicell-PartF#
This example shows how to assess a phylogenetic tree using Trisicell-PartF on a binary single-cell genotype matrix.
import scphylo as scp
# sphinx_gallery_thumbnail_path = "_static/thumbnails/trisicell-partf.png"
First, we load a binary test single-cell genotype data.
df_in = scp.datasets.test()
df_in.head()
Then, using scphylo.tl.partition_function() we calculate the probability of
cell6 and cell17 seeded by mut12
probs = scp.tl.partition_function(
df_in,
alpha=0.000001,
beta=0.1,
n_samples=100,
n_batches=10,
muts=["mut12"],
cells=["cell6", "cell17"],
)
probs.mean(axis=1).round(4).values[0]
elapsed time: 0:00:02.430325
np.float64(0.8924)
Total running time of the script: (0 minutes 2.958 seconds)
Estimated memory usage: 439 MB