@react-msaview/cli

Command-line tools for react-msaview (JBrowseMSA), including batch InterProScan processing for multiple sequence alignments.

Uses msa-parsers for file format support.

Installation

# From the monorepo root
pnpm install
pnpm --filter @react-msaview/cli build

# Or install globally (after publishing)
npm install -g @react-msaview/cli

Commands

interproscan

Run InterProScan on all sequences in an MSA file and output results as GFF3.

react-msaview-cli interproscan <input-msa> [options]

Options

OptionDescriptionDefault
-o, --output <file>Output GFF file pathdomains.gff
--localUse a local InterProScan installation instead of EBIfalse
--dockerRun InterProScan via the interpro/interproscan imagefalse
--singularityRun InterProScan via a Singularity/Apptainer containerfalse
--singularity-image <img>Singularity image to usedocker://interpro/interproscan:latest
--interproscan-path <path>Path to local interproscan.shinterproscan.sh
--programs <list>Comma-separated list of InterProScan programsPfamA,CDD
--email <email>Email for EBI API (used only for EBI API runs)user@example.com
-h, --helpShow help message

By default (no backend flag) the CLI submits sequences to the EBI InterProScan REST API one at a time. --local, --docker, and --singularity instead run InterProScan on the whole alignment locally, which is much faster for large datasets.

Supported MSA formats

The CLI automatically detects the input format:

Available InterProScan programs

When using --programs, you can specify any combination of:

interpro

Build a domain GFF from InterPro’s precomputed matches for UniProtKB accessions, instead of submitting sequences to a live InterProScan job. Every UniProtKB sequence already has InterPro matches computed and served by the EBI InterPro API, so for inputs that are real UniProt accessions this is instant, deterministic, and version-pinnable — no email or rate-limited job submission. Prefer this over interproscan whenever your rows are UniProt accessions.

react-msaview-cli interpro <accessions.tsv> [options]

The input is one accession per line, optionally followed by a tab- or space-separated row label; lines starting with # are ignored. The output GFF is byte-for-byte compatible with the interproscan command.

Options

OptionDescriptionDefault
-o, --output <file>Output GFF file pathdomains.gff
--database <name>InterPro member db to readpfam
react-msaview-cli interpro accessions.tsv -o domains.gff
react-msaview-cli interpro accessions.tsv -o domains.gff --database cdd

genestructure

Build a gene-structure GFF for a coding-sequence alignment from a RefSeq transcript, overlaid in react-msaview the same way InterProScan domains are. The exon model is fetched from the NCBI Datasets v2 API; each species’ Nth exon is named exon-N, so a given exon is the same color in every row and the exon architecture reads straight down the alignment.

react-msaview-cli genestructure <input-msa> --gene <symbol> --ref <rowname> [options]

The exon boundaries of the chosen transcript are mapped onto the reference row’s columns, then projected into every other row’s own ungapped coordinates — so an exon that picks up a frameshifting indel in one lineage gets shorter on exactly that row while staying column-aligned with the rest. The reference row must be the transcript’s coding sequence (the CLI warns if its length doesn’t match).

Options

OptionDescriptionDefault
--gene <symbol>Gene symbol to look up in RefSeq (e.g. F12)
--taxon <name|id>Taxon for --genehuman
--gene-id <id>NCBI GeneID, instead of --gene
--transcript <acc>Specific transcript accessionMANE/RefSeq Select
--ref <rowname>Reference row = the transcript’s CDSfirst row
-o, --output <file>Output GFF file pathgenestructure.gff
# F12 coding alignment -> 14-exon overlay (MANE Select transcript, human row)
react-msaview-cli genestructure f12-cds.stock --gene F12 --ref human -o exons.gff

# pin a specific transcript
react-msaview-cli genestructure aln.fa --transcript NM_000505.4 --ref human

export-svg

Render an alignment (with an optional tree and domain overlay) straight to a standalone SVG — no browser required. This is what the R package shells out to for vector export.

react-msaview-cli export-svg --msa <file> [options]

Options

OptionDescriptionDefault
--msa <file>MSA file (FASTA, Stockholm, or Clustal)required
--tree <file>Newick tree file
--gff <file>InterProScan domain GFF file
-o, --output <file>Output SVG file pathalignment.svg
--color-scheme <name>Color schememaeditor
--width <px>Canvas width in pixels1200
--height <px>Canvas height in pixels600
--tree-area-width <px>Tree panel width in pixels
react-msaview-cli export-svg --msa alignment.fasta -o alignment.svg
react-msaview-cli export-svg --msa alignment.fasta --tree tree.nwk -o alignment.svg
react-msaview-cli export-svg --msa alignment.fasta --gff domains.gff \
  --color-scheme clustalx_protein_dynamic -o alignment.svg

Examples

# Basic usage - runs the default PfamA + CDD analysis
react-msaview-cli interproscan alignment.fasta -o domains.gff --email your@email.com

# Multiple programs
react-msaview-cli interproscan alignment.fasta -o domains.gff \
  --programs PfamA,SMART,Gene3D \
  --email your@email.com

Using local InterProScan

For large datasets or frequent usage, install InterProScan locally:

# With interproscan.sh in PATH
react-msaview-cli interproscan alignment.fasta -o domains.gff --local

# With custom path
react-msaview-cli interproscan alignment.fasta -o domains.gff \
  --local \
  --interproscan-path /opt/interproscan/interproscan.sh

# With specific programs
react-msaview-cli interproscan alignment.fasta -o domains.gff \
  --local \
  --programs PfamA,SMART

Using Docker

No local InterProScan install needed — just Docker:

react-msaview-cli interproscan alignment.fasta -o domains.gff --docker

This mounts a temp directory into the interpro/interproscan container, runs the scan on the whole alignment at once, and reads the JSON back out.

Using Singularity / Apptainer

On HPC clusters where Docker is unavailable:

# Pull from Docker Hub (requires network)
react-msaview-cli interproscan alignment.fasta -o domains.gff --singularity

# Or use a pre-pulled .sif image
react-msaview-cli interproscan alignment.fasta -o domains.gff \
  --singularity \
  --singularity-image /path/to/interproscan.sif

Different input formats

# Clustal format
react-msaview-cli interproscan alignment.clustal -o domains.gff

# Stockholm format
react-msaview-cli interproscan PF00001.stockholm -o domains.gff

# A3M format (from ColabFold/AlphaFold)
react-msaview-cli interproscan colabfold.a3m -o domains.gff

Worked example

$ react-msaview-cli interproscan gpcrs.fasta -o domains.gff --docker
Reading MSA from gpcrs.fasta...
Found 4 sequences
Processing 4 non-empty sequences...
Running InterProScan via Docker...
  Running InterProScan via Docker on 4 sequences (image: interpro/interproscan:latest)...
  docker run --rm -v /tmp/interproscan-Xyz12:/data interpro/interproscan:latest -i /data/input.fasta -o /data/output.json -f JSON -appl PfamA,CDD
Converting results to GFF...
Writing output to domains.gff...
Done!

Output format

The output is standard GFF3, with one protein_match line per domain hit. start/end are 1-based positions in the ungapped sequence (gaps are stripped before scanning), and the attributes carry the signature accession, name, and description:

##gff-version 3
seq1	InterProScan	protein_match	10	150	.	.	.	Name=PF00001;signature_desc=7tm_1;description=7 transmembrane receptor (rhodopsin family)
seq1	InterProScan	protein_match	200	350	.	.	.	Name=PF00002;signature_desc=7tm_2;description=7 transmembrane receptor (Secretin family)
seq2	InterProScan	protein_match	5	120	.	.	.	Name=PF00001;signature_desc=7tm_1;description=7 transmembrane receptor (rhodopsin family)

Loading results in react-msaview

After generating the GFF file, you can load it in react-msaview:

In the React component, pass it inline as the gff prop (see the “Protein domains” example in packages/examples):

<MSAViewer msa={msaText} gff={domainsGff} />

From R, pass the file (or string) as the gff argument:

msaview(msa = "alignment.fasta", gff = "domains.gff")

The domains render as labeled boxes over the matching rows:

InterProScan domains rendered over an alignment

Troubleshooting

EBI API timeout

If you get timeout errors with the EBI API:

Local InterProScan not found

Error: Failed to run Local: spawn interproscan.sh ENOENT. Is interproscan.sh installed and on PATH?

Make sure InterProScan is installed and specify the full path:

--interproscan-path /full/path/to/interproscan-5.xx/interproscan.sh

No results in output

API rate limits

The EBI InterProScan API has usage limits:

License

MIT