.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_logo.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_plot_logo.py: =================== Sequence Logo Track =================== A sequence logo is a graphical representation of the sequence conservation and variation in a set of aligned sequences, typically representing a group of related DNA, RNA, or protein sequences. The primary purpose of a sequence logo is to visualize the sequence motifs or patterns that are conserved across the aligned sequences. In PyGV, you can create a :class:`~pygv.tracks.logo_track.LogoTrack` to show Sequence Logos. .. GENERATED FROM PYTHON SOURCE LINES 14-37 .. image-sg:: /auto_examples/images/sphx_glr_plot_logo_001.png :alt: chr19 :srcset: /auto_examples/images/sphx_glr_plot_logo_001.png, /auto_examples/images/sphx_glr_plot_logo_001_2_00x.png 2.00x :class: sphx-glr-single-img .. code-block:: Python import pandas as pd import matplotlib.pyplot as plt import numpy as np from pygv.viewer import GenomeViewer from pygv.tracks.track import DynamicValueTrack from pygv.tracks.logo_track import LogoTrack gv = GenomeViewer() track = LogoTrack("", name="logo") gv.add_track(track) dyn_track = DynamicValueTrack("", name="data") gv.add_track(dyn_track) demo_start = 10000 demo_end = 10129 track.values = pd.read_csv("../examples/data/saliency.csv", index_col=0) dyn_track.values = np.sin(np.arange(demo_end-demo_start)) gv.plot("chr19", demo_start, demo_end) plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.832 seconds) .. _sphx_glr_download_auto_examples_plot_logo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_logo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_logo.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_logo.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_