.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_highlight_regions.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_highlight_regions.py: =============================== Highlight regions on all tracks =============================== By calling :meth:`~pygv.viewer.GenomeViewer.set_highlight_regions` method, you can highlight multiple regions on each track. .. GENERATED FROM PYTHON SOURCE LINES 8-25 .. image-sg:: /auto_examples/images/sphx_glr_plot_highlight_regions_001.png :alt: chr1 :srcset: /auto_examples/images/sphx_glr_plot_highlight_regions_001.png, /auto_examples/images/sphx_glr_plot_highlight_regions_001_2_00x.png 2.00x :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none array([, ], dtype=object) | .. code-block:: Python from pygv.viewer import GenomeViewer from pygv.tracks.bigwig_track import BigWigTrack gv = GenomeViewer() # draw positive and negative values independently track_1 = BigWigTrack( "../examples/data/K562_GROcap_hg38_pl.chr1.bw", name="+", ) gv.add_track(track_1) track_2 = BigWigTrack( "../examples/data/K562_GROcap_hg38_mn.chr1.bw", name="-", ) gv.add_track(track_2) # highlight two loci chr1:116824346-116828474 and chr1:116845712-116846846 # the first regions will be highlighted in yellow, the second one in red. gv.set_highlight_regions([116824346, 116845712], [116828474, 116846846], ["yellow", "red"]) gv.plot("chr1", 116814729, 116857188) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.105 seconds) .. _sphx_glr_download_auto_examples_plot_highlight_regions.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_highlight_regions.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_highlight_regions.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_highlight_regions.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_