react-msaview-cli 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -62
- package/dist/index.js +24097 -23728
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -10,14 +10,15 @@ The CLI has two groups of commands, and the second draws what the first writes:
|
|
|
10
10
|
a RefSeq transcript's exon model (`genestructure`), and relate rows to 3D
|
|
11
11
|
structures (`residue-mappings`).
|
|
12
12
|
- **Render**: draw the alignment, its tree, and those annotations to a
|
|
13
|
-
standalone SVG (`export-svg`). The command runs the web viewer's
|
|
14
|
-
headlessly, so the figure matches what the app shows.
|
|
13
|
+
standalone SVG, PNG or PDF (`export-svg`). The command runs the web viewer's
|
|
14
|
+
renderer headlessly, so the figure matches what the app shows.
|
|
15
15
|
|
|
16
16
|
## Prerequisites
|
|
17
17
|
|
|
18
18
|
- NodeJS v22+
|
|
19
19
|
|
|
20
|
-
`export-svg`, `interpro` and `residue-mappings` need nothing else
|
|
20
|
+
`export-svg`, `interpro` and `residue-mappings` need nothing else, except that
|
|
21
|
+
`export-svg` writes PNG and PDF through `rsvg-convert` from librsvg.
|
|
21
22
|
`interproscan` needs a backend to scan with: the EBI web API (the default, no
|
|
22
23
|
install), Docker, Singularity, or a local InterProScan (see
|
|
23
24
|
[interproscan](#interproscan)).
|
|
@@ -73,23 +74,31 @@ GPCR examples in
|
|
|
73
74
|
react-msaview-cli export-svg --msa <file> [options]
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
| `--
|
|
81
|
-
| `--
|
|
82
|
-
|
|
|
83
|
-
| `--
|
|
84
|
-
| `--
|
|
85
|
-
| `--
|
|
86
|
-
|
|
|
87
|
-
| `--
|
|
88
|
-
| `--
|
|
89
|
-
| `--
|
|
90
|
-
| `--
|
|
91
|
-
| `--
|
|
92
|
-
| `--
|
|
77
|
+
<!-- options:export-svg -->
|
|
78
|
+
|
|
79
|
+
| Option | Description | Default |
|
|
80
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------ | --------------------------------- |
|
|
81
|
+
| `--spec <file.json>` | View spec or snapshot, with any layer from docs/layers.md; the flags below override it | |
|
|
82
|
+
| `--props <file.json>` | MSAViewer props as the R and Python widgets send them, in place of `--spec` | |
|
|
83
|
+
| `--msa <file>` | MSA file (FASTA, Stockholm, Clustal, A3M, EMF); required without `--spec` or `--props` | |
|
|
84
|
+
| `--format <name>` | Force the MSA format (stockholm, fasta, a3m, clustal, emf) instead of sniffing it | |
|
|
85
|
+
| `--tree <file>` | Newick tree file | |
|
|
86
|
+
| `--gff <file>` | Domain or exon GFF, or InterProScan JSON | |
|
|
87
|
+
| `-o, --output <file>` | Output file; `.svg`, `.png` or `.pdf` picks the format, and PNG and PDF need rsvg-convert from librsvg | `alignment.svg` |
|
|
88
|
+
| `--scale <n>` | Pixels per SVG unit in a PNG | `2` |
|
|
89
|
+
| `--color-scheme <name>` | Color scheme | `maeditor` |
|
|
90
|
+
| `--theme <light\|dark>` | Page and text colors | the `--props` theme, else `light` |
|
|
91
|
+
| `--width <px>` | Viewport width, which sets the tree area | `1200` |
|
|
92
|
+
| `--height <px>` | Viewport height | `600` |
|
|
93
|
+
| `--tree-area-width <px>` | Tree panel width in pixels | fit to the labels |
|
|
94
|
+
| `--col-width <px>` | Width of one alignment column | `12` |
|
|
95
|
+
| `--row-height <px>` | Height of one alignment row | `16` |
|
|
96
|
+
| `--tracks <list>` | Tracks to draw above the alignment, by id (`conservation,position-ruler`), or `all` | none |
|
|
97
|
+
| `--viewport` | Draw the `--width` x `--height` viewport at the top left instead of the entire alignment | |
|
|
98
|
+
| `--minimap` | Include the minimap bar (`--viewport` only) | |
|
|
99
|
+
| `--force` | Export past the 500,000-letter limit, where the export can run out of memory | |
|
|
100
|
+
|
|
101
|
+
<!-- /options -->
|
|
93
102
|
|
|
94
103
|
### Tracks
|
|
95
104
|
|
|
@@ -169,14 +178,22 @@ so conserved columns stand out by color. `nucleotide`, `clustalx_dna`,
|
|
|
169
178
|
The SVG grows with the alignment: a 10-row by 856-column figure is about 700KB.
|
|
170
179
|
The background is one embedded image where @napi-rs/canvas is installed, and a
|
|
171
180
|
rectangle per cell where it is not. The letters, the tree and the annotations
|
|
172
|
-
are vector either way.
|
|
181
|
+
are vector either way.
|
|
182
|
+
|
|
183
|
+
An `-o` ending in `.png` or `.pdf` converts the SVG with `rsvg-convert` from
|
|
184
|
+
librsvg (`apt install librsvg2-bin`, `brew install librsvg`). A PDF keeps the
|
|
185
|
+
letters, the tree and the annotations vector. `--scale` sets the pixels per SVG
|
|
186
|
+
unit of a PNG, 2 by default:
|
|
173
187
|
|
|
174
188
|
```bash
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
react-msaview-cli export-svg --msa kinases.aln --tree kinases.nwk -o kinases.pdf
|
|
190
|
+
react-msaview-cli export-svg --msa kinases.aln --scale 4 -o kinases.png
|
|
177
191
|
```
|
|
178
192
|
|
|
179
|
-
The same input gives the same bytes, so CI can regenerate a
|
|
193
|
+
The same input gives the same bytes on one machine, so CI can regenerate a
|
|
194
|
+
figure and diff it. With @napi-rs/canvas installed, the export measures labels
|
|
195
|
+
with that machine's fonts, so the tree area can come out a few pixels wider or
|
|
196
|
+
narrower on another machine.
|
|
180
197
|
|
|
181
198
|
## Annotating
|
|
182
199
|
|
|
@@ -200,13 +217,17 @@ id or anything else InterPro does not key by; run `interproscan` on those. It
|
|
|
200
217
|
writes through the same GFF writer as `interproscan`, and adds a `#` header line
|
|
201
218
|
naming the InterPro release the coordinates came from.
|
|
202
219
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
| `--
|
|
209
|
-
| `--
|
|
220
|
+
<!-- options:interpro -->
|
|
221
|
+
|
|
222
|
+
| Option | Description | Default |
|
|
223
|
+
| --------------------- | ----------------------------------------------------------------------------------- | ------------- |
|
|
224
|
+
| `-o, --output <file>` | Output GFF file | `domains.gff` |
|
|
225
|
+
| `--database <name>` | InterPro member database to read | `pfam` |
|
|
226
|
+
| `--msa <file>` | Alignment the GFF is for; the CLI checks each row's ungapped length against UniProt | |
|
|
227
|
+
| `--format <name>` | Force the `--msa` format instead of sniffing it | |
|
|
228
|
+
| `--no-cache` | Re-fetch every accession, ignoring the disk cache | |
|
|
229
|
+
|
|
230
|
+
<!-- /options -->
|
|
210
231
|
|
|
211
232
|
InterPro computes matches on UniProt's canonical sequence. A label ending in
|
|
212
233
|
`/start-end`, as Pfam and Stockholm name a fragment row (`P12931/84-145`), moves
|
|
@@ -248,19 +269,23 @@ proteins, or anything else InterPro has not scanned.
|
|
|
248
269
|
react-msaview-cli interproscan <input-msa> [options]
|
|
249
270
|
```
|
|
250
271
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
| `--
|
|
257
|
-
| `--docker
|
|
258
|
-
| `--singularity
|
|
259
|
-
| `--
|
|
260
|
-
| `--
|
|
261
|
-
| `--
|
|
262
|
-
| `--
|
|
263
|
-
| `--
|
|
272
|
+
<!-- options:interproscan -->
|
|
273
|
+
|
|
274
|
+
| Option | Description | Default |
|
|
275
|
+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
276
|
+
| `-o, --output <file>` | Output GFF file | `domains.gff` |
|
|
277
|
+
| `--local` | Run a local InterProScan installation instead of the EBI API | |
|
|
278
|
+
| `--docker` | Run InterProScan in the `interpro/interproscan` Docker image | |
|
|
279
|
+
| `--singularity` | Run InterProScan in a Singularity/Apptainer container | |
|
|
280
|
+
| `--docker-image <image>` | Docker image to run | `interpro/interproscan:5.78-109.0` |
|
|
281
|
+
| `--singularity-image <image>` | Singularity image to run | `docker://interpro/interproscan:5.78-109.0` |
|
|
282
|
+
| `--interproscan-path <path>` | Path to a local interproscan.sh | `interproscan.sh` |
|
|
283
|
+
| `--interproscan-data <dir>` | Host directory holding the member database `data/` to mount into the container, which the image ships without | |
|
|
284
|
+
| `--programs <list>` | Comma-separated programs in the EBI API's naming; the container and local backends get the InterProScan 5 names | `PfamA,CDD` |
|
|
285
|
+
| `--format <name>` | Force the MSA format (stockholm, fasta, a3m, clustal, emf) instead of sniffing it | |
|
|
286
|
+
| `--email <email>` | Email for the EBI API, which only EBI runs send | `user@example.com` |
|
|
287
|
+
|
|
288
|
+
<!-- /options -->
|
|
264
289
|
|
|
265
290
|
By default (no backend flag) the CLI submits sequences to the EBI InterProScan
|
|
266
291
|
REST API one at a time. `--local`, `--docker`, and `--singularity` run
|
|
@@ -331,14 +356,19 @@ shorter on that row and stays in the same columns as the rest. The reference row
|
|
|
331
356
|
must be the transcript's coding sequence; the CLI warns if its length doesn't
|
|
332
357
|
match.
|
|
333
358
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
|
337
|
-
|
|
|
338
|
-
| `--gene
|
|
339
|
-
| `--
|
|
340
|
-
| `--
|
|
341
|
-
|
|
|
359
|
+
<!-- options:genestructure -->
|
|
360
|
+
|
|
361
|
+
| Option | Description | Default |
|
|
362
|
+
| --------------------- | --------------------------------------------------------------------------------- | ------------------- |
|
|
363
|
+
| `--gene <symbol>` | Gene symbol to look up in RefSeq (e.g. `F12`) | |
|
|
364
|
+
| `--taxon <name\|id>` | Taxon for `--gene` | `human` |
|
|
365
|
+
| `--gene-id <id>` | NCBI GeneID, instead of `--gene` | |
|
|
366
|
+
| `--transcript <acc>` | Specific transcript accession | MANE/RefSeq Select |
|
|
367
|
+
| `--ref <rowname>` | Reference row, which must be the transcript's CDS | first row |
|
|
368
|
+
| `--format <name>` | Force the MSA format (stockholm, fasta, a3m, clustal, emf) instead of sniffing it | |
|
|
369
|
+
| `-o, --output <file>` | Output GFF file | `genestructure.gff` |
|
|
370
|
+
|
|
371
|
+
<!-- /options -->
|
|
342
372
|
|
|
343
373
|
```bash
|
|
344
374
|
## F12 coding alignment -> 14-exon overlay (MANE Select transcript, human row)
|
|
@@ -362,16 +392,21 @@ react-msaview-cli residue-mappings --msa <file> --row <name> --accession <acc> \
|
|
|
362
392
|
react-msaview-cli residue-mappings --msa <file> --rows <tsv> [-o mappings.json]
|
|
363
393
|
```
|
|
364
394
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
|
368
|
-
|
|
|
369
|
-
| `--
|
|
370
|
-
| `--
|
|
371
|
-
| `--
|
|
372
|
-
| `--
|
|
373
|
-
| `--
|
|
374
|
-
|
|
|
395
|
+
<!-- options:residue-mappings -->
|
|
396
|
+
|
|
397
|
+
| Option | Description | Default |
|
|
398
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------- | ------- |
|
|
399
|
+
| `--msa <file>` | Alignment holding the rows (required) | |
|
|
400
|
+
| `--format <name>` | Force the MSA format (stockholm, fasta, a3m, clustal, emf) instead of sniffing it | |
|
|
401
|
+
| `--rows <tsv>` | `row`, `accession`, `structure` per line, tab-separated, where the structure is `6VXX:A` or `alphafold` | |
|
|
402
|
+
| `--row <name>` | One row, instead of `--rows` | |
|
|
403
|
+
| `--accession <acc>` | The row's UniProtKB accession | |
|
|
404
|
+
| `--pdb <id>` | The PDB entry to map the row onto | |
|
|
405
|
+
| `--chain <id>` | The `--pdb` entry's author chain | |
|
|
406
|
+
| `--alphafold` | Map the row onto the AlphaFold DB model of the accession instead | |
|
|
407
|
+
| `-o, --output <file>` | Output JSON file | stdout |
|
|
408
|
+
|
|
409
|
+
<!-- /options -->
|
|
375
410
|
|
|
376
411
|
In `--rows`, the structure column is `6VXX:A` or `alphafold`, and a
|
|
377
412
|
`row accession structure` header line is optional. A row may appear on several
|
|
@@ -483,6 +518,12 @@ formats above.
|
|
|
483
518
|
half the row height, the residue letters stop drawing, and they account for most
|
|
484
519
|
of the file size.
|
|
485
520
|
|
|
521
|
+
**The export refuses to draw the entire alignment.** Each residue letter is an
|
|
522
|
+
SVG element, and an alignment of 500 rows by 1000 columns takes 3.4GB to export.
|
|
523
|
+
Past 500,000 letters the CLI stops with an error unless `--force` is given. A
|
|
524
|
+
`--col-width` below 5 or a `--row-height` below 8 draws the same alignment with
|
|
525
|
+
no letters, and `--viewport` draws one window of it.
|
|
526
|
+
|
|
486
527
|
## Uses
|
|
487
528
|
|
|
488
529
|
[msa-parsers](https://github.com/GMOD/JBrowseMSA/tree/main/packages/msa-parsers)
|