@jbrowse/cli 4.1.1 → 4.1.3

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 CHANGED
@@ -44,84 +44,586 @@ It is likely preferable in most cases to install the tools globally with
44
44
  `npm install @jbrowse/cli -g` however
45
45
 
46
46
  ```
47
+
48
+ JBrowse CLI
49
+
50
+ USAGE
51
+ $ jbrowse <command> [options]
52
+
53
+ COMMANDS
54
+ create Downloads and installs the latest JBrowse 2 release
55
+ add-assembly Add an assembly to a JBrowse 2 configuration
56
+ add-track Add a track to a JBrowse 2 configuration
57
+ text-index Make a text-indexing file for any given track(s)
58
+ admin-server Start up a small admin server for JBrowse configuration
59
+ upgrade Upgrades JBrowse 2 to latest version
60
+ make-pif Creates pairwise indexed PAF (PIF), with bgzip and tabix
61
+ sort-gff Helper utility to sort GFF files for tabix
62
+ sort-bed Helper utility to sort BED files for tabix
63
+ add-connection Add a connection to a JBrowse 2 configuration
64
+ add-track-json Add a track configuration directly from a JSON hunk
65
+ remove-track Remove a track configuration from a JBrowse 2 configuration
66
+ set-default-session Set a default session with views and tracks
67
+
68
+ OPTIONS
69
+ -h, --help Show help
70
+ -v, --version Show version
71
+
72
+ Use "jbrowse <command> --help" for more information about a command.
73
+
47
74
  ```
48
75
 
49
76
 
50
77
  ## jbrowse create
51
78
 
52
79
  ```
80
+ Downloads and installs the latest JBrowse 2 release
81
+
82
+ Usage: jbrowse create [localPath] [options]
83
+
84
+ Options:
85
+ -h, --help Show help
86
+
87
+ -f, --force Overwrites existing JBrowse 2 installation if
88
+ present in path
89
+
90
+ -l, --listVersions Lists out all versions of JBrowse 2
91
+
92
+ --branch Download a development build from a named git
93
+ branch
94
+
95
+ --nightly Download the latest development build from the main
96
+ branch
97
+
98
+ -u, --url A direct URL to a JBrowse 2 release
99
+
100
+ -t, --tag Version of JBrowse 2 to install. Format is v1.0.0.
101
+ Defaults to latest
102
+
103
+ # Download latest release from github, and put in specific path
104
+ $ jbrowse create /path/to/new/installation
105
+
106
+ # Download latest release from github and force overwrite existing contents at path
107
+ $ jbrowse create /path/to/new/installation --force
108
+
109
+ # Download latest release from a specific URL
110
+ $ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip
111
+
112
+ # Download a specific tag from github
113
+ $ jbrowse create /path/to/new/installation --tag v1.0.0
114
+
115
+ # List available versions
116
+ $ jbrowse create --listVersions
53
117
  ```
54
118
 
55
119
 
56
120
  ## jbrowse add-assembly
57
121
 
58
122
  ```
123
+ Add an assembly to a JBrowse 2 configuration
124
+
125
+ Usage: jbrowse add-assembly <sequence> [options]
126
+
127
+ Options:
128
+ -t, --type type of sequence, by default inferred from sequence
129
+ file
130
+
131
+ indexedFasta - An index FASTA (e.g. .fa or .fasta)
132
+ file; can optionally specify --faiLocation
133
+
134
+ bgzipFasta - A block-gzipped and indexed FASTA
135
+ (e.g. .fa.gz or .fasta.gz) file; can optionally
136
+ specify --faiLocation and/or --gziLocation
137
+
138
+ twoBit - A twoBit (e.g. .2bit) file
139
+
140
+ chromSizes - A chromosome sizes (e.g. .chrom.sizes)
141
+ file
142
+
143
+ custom - Either a JSON file location or inline JSON
144
+ that defines a custom sequence adapter; must
145
+ provide --name if using inline JSON [choices:
146
+ indexedFasta, bgzipFasta, twoBit, chromSizes,
147
+ custom]
148
+
149
+ -n, --name Name of the assembly; if not specified, will be
150
+ guessed using the sequence file name
151
+
152
+ -a, --alias An alias for the assembly name (e.g. "hg38" if the
153
+ name of the assembly is "GRCh38"); can be specified
154
+ multiple times
155
+
156
+ --displayName The display name to specify for the assembly, e.g.
157
+ "Homo sapiens (hg38)" while the name can be a
158
+ shorter identifier like "hg38"
159
+
160
+ --faiLocation [default: <fastaLocation>.fai] FASTA index file or
161
+ URL
162
+
163
+ --gziLocation [default: <fastaLocation>.gzi] FASTA gzip index
164
+ file or URL
165
+
166
+ --refNameAliases Reference sequence name aliases file or URL;
167
+ assumed to be a tab-separated aliases file unless
168
+ --refNameAliasesType is specified
169
+
170
+ --refNameAliasesType Type of aliases defined by --refNameAliases; if
171
+ "custom", --refNameAliases is either a JSON file
172
+ location or inline JSON that defines a custom
173
+ sequence adapter [choices: aliases, custom]
174
+
175
+ --refNameColors A comma-separated list of color strings for the
176
+ reference sequence names; will cycle through colors
177
+ if there are fewer colors than sequences
178
+
179
+ --target path to config file in JB2 installation directory
180
+ to write out to. Creates ./config.json if
181
+ nonexistent
182
+
183
+ --out synonym for target
184
+
185
+ -h, --help Display help for command
186
+
187
+ -l, --load Required flag when using a local file. Choose how
188
+ to manage the data directory. Copy, symlink, or
189
+ move the data directory to the JBrowse directory.
190
+ Or use inPlace to modify the config without doing
191
+ any file operations [choices: copy, symlink, move,
192
+ inPlace]
193
+
194
+ --skipCheck Don't check whether or not the sequence file or URL
195
+ exists or if you are in a JBrowse directory
196
+
197
+ --overwrite Overwrite existing assembly if one with the same
198
+ name exists
199
+
200
+ -f, --force Equivalent to `--skipCheck --overwrite`
201
+
202
+ # add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory
203
+ $ jbrowse add-assembly GRCh38.fa --load copy
204
+
205
+ # add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2
206
+ $ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy
207
+
208
+ # force indexedFasta for add-assembly without relying on file extension
209
+ $ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy
210
+
211
+ # add displayName for an assembly
212
+ $ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName "Homo sapiens (hg38)"
213
+
214
+ # use chrom.sizes file for assembly instead of a fasta file
215
+ $ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace
216
+
217
+ # add assembly from preconfigured json file, expert option
218
+ $ jbrowse add-assembly GRCh38.config.json --load copy
219
+
220
+ # add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed
221
+ $ jbrowse add-assembly https://example.com/data/sample.2bit
222
+
223
+ # add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists
224
+ $ jbrowse add-assembly myfile.fa.gz --load copy
59
225
  ```
60
226
 
61
227
 
62
228
  ## jbrowse add-track
63
229
 
64
230
  ```
231
+ Add a track to a JBrowse 2 configuration
232
+
233
+ Usage: jbrowse add-track <track> [options]
234
+
235
+ Options:
236
+ -h, --help
237
+
238
+ -t, --trackType Type of track, by default inferred from track file
239
+
240
+ -n, --name Name of the track. Will be defaulted to the trackId
241
+ if none specified
242
+
243
+ --indexFile Optional index file for the track
244
+
245
+ -d, --description Optional description of the track
246
+
247
+ -a, --assemblyNames Assembly name or names for track as comma separated
248
+ string
249
+
250
+ --category Optional comma separated string of categories to
251
+ group tracks
252
+
253
+ --config Any extra config settings to add to a track
254
+
255
+ --target Path to config file in JB2 installation to write
256
+ out to
257
+
258
+ --out Synonym for target
259
+
260
+ --subDir When using --load a file, output to a subdirectory
261
+ of the target dir
262
+
263
+ --trackId trackId for the track, by default inferred from
264
+ filename
265
+
266
+ -l, --load How to manage the track (copy, symlink, move,
267
+ inPlace)
268
+
269
+ --skipCheck Skip check for whether file or URL exists
270
+
271
+ --overwrite Overwrites existing track if it shares the same
272
+ trackId
273
+
274
+ -f, --force Equivalent to --skipCheck --overwrite
275
+
276
+ --protocol Force protocol to a specific value
277
+
278
+ --bed1 Used only for mcscan anchors/simpleAnchors types
279
+
280
+ --bed2 Used only for mcscan anchors/simpleAnchors types
281
+
282
+ # copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json
283
+ $ jbrowse add-track /path/to/my.bam --load copy
284
+
285
+ # copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json
286
+ $ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam
287
+
288
+ # same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai
289
+ $ jbrowse add-track my.bam --indexFile my.bai --load copy
290
+
291
+ # creates symlink for /path/to/my.bam and adds track to config.json
292
+ $ jbrowse add-track /path/to/my.bam --load symlink
293
+
294
+ # add track from URL to config.json, no --load flag needed
295
+ $ jbrowse add-track https://mywebsite.com/my.bam
296
+
297
+ # --load inPlace adds a track without doing file operations
298
+ $ jbrowse add-track /url/relative/path.bam --load inPlace
65
299
  ```
66
300
 
67
301
 
68
302
  ## jbrowse text-index
69
303
 
70
304
  ```
305
+ Make a text-indexing file for any given track(s).
306
+
307
+ Usage: jbrowse text-index [options]
308
+
309
+ Options:
310
+ -h, --help Show CLI help
311
+
312
+ --tracks Specific tracks to index, formatted as comma
313
+ separated trackIds. If unspecified, indexes all
314
+ available tracks
315
+
316
+ --excludeTracks Specific tracks to exclude from indexing, formatted
317
+ as comma separated trackIds
318
+
319
+ --target Path to config file in JB2 installation directory
320
+ to read from.
321
+
322
+ --out Synonym for target
323
+
324
+ --attributes Comma separated list of attributes to index
325
+ [default: Name,ID]
326
+
327
+ -a, --assemblies Specify the assembl(ies) to create an index for. If
328
+ unspecified, creates an index for each assembly in
329
+ the config
330
+
331
+ --force Overwrite previously existing indexes [default:
332
+ false]
333
+
334
+ -q, --quiet Hide the progress bars [default: false]
335
+
336
+ --perTrack If set, creates an index per track [default: false]
337
+
338
+ --exclude Adds gene type to list of excluded types [default:
339
+ CDS,exon]
340
+
341
+ --prefixSize Specify the prefix size for the ixx index. We
342
+ attempt to automatically calculate this, but you
343
+ can manually specify this too. If many genes have
344
+ similar gene IDs e.g. Z000000001, Z000000002 the
345
+ prefix size should be larger so that they get split
346
+ into different bins
347
+
348
+ --file File or files to index (can be used to create trix
349
+ indexes for embedded component use cases not using
350
+ a config.json for example)
351
+
352
+ --fileId Set the trackId used for the indexes generated with
353
+ the --file argument
354
+
355
+ --dryrun Just print out tracks that will be indexed by the
356
+ process, without doing any indexing
357
+
358
+ # indexes all tracks that it can find in the current directory's config.json
359
+ $ jbrowse text-index
360
+
361
+ # indexes specific trackIds that it can find in the current directory's config.json
362
+ $ jbrowse text-index --tracks=track1,track2,track3
363
+
364
+ # indexes all tracks except specific trackIds
365
+ $ jbrowse text-index --exclude-tracks=track1,track2,track3
366
+
367
+ # indexes all tracks in a directory's config.json or in a specific config file
368
+ $ jbrowse text-index --out /path/to/jb2/
369
+
370
+ # indexes only a specific assembly, and overwrite what was previously there using force (which is needed if a previous index already existed)
371
+ $ jbrowse text-index -a hg19 --force
372
+
373
+ # create index for some files for use in @jbrowse/react-linear-genome-view2 or similar
374
+ $ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes
71
375
  ```
72
376
 
73
377
 
74
378
  ## jbrowse admin-server
75
379
 
76
380
  ```
381
+ Start up a small admin server for JBrowse configuration
382
+
383
+ Usage: jbrowse admin-server [options]
384
+
385
+ Options:
386
+ -h, --help
387
+
388
+ -p, --port Specified port to start the server on (default:
389
+ 9090)
390
+
391
+ --root Path to the root of the JB2 installation
392
+
393
+ --bodySizeLimit Size limit of the update message (default: 25mb)
394
+
395
+ $ jbrowse admin-server
396
+ $ jbrowse admin-server -p 8888
77
397
  ```
78
398
 
79
399
 
80
400
  ## jbrowse upgrade
81
401
 
82
402
  ```
403
+ Upgrades JBrowse 2 to latest version
404
+
405
+ Usage: jbrowse upgrade [localPath] [options]
406
+
407
+ Options:
408
+ -h, --help Display help for command
409
+
410
+ -l, --listVersions Lists out all versions of JBrowse 2
411
+
412
+ -t, --tag Version of JBrowse 2 to install. Format is v1.0.0.
413
+ Defaults to latest
414
+
415
+ --branch Download a development build from a named git
416
+ branch
417
+
418
+ --nightly Download the latest development build from the main
419
+ branch
420
+
421
+ --clean Removes old js,map,and LICENSE files in the
422
+ installation
423
+
424
+ -u, --url A direct URL to a JBrowse 2 release
425
+
426
+ # Upgrades current directory to latest jbrowse release
427
+ $ jbrowse upgrade
428
+
429
+ # Upgrade jbrowse instance at a specific filesystem path
430
+ $ jbrowse upgrade /path/to/jbrowse2/installation
431
+
432
+ # Upgrade to a specific tag
433
+ $ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0
434
+
435
+ # List versions available on github
436
+ $ jbrowse upgrade --listVersions
437
+
438
+ # Upgrade from a specific URL
439
+ $ jbrowse upgrade --url https://sample.com/jbrowse2.zip
440
+
441
+ # Get nightly release from main branch
442
+ $ jbrowse upgrade --nightly
83
443
  ```
84
444
 
85
445
 
86
446
  ## jbrowse make-pif
87
447
 
88
448
  ```
449
+ creates pairwise indexed PAF (PIF), with bgzip and tabix
450
+
451
+ Usage: jbrowse make-pif <file> [options]
452
+
453
+ Options:
454
+ -h, --help
455
+
456
+ --out Where to write the output file. will write
457
+ ${file}.pif.gz and ${file}.pif.gz.tbi
458
+
459
+ --csi Create a CSI index for the PIF file instead of TBI
460
+
461
+ $ jbrowse make-pif input.paf # creates input.pif.gz in same directory
462
+
463
+ $ jbrowse make-pif input.paf --out output.pif.gz # specify output file, creates output.pif.gz.tbi also
89
464
  ```
90
465
 
91
466
 
92
467
  ## jbrowse sort-gff
93
468
 
94
469
  ```
470
+ Helper utility to sort GFF files for tabix. Moves all lines starting with # to the top of the file, and sort by refname and start position using unix utilities sort and grep
471
+
472
+ Usage: jbrowse sort-gff [file] [options]
473
+
474
+ Options:
475
+ -h, --help
476
+
477
+ # sort gff and pipe to bgzip
478
+ $ jbrowse sort-gff input.gff | bgzip > sorted.gff.gz
479
+ $ tabix sorted.gff.gz
480
+
481
+ # sort gff from stdin
482
+ $ cat input.gff | jbrowse sort-gff | bgzip > sorted.gff.gz
95
483
  ```
96
484
 
97
485
 
98
486
  ## jbrowse sort-bed
99
487
 
100
488
  ```
489
+ Helper utility to sort BED files for tabix. Moves all lines starting with # to the top of the file, and sort by refname and start position using unix utilities sort and grep
490
+
491
+ Usage: jbrowse sort-bed [file] [options]
492
+
493
+ Options:
494
+ -h, --help
495
+
496
+ # sort bed and pipe to bgzip
497
+ $ jbrowse sort-bed input.bed | bgzip > sorted.bed.gz
498
+ $ tabix sorted.bed.gz
499
+
500
+ # OR pipe data via stdin: cat file.bed | jbrowse sort-bed | bgzip > sorted.bed.gz
101
501
  ```
102
502
 
103
503
 
104
504
  ## jbrowse add-connection
105
505
 
106
506
  ```
507
+ Add a connection to a JBrowse 2 configuration
508
+
509
+ Usage: jbrowse add-connection <connectionUrlOrPath> [options]
510
+
511
+ Options:
512
+ -h, --help
513
+
514
+ -t, --type Type of connection (e.g. JBrowse1Connection,
515
+ UCSCTrackHubConnection, custom)
516
+
517
+ -a, --assemblyNames For UCSC: optional comma separated list of assembly
518
+ names to filter. For JBrowse1: a single assembly
519
+ name
520
+
521
+ -c, --config Extra config settings to add to connection in JSON
522
+ object format
523
+
524
+ --connectionId Id for the connection that must be unique to
525
+ JBrowse
526
+
527
+ -n, --name Name of the connection. Defaults to connectionId if
528
+ not provided
529
+
530
+ --target Path to config file in JB2 installation directory
531
+ to write out to
532
+
533
+ --out Synonym for target
534
+
535
+ --skipCheck Don't check whether the data directory URL exists
536
+
537
+ --overwrite Overwrites any existing connections if same
538
+ connection id
539
+
540
+ -f, --force Equivalent to --skipCheck --overwrite
541
+
542
+ $ jbrowse add-connection http://mysite.com/jbrowse/data/ -a hg19
543
+ $ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection -a hg38
544
+ $ jbrowse add-connection http://mysite.com/path/to/hub.txt
545
+ $ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection
546
+ $ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{"uri":{"url":"https://mysite.com/path/to/custom"}, "locationType": "UriLocation"}' -a hg19
547
+ $ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json
107
548
  ```
108
549
 
109
550
 
110
551
  ## jbrowse add-track-json
111
552
 
112
553
  ```
554
+ Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration
555
+
556
+ Usage: jbrowse add-track-json <track> [options]
557
+
558
+ Options:
559
+ -h, --help
560
+
561
+ -u, --update Update the contents of an existing track, matched
562
+ based on trackId
563
+
564
+ --target Path to config file in JB2 installation directory
565
+ to write out to
566
+
567
+ --out Synonym for target
568
+
569
+ $ jbrowse add-track-json track.json
570
+ $ jbrowse add-track-json track.json --update
113
571
  ```
114
572
 
115
573
 
116
574
  ## jbrowse remove-track
117
575
 
118
576
  ```
577
+ Remove a track configuration from a JBrowse 2 configuration. Be aware that this can cause crashes in saved sessions that refer to this track!
578
+
579
+ Usage: jbrowse remove-track <trackId> [options]
580
+
581
+ Options:
582
+ -h, --help
583
+
584
+ --target Path to config file in JB2 installation directory
585
+ to write out to
586
+
587
+ --out Synonym for target
588
+
589
+ $ jbrowse remove-track trackId
119
590
  ```
120
591
 
121
592
 
122
593
  ## jbrowse set-default-session
123
594
 
124
595
  ```
596
+ Set a default session with views and tracks
597
+
598
+ Usage: jbrowse add-track <track> [options]
599
+
600
+ Options:
601
+ -s, --session set path to a file containing session in json
602
+ format (required, unless using
603
+ delete/currentSession flags)
604
+
605
+ -n, --name Give a name for the default session [default: New
606
+ Default Session]
607
+
608
+ -c, --currentSession List out the current default session
609
+
610
+ --target path to config file in JB2 installation directory
611
+ to write out to
612
+
613
+ --out synonym for target
614
+
615
+ --delete Delete any existing default session.
616
+
617
+ -h, --help Show help
618
+
619
+ # set default session for the config.json in your current directory
620
+ $ jbrowse set-default-session --session /path/to/default/session.json
621
+
622
+ # make session.json the defaultSession on the specified target config.json file
623
+ $ jbrowse set-default-session --target /path/to/jb2/installation/config.json --session session.json
624
+
625
+ # print current default session
626
+ $ jbrowse set-default-session --currentSession # Prints out current default session
125
627
  ```
126
628
 
127
629