{"id":9905,"library":"logomaker","title":"Logomaker","description":"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.","status":"active","version":"0.8.7","language":"en","source_language":"en","source_url":"https://github.com/jbkinney/logomaker","tags":["bioinformatics","visualization","sequence logo","genomics"],"install":[{"cmd":"pip install logomaker","lang":"bash","label":"Install Logomaker"}],"dependencies":[{"reason":"Core visualization library for rendering logos.","package":"matplotlib"},{"reason":"Fundamental package for numerical operations.","package":"numpy"},{"reason":"Used for data structures (DataFrames) to represent sequence matrices.","package":"pandas"},{"reason":"Provides scientific computing tools, potentially for statistical analysis or data processing.","package":"scipy"}],"imports":[{"note":"The Logo class is typically imported directly for clarity and common usage patterns.","wrong":"import logomaker; logomaker.Logo","symbol":"Logo","correct":"from logomaker import Logo"},{"note":"Utility function for loading example data, usually imported directly.","wrong":"import logomaker; logomaker.get_example_matrix","symbol":"get_example_matrix","correct":"from logomaker import get_example_matrix"}],"quickstart":{"code":"import logomaker\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Load an example matrix (e.g., position-weight matrix)\n# This returns a pandas DataFrame\nexample_df = logomaker.get_example_matrix('ww_matrix')\n\n# Create a Logo object from the DataFrame\nlogo = logomaker.Logo(example_df)\n\n# Customize the logo (optional)\nlogo.style_spines(visible=False)\nlogo.style_xticks(rotation=90, fmt='%d', anchor=0)\nlogo.highlight_position(p=6, color='gold')\nlogo.ax.set_ylabel('Information (bits)')\nlogo.ax.set_xlabel('Position')\nlogo.ax.set_title('RNA Binding Protein WW Domain Logo')\n\nplt.tight_layout()\nplt.show()","lang":"python","description":"This quickstart demonstrates how to load an example sequence matrix, create a `Logo` object, and apply basic styling before displaying the logo using Matplotlib."},"warnings":[{"fix":"Upgrade to logomaker version 0.8.2 or newer to benefit from performance improvements related to Matplotlib caching.","message":"Older 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.","severity":"gotcha","affected_versions":"<0.8.2"},{"fix":"Upgrade to logomaker version 0.8.2 or newer to ensure the `stack_order='fixed'` option works as intended.","message":"The `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.","severity":"gotcha","affected_versions":"<0.8.2"},{"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.","message":"Versions 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.","severity":"gotcha","affected_versions":"<0.8.3"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Change your import statement from `import logomaker` to `from logomaker import Logo`, and then use `Logo(...)` directly.","cause":"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.","error":"AttributeError: module 'logomaker' has no attribute 'Logo'"},{"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.","cause":"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.","error":"ValueError: Dataframe must have an index of positive integers."},{"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.","cause":"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.","error":"KeyError: 'A'"}]}