.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/comparison/compute_mltd.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_comparison_compute_mltd.py: Comparing two trees by MLTD --------------------------- This example shows how to compare/measure two inferred genotype data (trees). .. GENERATED FROM PYTHON SOURCE LINES 7-12 .. code-block:: Python import scphylo as scp # sphinx_gallery_thumbnail_path = "_static/thumbnails/mltd.png" .. GENERATED FROM PYTHON SOURCE LINES 13-14 First, we load two binary test single-cell genotype data. .. GENERATED FROM PYTHON SOURCE LINES 14-21 .. code-block:: Python grnd = scp.io.read( scp.ul.get_file("scphylo.datasets/test/fp_0-fn_0-na_0.ground.CFMatrix") ) sol = scp.io.read( scp.ul.get_file("scphylo.datasets/test/fp_1-fn_0.1-na_0.bnb.CFMatrix") ) .. GENERATED FROM PYTHON SOURCE LINES 22-23 Calculating the multi-labeled tree dissimilarity measure (MLTD). .. GENERATED FROM PYTHON SOURCE LINES 23-24 .. code-block:: Python scp.tl.mltd(grnd, sol) .. rst-class:: sphx-glr-script-out .. code-block:: none {'distance': 44, 'similarity': 78, 'normalized_similarity': 0.78} .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.543 seconds) **Estimated memory usage:** 9 MB .. _sphx_glr_download_auto_examples_comparison_compute_mltd.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: compute_mltd.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: compute_mltd.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_