A Rich renderable for viewing Multiple Sequence Alignments in the terminal.
Project description
rich-msa
A simple module to render colorful Multiple Sequence Alignment with rich
in the terminal.
🔧 Installing
Install the rich-msa
package directly from PyPi
which hosts universal wheels that can be installed with pip
:
$ pip install rich-msa
💡 Example
Use Biopython to load a MSA from an aligned FASTA file, and render it to the terminal:
import Bio.AlignIO
import rich
from rich_msa import RichAlignment
msa = Bio.AlignIO.read("tests/data/swissprot-halorhodopsin.muscle.afa", "fasta")
viewer = RichAlignment(
names=[record.id for record in msa],
sequences=[str(record.seq) for record in msa],
)
panel = rich.panel.Panel(viewer, title="swissprot-halorhodopsin.muscle.afa")
rich.print(panel)
You should get an output similar to the following picture, scaled to your terminal width:
🪛 Command-Line
If you have the rich-msa
library installed from PyPI, you can use it directly
to view any alignment file, provided you have Biopython installed:
$ python -m rich_msa -i tests/data/swissprot-halorhodopsin.muscle.afa
Use the -f
flag to change the file format from aligned FASTA (default) to
any alignment format supported by Biopython.
💭 Feedback
⚠️ Issue Tracker
Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.
🏗️ Contributing
Contributions are more than welcome! See
CONTRIBUTING.md
for more details.
⚖️ License
This library is provided under the MIT License.
This project is in no way not affiliated, sponsored, or otherwise endorsed by the original Rich authors. It was developed by Martin Larralde during his PhD project at the European Molecular Biology Laboratory in the Zeller team.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rich-msa-0.1.0.tar.gz
.
File metadata
- Download URL: rich-msa-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fd78e16ab4e496f365512eb84a85c3352844e5972ef22d1bf682632482bd664 |
|
MD5 | 4b7afae4a6ec532be150f675b0210af0 |
|
BLAKE2b-256 | 858db57eb3386f9f62c00fd5c6c6d31f0a24227b4b86b762d1340e0656755034 |
File details
Details for the file rich_msa-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: rich_msa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbd7e7a479fff956d3473bb806b66e760f1a10e0569fb703e9e499f1c29ee3c2 |
|
MD5 | 6bbb2db4525538c39d61345e12e2048c |
|
BLAKE2b-256 | fdd9a8efa90c881ff4e6f223b7d07db99447d7f1c0c2b8e8998cd8d30c1d8a8e |