Skip to main content

monoseq

monoseq is a Python library for pretty-printing sequence strings using a monospace font. It also provides a simple command line interface.

Sequences are pretty-printed in the for DNA and proteins traditional way using blocks of letters where each line is prefixed with the sequence position. User-specified regions are highlighted using different formatting styles. The output format can be HTML or plaintext with optional styling using ANSI escape codes for use in a terminal.

>>> import monoseq
>>> sequence = 'MIMANQPLWLDSEVEMNHYQQSHIKSKSPYFPEDKHICWIKIFKAFGT' * 4
>>> print monoseq.pprint_sequence(sequence, mode='plaintext')
  1  MIMANQPLWL DSEVEMNHYQ QSHIKSKSPY FPEDKHICWI KIFKAFGTMI MANQPLWLDS
 61  EVEMNHYQQS HIKSKSPYFP EDKHICWIKI FKAFGTMIMA NQPLWLDSEV EMNHYQQSHI
121  KSKSPYFPED KHICWIKIFK AFGTMIMANQ PLWLDSEVEM NHYQQSHIKS KSPYFPEDKH
181  ICWIKIFKAF GT

This screenshot shows the use of ANSI escape codes:

Example of formatting with ANSI escape codes

Here is an example of monoseq used to output HTML, and this IPython Notebook shows how to pretty-print sequences in an IPython Notebook.

To install the latest release via PyPI using pip:

pip install monoseq

Documentation

The latest documentation with user guide and API reference is hosted at Read The Docs.

You can also compile the documentation directly from the source code by running make html from the doc/ subdirectory. This requires Sphinx to be installed.

Metadata

Release files for monoseq 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monoseq 1.2.1
File Size Uploaded Provenance Actions
monoseq-1.2.1.tar.gz 8.3 kB Without provenance Details for monoseq-1.2.1.tar.gz

Release files / monoseq-1.2.1.tar.gz

Download URL monoseq-1.2.1.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
90165c271bf1c409f32ec8a26fd09b1f4a07afd3e2dbd958c70cd9f0dd67c4de
BLAKE2b-256 checksum
How to use checksums
3dc74bdad56cf87743ab381d706e2ee7a487b08e1719616c598b3c94d56658d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for monoseq 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page