.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/gallery/sequence/profile/anderson_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_examples_gallery_sequence_profile_anderson_logo.py: Sequence logo of sequences with equal length ============================================ This script creates a sequence logo for the `Anderson promoter collection `_. .. GENERATED FROM PYTHON SOURCE LINES 8-63 .. image-sg:: /examples/gallery/sequence/profile/images/sphx_glr_anderson_logo_001.png :alt: anderson logo :srcset: /examples/gallery/sequence/profile/images/sphx_glr_anderson_logo_001.png :class: sphx-glr-single-img .. code-block:: Python # Code source: Patrick Kunzmann # License: BSD 3 clause import matplotlib.pyplot as plt import numpy as np import biotite.sequence as seq import biotite.sequence.align as align import biotite.sequence.graphics as graphics # The list of Anderson promoters seqs = [ seq.NucleotideSequence("ttgacagctagctcagtcctaggtataatgctagc"), seq.NucleotideSequence("ttgacagctagctcagtcctaggtataatgctagc"), seq.NucleotideSequence("tttacagctagctcagtcctaggtattatgctagc"), seq.NucleotideSequence("ttgacagctagctcagtcctaggtactgtgctagc"), seq.NucleotideSequence("ctgatagctagctcagtcctagggattatgctagc"), seq.NucleotideSequence("ttgacagctagctcagtcctaggtattgtgctagc"), seq.NucleotideSequence("tttacggctagctcagtcctaggtactatgctagc"), seq.NucleotideSequence("tttacggctagctcagtcctaggtatagtgctagc"), seq.NucleotideSequence("tttacggctagctcagccctaggtattatgctagc"), seq.NucleotideSequence("ctgacagctagctcagtcctaggtataatgctagc"), seq.NucleotideSequence("tttacagctagctcagtcctagggactgtgctagc"), seq.NucleotideSequence("tttacggctagctcagtcctaggtacaatgctagc"), seq.NucleotideSequence("ttgacggctagctcagtcctaggtatagtgctagc"), seq.NucleotideSequence("ctgatagctagctcagtcctagggattatgctagc"), seq.NucleotideSequence("ctgatggctagctcagtcctagggattatgctagc"), seq.NucleotideSequence("tttatggctagctcagtcctaggtacaatgctagc"), seq.NucleotideSequence("tttatagctagctcagcccttggtacaatgctagc"), seq.NucleotideSequence("ttgacagctagctcagtcctagggactatgctagc"), seq.NucleotideSequence("ttgacagctagctcagtcctagggattgtgctagc"), seq.NucleotideSequence("ttgacggctagctcagtcctaggtattgtgctagc"), ] # Sequences do not need to be aligned # -> Create alignment with trivial trace # [[0 0 0 ...] # [1 1 1 ...] # [2 2 2 ...] # ... ] alignment = align.Alignment( sequences=seqs, trace=np.tile(np.arange(len(seqs[0])), len(seqs)) .reshape(len(seqs), len(seqs[0])) .transpose(), score=0, ) # Create sequence logo from alignment fig = plt.figure(figsize=(8.0, 1.5)) ax = fig.add_subplot(111) profile = seq.SequenceProfile.from_alignment(alignment) graphics.plot_sequence_logo(ax, profile, scheme="rainbow") # Remove the entire frame ax.axis("off") fig.tight_layout() plt.show() .. _sphx_glr_download_examples_gallery_sequence_profile_anderson_logo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: anderson_logo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: anderson_logo.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_