diff --git a/packages/core/pluggableElementTypes/models/BaseTrackModel.ts b/packages/core/pluggableElementTypes/models/BaseTrackModel.ts index 3c7ddcd2e8..e9e21eeda4 100644 --- a/packages/core/pluggableElementTypes/models/BaseTrackModel.ts +++ b/packages/core/pluggableElementTypes/models/BaseTrackModel.ts @@ -1,6 +1,6 @@ import { lazy } from 'react' -import { types } from '@jbrowse/mobx-state-tree' +import { addDisposer, types } from '@jbrowse/mobx-state-tree' import Save from '@mui/icons-material/Save' import { ConfigurationReference, getConf } from '../../configuration' @@ -19,6 +19,7 @@ import type { } from '../../configuration' import type { MenuItem } from '../../ui' import type { IAnyStateTreeNode, Instance } from '@jbrowse/mobx-state-tree' +import { autorun } from 'mobx' const SaveTrackDataDlg = lazy(() => import('./components/SaveTrackData')) @@ -304,6 +305,20 @@ export function createBaseTrackModel( : []), ] }, + afterAttach() { + addDisposer( + self, + autorun(() => { + if (!self.displays.length) { + const compatDisp = getCompatibleDisplays(self) + console.log({ compatDisp }) + self.showDisplay( + self.configuration.trackId + '-' + compatDisp[0].type, + ) + } + }), + ) + }, })) .postProcessSnapshot(snap => { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition diff --git a/products/jbrowse-cli/README.md b/products/jbrowse-cli/README.md index fc9cda1bb1..bb93174d7b 100644 --- a/products/jbrowse-cli/README.md +++ b/products/jbrowse-cli/README.md @@ -43,410 +43,700 @@ npx @jbrowse/cli create myfolder It is likely preferable in most cases to install the tools globally with `npm install @jbrowse/cli -g` however -``` +## Commands + + + +- [`jbrowse add-assembly SEQUENCE`](#jbrowse-add-assembly-sequence) +- [`jbrowse add-connection CONNECTIONURLORPATH`](#jbrowse-add-connection-connectionurlorpath) +- [`jbrowse add-track TRACK`](#jbrowse-add-track-track) +- [`jbrowse add-track-json TRACK`](#jbrowse-add-track-json-track) +- [`jbrowse admin-server`](#jbrowse-admin-server) +- [`jbrowse create LOCALPATH`](#jbrowse-create-localpath) +- [`jbrowse help [COMMAND]`](#jbrowse-help-command) +- [`jbrowse make-pif FILE`](#jbrowse-make-pif-file) +- [`jbrowse remove-track TRACK`](#jbrowse-remove-track-track) +- [`jbrowse set-default-session`](#jbrowse-set-default-session) +- [`jbrowse sort-gff FILE`](#jbrowse-sort-gff-file) +- [`jbrowse text-index`](#jbrowse-text-index) +- [`jbrowse upgrade [LOCALPATH]`](#jbrowse-upgrade-localpath) + +## `jbrowse add-assembly SEQUENCE` -JBrowse CLI +Add an assembly to a JBrowse 2 configuration +``` USAGE - $ jbrowse [options] - -COMMANDS - create Downloads and installs the latest JBrowse 2 release - add-assembly Add an assembly to a JBrowse 2 configuration - add-track Add a track to a JBrowse 2 configuration - text-index Make a text-indexing file for any given track(s) - admin-server Start up a small admin server for JBrowse configuration - upgrade Upgrades JBrowse 2 to latest version - make-pif Creates pairwise indexed PAF (PIF), with bgzip and tabix - sort-gff Helper utility to sort GFF files for tabix - sort-bed Helper utility to sort BED files for tabix - add-connection Add a connection to a JBrowse 2 configuration - add-track-json Add a track configuration directly from a JSON hunk - remove-track Remove a track configuration from a JBrowse 2 configuration - set-default-session Set a default session with views and tracks - -OPTIONS - -h, --help Show help - -v, --version Show version - -Use "jbrowse --help" for more information about a command. + $ jbrowse add-assembly SEQUENCE [-t indexedFasta|bgzipFasta|twoBit|chromSizes|custom] [-n ] [-a ] + [--displayName ] [--faiLocation ] [--gziLocation ] [--refNameAliasesType aliases|custom + --refNameAliases ] [--refNameColors ] [--target ] [--out ] [-h] [-l + copy|symlink|move|inPlace] [--skipCheck] [--overwrite] [-f] -``` +ARGUMENTS + SEQUENCE + sequence file or URL -## jbrowse create + If TYPE is indexedFasta or bgzipFasta, the index file defaults to .fai + and can be optionally specified with --faiLocation + If TYPE is bgzipFasta, the gzip index file defaults to .gzi and can be + optionally specified with --gziLocation -``` -Downloads and installs the latest JBrowse 2 release +FLAGS + -a, --alias=... + An alias for the assembly name (e.g. "hg38" if the name of the assembly is "GRCh38"); + can be specified multiple times -Usage: jbrowse create [localPath] [options] + -f, --force + Equivalent to `--skipCheck --overwrite` -Options: - -h, --help Show help - -f, --force Overwrites existing JBrowse 2 installation if present in path - -l, --listVersions Lists out all versions of JBrowse 2 - , --branch Download a development build from a named git branch - , --nightly Download the latest development build from the main branch - -u, --url A direct URL to a JBrowse 2 release - -t, --tag Version of JBrowse 2 to install. Format is v1.0.0. - Defaults to latest + -h, --help + Show CLI help. -# Download latest release from github, and put in specific path -$ jbrowse create /path/to/new/installation + -l, --load=