Skip to main content
Ctrl+K
marsilea 0.3.4 documentation - Home
  • Tutorial
  • Gallery
  • API
  • Installation
  • How-To
  • GitHub
  • Tutorial
  • Gallery
  • API
  • Installation
  • How-To
  • GitHub

Section Navigation

  • marsilea.Heatmap
  • marsilea.SizedHeatmap
  • marsilea.CatHeatmap
  • marsilea.layers.Layers
  • marsilea.layers.LayersMesh
  • marsilea.upset.Upset
  • marsilea.upset.UpsetData
  • oncoprinter.OncoPrint
  • marsilea.plotter.ColorMesh
  • marsilea.plotter.Colors
  • marsilea.plotter.SizedMesh
  • marsilea.plotter.MarkerMesh
  • marsilea.plotter.TextMesh
  • marsilea.plotter.Bar
  • marsilea.plotter.Box
  • marsilea.plotter.Boxen
  • marsilea.plotter.Violin
  • marsilea.plotter.Point
  • marsilea.plotter.Strip
  • marsilea.plotter.Swarm
  • marsilea.plotter.Area
  • marsilea.plotter.Arc
  • marsilea.plotter.Numbers
  • marsilea.plotter.StackBar
  • marsilea.plotter.CenterBar
  • marsilea.plotter.SeqLogo
  • marsilea.plotter.Labels
  • marsilea.plotter.AnnoLabels
  • marsilea.plotter.Title
  • marsilea.plotter.Chunk
  • marsilea.plotter.FixedChunk
  • marsilea.base.WhiteBoard
  • marsilea.base.ClusterBoard
  • marsilea.base.LegendMaker
  • marsilea.base.ZeroWidth
  • marsilea.base.ZeroHeight
  • marsilea.base.ZeroWidthCluster
  • marsilea.base.ZeroHeightCluster
  • marsilea.layout.CrossLayout
  • marsilea.layout.CompositeCrossLayout
  • marsilea.Deformation
  • marsilea.plotter.base.RenderPlan
  • marsilea.plotter.base.RenderSpec
  • API Reference
  • marsilea.plo...

marsilea.plotter.SeqLogo#

class SeqLogo(matrix, width=0.9, color_encode=None, stack='descending', **kwargs)#

Bases: StatsBase

Sequence logo

Parameters:
matrixpandas.DataFrame

Drawing matrix, the data is the height of logo with columns as positions and rows as nucleotides/amino acids letters.

widthfloat, optional

The width of each letter, by default .9, should be within [0, 1]

color_encodedict, optional

The color encoding for each letter, should be a dict with key as letter and value as color

stack{“descending”, “ascending”, “normal”}, default: “descending”

The stacking order of letters, by height. If normal will stack as the order in matrix.

Examples

>>> import pandas as pd
>>> from marsilea.plotter import SeqLogo
>>> matrix = pd.DataFrame(data=np.random.randint(1, 10, (4, 10)),
...                       index=list("ACGT"))
>>> _, ax = plt.subplots()
>>> colors = {"A": "r", "C": "b", "G": "g", "T": "black"}
>>> SeqLogo(matrix, color_encode=colors).render(ax)
../../_images/marsilea-plotter-SeqLogo-1.png
render_main = False#

previous

marsilea.plotter.CenterBar

next

marsilea.plotter.Labels

On this page
  • SeqLogo
    • SeqLogo.render_main

© Copyright 2023, Mr-Milk.

Created using Sphinx 7.2.6.

Built with the PyData Sphinx Theme 0.15.2.