Note
Go to the end to download the full example code.
Reconstruct tree by SCITE#
This example shows how to construct a phylogenetic tree using SCITE on a binary single-cell genotype matrix.
import scphylo as scp
# sphinx_gallery_thumbnail_path = "_static/thumbnails/scite.png"
First, we load a binary test single-cell genotype data.
df_in = scp.datasets.test()
df_in.head()
Next, using scphylo.tl.scite() we remove the single-cell noises from the
input.
df_out = scp.tl.scite(df_in, alpha=0.0000001, beta=0.1, n_restarts=3, n_iters=1000)
df_out.head()
running SCITE with alpha=1e-07, beta=0.1, n_iters=1000, n_restarts=3
input -- size: 20x20
input -- 0: 226#, 56.5%
input -- 1: 94#, 23.5%
input -- NA: 80#, 20.0%
input -- CF: False
output -- size: 20x20
output -- 0: 268#, 67.0%
output -- 1: 132#, 33.0%
output -- NA: 0#, 0.0%
output -- CF: True
output -- time: 0.0s (0:00:00.015504)
flips -- #0->1: 15
flips -- #1->0: 0
flips -- #NA->0: 57
flips -- #NA->1: 23
rates -- FN: 0.138
rates -- FP: 0.00000000
rates -- NA: 0.200
score -- NLL: 44.44268596674768
score: -44.73427390500264
beta: 0.190416670129041
Finally, using scphylo.ul.is_conflict_free_gusfield() we check whether the
inferred genotype matrix is conflict-free or not.
is_cf = scp.ul.is_conflict_free_gusfield(df_out)
print(is_cf)
True
Total running time of the script: (0 minutes 0.999 seconds)
Estimated memory usage: 452 MB