百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pyMSAviz

> 数据库
开源

用于序列分析的 MSA(多序列对齐)可视化 Python 包

197 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于序列分析的 MSA(多序列对齐)可视化 Python 包

pyMSAviz

Table of contents

  • Overview
  • Installation
  • API Usage
  • CLI Usage

Overview

pyMSAviz is a MSA(Multiple Sequence Alignment) visualization python package for sequence analysis implemented based on matplotlib. This package is developed for the purpose of easily and beautifully plotting MSA in Python. It also implements the functionality to add markers, text annotations, highlights to specific positions and ranges in MSA. pyMSAviz was developed inspired by Jalview and ggmsa. More detailed documentation is available here.

Fig.1 Simple visualization result

Fig.2 Customized visualization result

Installation

Python 3.9 or later is required for installation.

Install PyPI package:

bash
pip install pymsaviz

Install bioconda package:

conda install -c conda-forge -c bioconda pymsaviz

API Usage

Only simple example usage is described in this section. For more details, please see Getting Started and API Docs.

API Example

API Example 1

python
from pymsaviz import MsaViz, get_msa_testdata

msa_file = get_msa_testdata("HIGD2A.fa")
mv = MsaViz(msa_file, wrap_length=60, show_count=True)
mv.savefig("api_example01.png")

API Example 2

python
from pymsaviz import MsaViz, get_msa_testdata

msa_file = get_msa_testdata("MRGPRG.fa")
mv = MsaViz(msa_file, color_scheme="Taylor", wrap_length=80, show_grid=True, show_consensus=True)
mv.savefig("api_example02.png")

API Example 3

…

CLI Usage

pyMSAviz provides simple MSA visualization CLI.

Basic Command

pymsaviz -i [MSA file] -o [MSA visualization file]

Options

$ pymsaviz --help
usage: pymsaviz [options] -i msa.fa -o msa_viz.png

MSA(Multiple Sequence Alignment) visualization CLI tool

optional arguments:
  -i I, --infile I    Input MSA file
  -o O, --outfile O   Output MSA visualization file (*.png|*.jpg|*.svg|*.pdf)
  --format            MSA file format (Default: 'fasta')
  --color_scheme      Color scheme (Default: 'Zappo')
  --start             Start position of MSA visualization (Default: 1)
  --end               End position of MSA visualization (Default: 'MSA Length')
  --wrap_length       Wrap length (Default: None)
  --wrap_space_size   Space size between wrap MSA plot area (Default: 3.0)
  --label_type        Label type ('id'[default]|'description')
  --show_grid         Show grid (Default: OFF)
  --show_count        Show seq char count without gap on right side (Default: OFF)
  --show_consensus    Show consensus sequence (Default: OFF)
  --consensus_color   Consensus identity bar color (Default: '#1f77b4')
  --consensus_size    Consensus identity bar height size (Default: 2.0)
  --sort              Sort MSA order by NJ tree constructed from MSA distance matrix (Default: OFF)
  --dpi               Figure DPI (Default: 300)
  -v, --version       Print version information
  -h, --help          Show this help message and exit

Available Color Schemes:
['Clustal', 'Zappo', 'Taylor', 'Flower', 'Blossom', 'Sunset', 'Ocean', 'Hydrophobicity', 'HelixPropensity', 'StrandPropensity', 'TurnPropensity', 'BuriedIndex', 'Nucleotide', 'Purine/Pyrimidine', 'Identity', 'None']

CLI Example

Click here to download example MSA files.

CLI Example 1

pymsaviz -i ./example/HIGD2A.fa -o cli_example01.png --color_scheme Identity

CLI Example 2

bash
pymsaviz -i ./example/MRGPRG.fa -o cli_example02.png --wrap_length 80 \
         --color_scheme Taylor --show_consensus --show_count

CLI Example 3

bash
pymsaviz -i ./example/MRGPRG.fa -o cli_example03.png --start 100 --end 160 \
         --color_scheme Flower --show_grid --show_consensus --consensus_color tomato 

Star History

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonbioinformaticsgenomicsmatplotlibmsa

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库