@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:

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

Examples

# Basic usage - runs Pfam 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 Pfam,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 Pfam,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 labelled 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