react-msaview (JBrowseMSA)

June 10, 2026 · View on GitHub

An interactive multiple sequence alignment viewer.

Protein alignment with tree

Features

  • Tree and alignment rendered together, tiled to stay fast on large inputs
  • Parses FASTA, Stockholm, Clustal, A3M, and EMF alignments and Newick/EMF trees
  • Protein domain overlays from InterProScan GFF (generate them with the CLI)
  • Protein and nucleotide color schemes, including per-column dynamic schemes
  • React component, UMD-in-HTML, and R htmlwidget entry points
  • Shareable view state and SVG export

Documentation

Jump to what you need:

You want to…Start here
Use the viewer — load data, explore, export an imageUser guide · live app · docs site
Embed the React component in your own appUsage & embedding guide · live code examples · model API reference
Use it from R (ape, Biostrings, ggtree, Shiny)R package README
Annotate protein domains from an alignmentCLI README — batch InterProScan → GFF
Contribute / hack on the codeDevelopment

Quick start (React)

npm install react-msaview @jbrowse/core @mui/material @emotion/react @emotion/styled react react-dom
import { MSAViewer } from 'react-msaview'

export default function App() {
  // backticks (template literal) so the \n become real newlines
  return (
    <MSAViewer
      msa={`>human\nMKAANSE\n>mouse\nMKA-NSE`}
      tree="(human:0.1,mouse:0.2);"
      colorScheme="clustal"
    />
  )
}

No model creation, width management, or theme provider needed. For the model-based API, UMD bundle, and full prop reference see USAGE.md, and browse runnable snippets in the live examples.

Quick start (R)

library(msaviewr)
msaview(msa = "alignment.fasta", tree = "tree.nwk", color_scheme = "clustal")

Hemoglobin alignment with tree

See the R package README for ape, Biostrings, ggtree, treeio, and Shiny usage.

Protein domains

Domain annotations (e.g. the GFF emitted by the CLI) overlay as labelled boxes on the alignment:

InterProScan domains

Packages

PackageDescription
packages/libMain react-msaview React component
packages/websiteDocs site (deployed at gmod.org/JBrowseMSA)
packages/appDemo application (deployed at gmod.org/JBrowseMSA/demo)
packages/examplesLive usage examples (deployed at the Storybook link above)
packages/cliCommand-line tools (batch InterProScan)
packages/msa-parsersMSA file format parsers
packages/r-msaviewR htmlwidget (ape/ggtree/Biostrings/treeio interop)
packages/svgcanvasSVG canvas rendering (ESM fork of svgcanvas)

Development

git clone https://github.com/GMOD/react-msaview
cd react-msaview
pnpm install
CommandWhat it does
pnpm devRun the demo app with hot reload (edits in packages/lib/src/)
pnpm --filter examples devRun the live examples gallery
pnpm buildBuild all packages
pnpm testRun the test suite
pnpm figuresRegenerate the README figures (headless SVG, packages/lib/scripts)
pnpm screenshotsRegenerate the user-guide app screenshots (scripts/screenshots)
pnpm lint / format / typecheckLint, format with Prettier, typecheck all packages

Architecture notes live in CLAUDE.md; the core state model is packages/lib/src/model.ts (MobX-state-tree), and observer-wrapped components re-render when observed model properties change.

Deployment

  • Docs site → gmod.org/JBrowseMSA, with the demo app at gmod.org/JBrowseMSA/demo. pnpm build:pages builds both into pages-dist/ (docs at the root, app under /demo); the Deploy docs site workflow publishes it to the gh-pages branch on every push to main. To deploy by hand: pnpm deploy:pages.
  • Examples gallery → jbrowse.org/storybook/msa is deployed separately and must be run locally (it needs AWS credentials): pnpm deploy:storybook.

Releasing

Run scripts/release.js to create and push a new git tag. We use npm trusted publishing, so pushing a tag to GitHub launches the npm release automatically.

Builds on abrowse and phylo-react.