.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/reconstruction/compute_bnb.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_reconstruction_compute_bnb.py: Reconstruct tree by PhISCS-BnB ------------------------------ This example shows how to construct a phylogenetic tree using PhISCS-BnB on a binary single-cell genotype matrix. .. GENERATED FROM PYTHON SOURCE LINES 8-13 .. code-block:: Python import scphylo as scp # sphinx_gallery_thumbnail_path = "_static/thumbnails/bnb.png" .. GENERATED FROM PYTHON SOURCE LINES 14-15 First, we load a binary test single-cell genotype data. .. GENERATED FROM PYTHON SOURCE LINES 15-18 .. code-block:: Python df_in = scp.datasets.test() df_in.head() .. raw:: html
mut0 mut1 mut2 mut3 mut4 mut5 mut6 mut7 mut8 mut9 mut10 mut11 mut12 mut13 mut14 mut15 mut16 mut17 mut18 mut19
cellIDxmutID
cell0 1 1 1 1 1 1 1 0 3 3 0 3 0 0 0 3 0 0 0 0
cell1 3 0 0 0 0 0 3 0 1 1 3 1 0 0 3 0 0 1 1 1
cell2 0 0 0 0 0 0 0 1 1 3 1 1 0 0 3 1 1 1 1 0
cell3 0 0 0 0 0 0 0 3 1 0 0 1 0 0 0 1 1 1 0 0
cell4 0 0 0 0 0 0 0 1 1 1 1 1 0 0 3 0 0 0 0 0


.. GENERATED FROM PYTHON SOURCE LINES 19-21 Next, using :func:`scphylo.tl.bnb` we remove the single-cell noises from the input. .. GENERATED FROM PYTHON SOURCE LINES 21-27 .. code-block:: Python # TODO: fix # df_out = scp.tl.bnb(df_in, bounding="simulated") # df_out.head() .. GENERATED FROM PYTHON SOURCE LINES 28-30 Finally, using :func:`scphylo.ul.is_conflict_free_gusfield` we check whether the inferred genotype matrix is conflict-free or not. .. GENERATED FROM PYTHON SOURCE LINES 30-33 .. code-block:: Python # is_cf = scp.ul.is_conflict_free_gusfield(df_out) # is_cf .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.513 seconds) **Estimated memory usage:** 11 MB .. _sphx_glr_download_auto_examples_reconstruction_compute_bnb.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: compute_bnb.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: compute_bnb.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_