Registry / data / logomaker

logomaker

JSON →
library0.8.7pypypi✓ verified 85d ago

Logomaker is a Python package designed for creating high-quality sequence logos. It provides a flexible API for generating, styling, and customizing logos from sequence matrices (e.g., position-weight matrices or information matrices). The current version is 0.8.7, and the library is actively maintained with releases addressing bugs and adding features.

pip install logomaker
INSTALL
IMPORT
SIG · LOGOMAKER
L
logomaker
datapythonv0.8.7
Install
12.1s avg
Import
3051ms
Disk
269MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 3.133s · 265.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 12.1s · import 2.969s · 255MB
269MB installed
● package 269MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Logo
from logomaker import Logo
import logomaker; logomaker.Logo
The Logo class is typically imported directly for clarity and common usage patterns.
get_example_matrix
from logomaker import get_example_matrix
import logomaker; logomaker.get_example_matrix
Utility function for loading example data, usually imported directly.

This quickstart demonstrates how to load an example sequence matrix, create a `Logo` object, and apply basic styling before displaying the logo using Matplotlib.

import logomaker import matplotlib.pyplot as plt import pandas as pd # Load an example matrix (e.g., position-weight matrix) # This returns a pandas DataFrame example_df = logomaker.get_example_matrix('ww_matrix') # Create a Logo object from the DataFrame logo = logomaker.Logo(example_df) # Customize the logo (optional) logo.style_spines(visible=False) logo.style_xticks(rotation=90, fmt='%d', anchor=0) logo.highlight_position(p=6, color='gold') logo.ax.set_ylabel('Information (bits)') logo.ax.set_xlabel('Position') logo.ax.set_title('RNA Binding Protein WW Domain Logo') plt.tight_layout() plt.show()
Debug
Known issues
gotchaOlder versions (pre-0.8.2) frequently rebuilt the Matplotlib font cache when loading, leading to slow startup times and potential resource issues, especially in scripts or automated environments.
fix
Upgrade to logomaker version 0.8.2 or newer to benefit from performance improvements related to Matplotlib caching.
affects: <0.8.2
gotchaThe `stack_order='fixed'` option for `Logo` objects was non-functional in versions prior to 0.8.2. This could lead to incorrect rendering when trying to maintain a specific, fixed order of characters in the logo stacks.
fix
Upgrade to logomaker version 0.8.2 or newer to ensure the `stack_order='fixed'` option works as intended.
affects: <0.8.2
gotchaVersions prior to 0.8.3 had overly stringent numerical type checking for input matrices. This could cause valid input DataFrames to be rejected if their numerical types (e.g., `int64` vs. `float64`) did not precisely match internal expectations.
fix
Upgrade to logomaker version 0.8.3 or newer. Alternatively, explicitly cast your input DataFrame columns to `float64` or `int64` as appropriate before passing them to Logomaker functions.
affects: <0.8.3
Errors
Common errors & fixes
AttributeError: module 'logomaker' has no attribute 'Logo'
You are trying to access the `Logo` class using `logomaker.Logo` after importing the module as `import logomaker`, but the `Logo` class is intended for direct import.
fix
Change your import statement from `import logomaker` to `from logomaker import Logo`, and then use `Logo(...)` directly.
ValueError: Dataframe must have an index of positive integers.
The pandas DataFrame provided to the `logomaker.Logo` constructor (or related functions) does not have a numeric index, or the index contains non-positive integers. Logomaker expects the index to represent sequence positions.
fix
Ensure your input DataFrame has a numeric index (e.g., `0, 1, 2...` or `1, 2, 3...`). You might need to use `df.reset_index(drop=True)` or `df.set_index(df.index + 1)` if your index is not suitable.
KeyError: 'A'
Your input DataFrame (e.g., a position-weight matrix) is missing columns for expected character labels (e.g., 'A', 'C', 'G', 'T' for DNA/RNA). Logomaker expects columns corresponding to the characters you want to represent.
fix
Ensure your input pandas DataFrame has columns for all the characters you intend to display in the logo. For DNA/RNA, these are typically 'A', 'C', 'G', 'T' (or 'U'). For proteins, this would be the 20 standard amino acid codes.
Upgrade
Version history
0.8.7latest on PyPI · released Mar 25, 2025
Audit
Dependencies
matplotlibrequiredCore visualization library for rendering logos.
numpyrequiredFundamental package for numerical operations.
pandasrequiredUsed for data structures (DataFrames) to represent sequence matrices.
scipyrequiredProvides scientific computing tools, potentially for statistical analysis or data processing.
Agent activity
4 hits · last 30 days
node
2
Resources
logomaker — pip install logomaker · libregistry