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

Section Navigation

  • High-Level Visualizations
    • marsilea.Heatmap
    • marsilea.SizedHeatmap
    • marsilea.CatHeatmap
    • marsilea.layers.Layers
    • marsilea.layers.LayersMesh
    • marsilea.upset.Upset
    • marsilea.upset.UpsetData
  • Plotters
    • marsilea.plotter.ColorMesh
    • marsilea.plotter.Colors
    • marsilea.plotter.SizedMesh
    • marsilea.plotter.MarkerMesh
    • marsilea.plotter.Bar
    • marsilea.plotter.Box
    • marsilea.plotter.Boxen
    • marsilea.plotter.Violin
    • marsilea.plotter.Point
    • marsilea.plotter.Strip
    • marsilea.plotter.Swarm
    • marsilea.plotter.Numbers
    • marsilea.plotter.StackBar
    • marsilea.plotter.CenterBar
    • marsilea.plotter.Arc
    • marsilea.plotter.SeqLogo
    • marsilea.plotter.Labels
    • marsilea.plotter.AnnoLabels
    • marsilea.plotter.Title
    • marsilea.plotter.Chunk
    • marsilea.plotter.FixedChunk
  • Base Class
    • marsilea.base.WhiteBoard
    • marsilea.base.ClusterBoard
    • marsilea.base.LegendMaker
    • marsilea.layout.CrossLayout
    • marsilea.layout.CompositeCrossLayout
    • marsilea.Deformation
    • marsilea.plotter.base.RenderPlan
    • marsilea.plotter.base.RenderSpec
  • API Reference
  • Plotters
  • marsilea.plo...

marsilea.plotter.SeqLogo#

class marsilea.plotter.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.Arc

next

marsilea.plotter.Labels

On this page
  • SeqLogo
    • SeqLogo.render_main
Show Source

© Copyright 2023, Mr-Milk.

Created using Sphinx 7.2.6.

Built with the PyData Sphinx Theme 0.15.2.