.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_draw_aln_plot_aln-dotplot-2.py>`     to download the full example code
    .. rst-class:: sphx-glr-example-title

    .. _sphx_glr_draw_aln_plot_aln-dotplot-2.py:


Dotplot with annotated sequences
================================

If sequences in a dotplot have been annotated, the `dotplot()` method returns an `AnnotatedDrawable`.

Reloading from json
###################

The data file, `tp53.json`, was created from a query of ensembl for one-to-one orthologs of human TP53 between Human, Macaque, Orangutan and Marmoset. The resulting sequences were annotated with the location of the CDS for the canonical transcript, then the `SequenceCollection` was saved as json using `cogent3.app.write_json`.


.. code-block:: default


    from cogent3.app.io import get_data_store, load_json


    loader = load_json()
    seqs = loader("../../data/tp53.json")
    dp = seqs.dotplot(name1="Macaque", name2="Marmoset", width=600)
    dp.show()




.. raw:: html
    :file: images/sphx_glr_plot_aln-dotplot-2_001.html





Removing annotation tracks
##########################


.. code-block:: default


    help(dp.remove_track)





.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none

    Help on method remove_track in module cogent3.draw.drawable:

    remove_track(left_track=False, bottom_track=False) method of cogent3.draw.drawable.AnnotatedDrawable instance
        Parameters
        ----------
        left_track : bool
            the left track is removed
        bottom_track : bool
            the bottom track is removed





Thus we could remove the left annotation track, for instance with

```python
dp.remove_track(left_track=True)
```

For some reason, the display of this result is broken on RTD so we don't do it here.


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  38.491 seconds)


.. _sphx_glr_download_draw_aln_plot_aln-dotplot-2.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download sphx-glr-download-python

     :download:`Download Python source code: plot_aln-dotplot-2.py <plot_aln-dotplot-2.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: plot_aln-dotplot-2.ipynb <plot_aln-dotplot-2.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
