{"id":19234299,"url":"https://github.com/moshi4/pymsaviz","last_synced_at":"2025-05-07T16:09:49.035Z","repository":{"id":63126019,"uuid":"565401161","full_name":"moshi4/pyMSAviz","owner":"moshi4","description":"MSA(Multiple Sequence Alignment) visualization python package for sequence analysis","archived":false,"fork":false,"pushed_at":"2024-12-01T07:59:16.000Z","size":7553,"stargazers_count":125,"open_issues_count":0,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T16:09:37.249Z","etag":null,"topics":["bioinformatics","genomics","matplotlib","msa","multiple-sequence-alignment","python","sequence-alignment","sequence-analysis","visualization"],"latest_commit_sha":null,"homepage":"https://moshi4.github.io/pyMSAviz","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moshi4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-13T09:39:51.000Z","updated_at":"2025-05-04T19:26:09.000Z","dependencies_parsed_at":"2024-09-08T11:23:29.820Z","dependency_job_id":"89966377-0f54-4469-9954-5f9943dcb00b","html_url":"https://github.com/moshi4/pyMSAviz","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FpyMSAviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FpyMSAviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FpyMSAviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moshi4%2FpyMSAviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moshi4","download_url":"https://codeload.github.com/moshi4/pyMSAviz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252912996,"owners_count":21824066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","genomics","matplotlib","msa","multiple-sequence-alignment","python","sequence-alignment","sequence-analysis","visualization"],"created_at":"2024-11-09T16:13:23.790Z","updated_at":"2025-05-07T16:09:49.005Z","avatar_url":"https://github.com/moshi4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyMSAviz\n\n![Python3](https://img.shields.io/badge/Language-Python3-steelblue)\n![OS](https://img.shields.io/badge/OS-_Windows_|_Mac_|_Linux-steelblue)\n![License](https://img.shields.io/badge/License-MIT-steelblue)\n[![Latest PyPI version](https://img.shields.io/pypi/v/pymsaviz.svg)](https://pypi.python.org/pypi/pymsaviz)\n[![Bioconda](https://img.shields.io/conda/vn/bioconda/pymsaviz.svg?color=green)](https://anaconda.org/bioconda/pymsaviz)\n[![CI](https://github.com/moshi4/pyMSAviz/actions/workflows/ci.yml/badge.svg)](https://github.com/moshi4/pyMSAviz/actions/workflows/ci.yml)\n\n## Table of contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [API Usage](#api-usage)\n- [CLI Usage](#cli-usage)\n\n## Overview\n\npyMSAviz is a MSA(Multiple Sequence Alignment) visualization python package for sequence analysis implemented based on matplotlib.\nThis package is developed for the purpose of easily and beautifully plotting MSA in Python.\nIt also implements the functionality to add markers, text annotations, highlights to specific positions and ranges in MSA.\npyMSAviz was developed inspired by [Jalview](https://www.jalview.org/) and [ggmsa](https://github.com/YuLab-SMU/ggmsa).\nMore detailed documentation is available [here](https://moshi4.github.io/pyMSAviz/).\n\n![example01.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/api_example01.png)  \n**Fig.1 Simple visualization result**\n\n![example03.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/api_example03.png)  \n**Fig.2 Customized visualization result**\n\n## Installation\n\n`Python 3.9 or later` is required for installation.\n\n**Install PyPI package:**\n\n    pip install pymsaviz\n\n**Install bioconda package:**\n\n    conda install -c conda-forge -c bioconda pymsaviz\n\n## API Usage\n\nOnly simple example usage is described in this section.\nFor more details, please see [Getting Started](https://moshi4.github.io/pyMSAviz/getting_started/) and [API Docs](https://moshi4.github.io/pyMSAviz/api-docs/msaviz/).\n\n### API Example\n\n#### API Example 1\n\n```python\nfrom pymsaviz import MsaViz, get_msa_testdata\n\nmsa_file = get_msa_testdata(\"HIGD2A.fa\")\nmv = MsaViz(msa_file, wrap_length=60, show_count=True)\nmv.savefig(\"api_example01.png\")\n```\n\n![example01.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/api_example01.png)  \n\n#### API Example 2\n\n```python\nfrom pymsaviz import MsaViz, get_msa_testdata\n\nmsa_file = get_msa_testdata(\"MRGPRG.fa\")\nmv = MsaViz(msa_file, color_scheme=\"Taylor\", wrap_length=80, show_grid=True, show_consensus=True)\nmv.savefig(\"api_example02.png\")\n```\n\n![example02.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/api_example02.png)  \n\n#### API Example 3\n\n```python\nfrom pymsaviz import MsaViz, get_msa_testdata\n\nmsa_file = get_msa_testdata(\"MRGPRG.fa\")\nmv = MsaViz(msa_file, end=180, wrap_length=60, show_consensus=True)\n\n# Extract MSA positions less than 50% consensus identity\npos_ident_less_than_50 = []\nident_list = mv._get_consensus_identity_list()\nfor pos, ident in enumerate(ident_list, 1):\n    if ident \u003c= 50:\n        pos_ident_less_than_50.append(pos)\n\n# Add markers\nmv.add_markers([1])\nmv.add_markers([10, 20], color=\"orange\", marker=\"o\")\nmv.add_markers([30, (40, 50), 55], color=\"green\", marker=\"+\")\nmv.add_markers(pos_ident_less_than_50, marker=\"x\", color=\"blue\")\n# Add text annotations\nmv.add_text_annotation((76, 102), \"Gap Region\", text_color=\"red\", range_color=\"red\")\nmv.add_text_annotation((112, 123), \"Gap Region\", text_color=\"green\", range_color=\"green\")\n\nmv.savefig(\"api_example03.png\")\n```\n\n![example03.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/api_example03.png)  \n\n## CLI Usage\n\npyMSAviz provides simple MSA visualization CLI.\n\n### Basic Command\n\n    pymsaviz -i [MSA file] -o [MSA visualization file]\n\n### Options\n\n    $ pymsaviz --help\n    usage: pymsaviz [options] -i msa.fa -o msa_viz.png\n\n    MSA(Multiple Sequence Alignment) visualization CLI tool\n\n    optional arguments:\n      -i I, --infile I    Input MSA file\n      -o O, --outfile O   Output MSA visualization file (*.png|*.jpg|*.svg|*.pdf)\n      --format            MSA file format (Default: 'fasta')\n      --color_scheme      Color scheme (Default: 'Zappo')\n      --start             Start position of MSA visualization (Default: 1)\n      --end               End position of MSA visualization (Default: 'MSA Length')\n      --wrap_length       Wrap length (Default: None)\n      --wrap_space_size   Space size between wrap MSA plot area (Default: 3.0)\n      --label_type        Label type ('id'[default]|'description')\n      --show_grid         Show grid (Default: OFF)\n      --show_count        Show seq char count without gap on right side (Default: OFF)\n      --show_consensus    Show consensus sequence (Default: OFF)\n      --consensus_color   Consensus identity bar color (Default: '#1f77b4')\n      --consensus_size    Consensus identity bar height size (Default: 2.0)\n      --sort              Sort MSA order by NJ tree constructed from MSA distance matrix (Default: OFF)\n      --dpi               Figure DPI (Default: 300)\n      -v, --version       Print version information\n      -h, --help          Show this help message and exit\n\n    Available Color Schemes:\n    ['Clustal', 'Zappo', 'Taylor', 'Flower', 'Blossom', 'Sunset', 'Ocean', 'Hydrophobicity', 'HelixPropensity', 'StrandPropensity', 'TurnPropensity', 'BuriedIndex', 'Nucleotide', 'Purine/Pyrimidine', 'Identity', 'None']\n\n### CLI Example\n\nClick [here](https://github.com/moshi4/pyMSAviz/raw/main/example/example.zip) to download example MSA files.  \n\n#### CLI Example 1\n\n    pymsaviz -i ./example/HIGD2A.fa -o cli_example01.png --color_scheme Identity\n\n![example01.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/cli_example01.png)  \n\n#### CLI Example 2\n\n    pymsaviz -i ./example/MRGPRG.fa -o cli_example02.png --wrap_length 80 \\\n             --color_scheme Taylor --show_consensus --show_count\n\n![example02.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/cli_example02.png)  \n\n#### CLI Example 3\n\n    pymsaviz -i ./example/MRGPRG.fa -o cli_example03.png --start 100 --end 160 \\\n             --color_scheme Flower --show_grid --show_consensus --consensus_color tomato \n\n![example03.png](https://raw.githubusercontent.com/moshi4/pyMSAviz/main/docs/images/cli_example03.png)  \n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=moshi4/pyMSAviz\u0026type=Date)](https://star-history.com/#moshi4/pyMSAviz\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshi4%2Fpymsaviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoshi4%2Fpymsaviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoshi4%2Fpymsaviz/lists"}