### Start JBrowse 2 Developer Instance Source: https://jbrowse.org/jb2/docs/faq Clone the JBrowse components repository, install dependencies, and start a development instance of jbrowse-web. You can specify a different port using the PORT environment variable. ```bash git clone https://github.com/GMOD/jbrowse-components cd jbrowse-components yarn cd products/jbrowse-web yarn start ``` ```bash PORT=8080 yarn start ``` -------------------------------- ### Create JBrowse Installation from URL Source: https://jbrowse.org/jb2/docs/cli Downloads and installs JBrowse 2 from a direct URL to a release zip file. ```bash # Download latest release from a specific URL $ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip ``` -------------------------------- ### Setup JBrowse 2 Development Environment Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Run the setup command to download the latest JBrowse 2 release into your project's .jbrowse directory. ```bash yarn setup ``` -------------------------------- ### Run JBrowse Development Server Output Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Example output from the 'yarn browse' command, showing the JBrowse development server starting. ```bash yarn run v1.22.10 $ npm-run-all jbrowse:* $ shx cp jbrowse_config.json .jbrowse/config.json $ cross-var serve --listen $npm_package_config_browse_port .jbrowse ``` -------------------------------- ### Install Project Dependencies Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Install the necessary project dependencies using yarn or npm. ```bash yarn # or npm i ``` -------------------------------- ### Installation Source: https://jbrowse.org/jb2/docs/cli Instructions for installing the JBrowse CLI globally using npm or for one-off executions using npx. ```APIDOC ## Installation The command line tools can be installed globally using `npm` as follows: ```bash $ npm install -g @jbrowse/cli ``` A CLI tool called `jbrowse` should then be available in the path. You can test your installation with: ```bash $ jbrowse --version ``` It is also possible to do one-off executions using npx, e.g.: ```bash npx @jbrowse/cli create myfolder ``` It is likely preferable in most cases to install the tools globally with `npm install @jbrowse/cli -g` however. ``` -------------------------------- ### Start the JBrowse 2 admin-server Source: https://jbrowse.org/jb2/docs/quickstart_adminserver Run this command in your JBrowse 2 directory to start the admin server for temporary configuration. ```bash jbrowse admin-server ``` -------------------------------- ### Start Plugin Development Server Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Navigate to your plugin project directory and run 'yarn start' to launch your plugin's development server. Ensure JBrowse is also running. ```bash cd jbrowse-plugin-my-project yarn start ``` -------------------------------- ### Example SyntenyTrack Configuration Source: https://jbrowse.org/jb2/docs/config_guides/synteny_track A complete configuration for a SyntenyTrack using the PAFAdapter. This example shows how to specify the track type, ID, assembly names, and the location of the PAF file. ```json { "type": "SyntenyTrack", "trackId": "dotplot_track", "assemblyNames": ["YJM1447", "R64"], "name": "dotplot", "adapter": { "type": "PAFAdapter", "pafLocation": { "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/yeast/YJM1447_vs_R64.paf" }, "assemblyNames": ["YJM1447", "R64"] } } ``` -------------------------------- ### Start JBrowse Admin Server Source: https://jbrowse.org/jb2/docs/cli Initiates a lightweight admin server for managing JBrowse configurations. You can specify the port and the root directory for the JBrowse installation. ```bash jbrowse admin-server ``` ```bash jbrowse admin-server -p 8888 ``` -------------------------------- ### Starting a Local Web Server with npx serve Source: https://jbrowse.org/jb2/docs/tutorials/embed_linear_genome_view Command to start a local web server from your terminal. This is necessary to view the HTML file with embedded JBrowse correctly, as direct file opening in a browser may not work. ```bash npx serve ``` -------------------------------- ### Create JBrowse Installation in Specific Path Source: https://jbrowse.org/jb2/docs/cli Downloads and installs the latest JBrowse 2 release into a specified local directory. ```bash # Download latest release from github, and put in specific path $ jbrowse create /path/to/new/installation ``` -------------------------------- ### PAFAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/pafadapter This example shows the minimal configuration required for the PAFAdapter, specifying the file URI and assembly names. ```APIDOC ## PAFAdapter - Pre-processor / simplified config preprocessor to allow minimal config: ```json { "type": "PAFAdapter", "uri": "file.paf.gz", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` ``` -------------------------------- ### Create JBrowse Installation from Specific Tag Source: https://jbrowse.org/jb2/docs/cli Downloads and installs a specific version of JBrowse 2 identified by a tag. ```bash # Download a specific tag from github $ jbrowse create /path/to/new/installation --tag v1.0.0 ``` -------------------------------- ### LinearReadCloudDisplay Example Source: https://jbrowse.org/jb2/docs/urlparams This example demonstrates using `LinearReadCloudDisplay` for a specific track by providing its `trackId` and `displaySnapshot` configuration within the session JSON. ```url https://jbrowse.org/code/jb2/main/?config=test_data/volvox/config.json&session={"views":[{"assembly":"volvox","loc":"ctgA:1-10000","type":"LinearGenomeView","tracks":[{"trackId":"volvox_sv_cram","displaySnapshot":{"type":"LinearReadCloudDisplay"}}]}]} ``` -------------------------------- ### VcfTabixAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/vcftabixadapter Use this pre-processor configuration for a simplified setup, assuming the VCF.gz file has a corresponding .tbi index. ```json { "type": "VcfTabixAdapter", "uri": "yourfile.vcf.gz" } ``` -------------------------------- ### ChainAdapter - Pre-processor / simplified config Source: https://jbrowse.org/jb2/docs/config/chainadapter This example shows a minimal configuration for the ChainAdapter, defining the adapter type, URI for the chain file, and the query and target assemblies. ```APIDOC ## ChainAdapter - Pre-processor / simplified config ### Description Preprocessor to allow minimal config. ### Configuration Example ```json { "type": "ChainAdapter", "uri": "yourfile.chain.gz", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` ``` -------------------------------- ### BgzipFastaAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/bgzipfastaadapter This configuration allows for minimal setup by specifying only the 'type' and 'uri' for the FASTA file. It assumes that the corresponding .fai and .gzi index files are available. ```APIDOC ## BgzipFastaAdapter - Pre-processor / simplified config preprocessor to allow minimal config, assumes yourfile.fa.fai and yourfile.fa.gzi: ```json { "type": "BgzipFastaAdapter", "uri": "yourfile.fa" } ``` ``` -------------------------------- ### BgzipFastaAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/bgzipfastaadapter Use this configuration for a minimal setup, assuming your FASTA file is gzipped and indexed (e.g., yourfile.fa.gz and yourfile.fa.gzi). ```json { "type": "BgzipFastaAdapter", "uri": "yourfile.fa" } ``` -------------------------------- ### Example hg19 Genome Assembly Configuration Source: https://jbrowse.org/jb2/docs/config_guides/assemblies A complete config.json example demonstrating how to load the hg19 genome assembly. It includes details for the sequence track and reference name aliases. ```json { "assemblies": [ { "name": "hg19", "aliases": ["GRCh37"], "sequence": { "type": "ReferenceSequenceTrack", "trackId": "refseq_track", "adapter": { "type": "BgzipFastaAdapter", "fastaLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz", "locationType": "UriLocation" }, "faiLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai", "locationType": "UriLocation" }, "gziLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi", "locationType": "UriLocation" } }, "rendering": { "type": "DivSequenceRenderer" } }, "refNameAliases": { "adapter": { "type": "RefNameAliasAdapter", "location": { "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/hg19_aliases.txt", "locationType": "UriLocation" } } } } ] } ``` -------------------------------- ### Verify JBrowse CLI Installation Source: https://jbrowse.org/jb2/docs/cli Tests the global installation of the JBrowse CLI by checking its version. ```bash $ jbrowse --version ``` -------------------------------- ### BamAdapter Configuration Example Source: https://jbrowse.org/jb2/docs/config_guides/alignments_track Configuration for the BamAdapter, used to read BAM files. Requires the location of the BAM file and its corresponding BAI index. ```json { "type": "BamAdapter", "bamLocation": { "uri": "http://yourhost/file.bam" }, "index": { "location": { "uri": "http://yourhost/file.bam.bai" } } } ``` -------------------------------- ### BigBedAdapter - Basic Configuration Source: https://jbrowse.org/jb2/docs/config/bigbedadapter Use this configuration for a minimal setup of the BigBedAdapter, specifying the adapter type and the BigBed file location. ```json { "type": "BigBedAdapter", "uri": "yourfile.bigBed" } ``` -------------------------------- ### Example QuantitativeTrack Configuration Source: https://jbrowse.org/jb2/docs/config_guides/quantitative_track This is a basic configuration for a QuantitativeTrack using a BigWig adapter. Specify trackId, name, assemblyNames, and the adapter details. ```json { "trackId": "my_wiggle_track", "name": "My Wiggle Track", "assemblyNames": ["hg19"], "type": "QuantitativeTrack", "adapter": { "type": "BigWig", "bigWigLocation": { "uri": "http://yourhost/file.bw", "locationType": "UriLocation" } } } ``` -------------------------------- ### Run JBrowse Instance Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Start a local JBrowse development server to view your instance. This command serves the JBrowse application from the .jbrowse directory. ```bash yarn browse ``` -------------------------------- ### DeltaAdapter Configuration Example Source: https://jbrowse.org/jb2/docs/config/deltaadapter A basic configuration object for the DeltaAdapter, specifying the type, URI of the delta file, and the query and target assemblies. ```APIDOC ## DeltaAdapter Configuration Example ### Description This is an example of a minimal configuration for the DeltaAdapter. ### Configuration ```json { "type": "DeltaAdapter", "uri": "yourfile.delta.gz", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` ``` -------------------------------- ### Example Session JSON Source: https://jbrowse.org/jb2/docs/config_guides/default_session This is an example of a session JSON structure that can be exported from JBrowse. It defines the views, displayed regions, and their states. ```json { "session": { "id": "eXr4hv4VX", "name": "Session", "views": [ { "id": "eXr4hv4VX-view", "type": "LinearGenomeView", "offsetPx": 14500, "bpPerPx": 1.7, "displayedRegions": [ { "refName": "ctgA", "start": 0, "end": 50001, "reversed": false, "assemblyName": "volvox" } ] } ] } } ``` -------------------------------- ### DeltaAdapter Basic Configuration Source: https://jbrowse.org/jb2/docs/config/deltaadapter Use this configuration for a minimal setup of the DeltaAdapter, specifying the delta file URI and the query and target assemblies. ```json { "type": "DeltaAdapter", "uri": "yourfile.delta.gz", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` -------------------------------- ### ChromSizesAdapter Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/chromsizesadapter Use this configuration for a simplified setup where the chrom.sizes file is specified directly. ```json { "type": "ChromSizesAdapter", "uri": "yourfile.chrom.sizes" } ``` -------------------------------- ### Run JBrowse CLI with npx Source: https://jbrowse.org/jb2/docs/quickstart_web Executes the JBrowse CLI without a global installation using `npx`. This is useful if you prefer not to install packages globally. ```bash npx @jbrowse/cli --version ``` -------------------------------- ### Install JBrowse CLI Globally Source: https://jbrowse.org/jb2/docs/cli Installs the JBrowse CLI globally using npm, making the 'jbrowse' command available in your system's PATH. ```bash $ npm install -g @jbrowse/cli ``` -------------------------------- ### CramAdapter Simplified Configuration Source: https://jbrowse.org/jb2/docs/config/cramadapter Use this pre-processor configuration for minimal setup when your CRAM file has a corresponding CRAI index file with the same base name. ```json { "type": "CramAdapter", "uri": "yourfile.cram" } ``` -------------------------------- ### Execute JBrowse CLI with npx Source: https://jbrowse.org/jb2/docs/cli Demonstrates how to run JBrowse CLI commands one-off using npx without global installation. ```bash npx @jbrowse/cli create myfolder ``` -------------------------------- ### Example BigWig Adapter Configuration Source: https://jbrowse.org/jb2/docs/config_guides/quantitative_track Configuration for a BigWig adapter, specifying the type and the location of the BigWig file via URI. ```json { "type": "BigWig", "bigWigLocation": { "uri": "http://yourhost/file.bw", "locationType": "UriLocation" } } ``` -------------------------------- ### UnindexedFastaAdapter - Simplified Configuration Source: https://jbrowse.org/jb2/docs/config/unindexedfastaadapter This is a simplified configuration example for the UnindexedFastaAdapter, requiring only the adapter type and the FASTA file URI. ```APIDOC ## UnindexedFastaAdapter - Simplified Configuration This configuration allows for minimal setup by specifying only the adapter type and the FASTA file URI. ### Configuration Example ```json { "type": "UnindexedFastaAdapter", "uri": "yourfile.fa" } ``` ``` -------------------------------- ### ChainAdapter Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/chainadapter Use this configuration for a basic ChainAdapter setup, specifying the chain file URI and the query and target assemblies. ```json { "type": "ChainAdapter", "uri": "yourfile.chain.gz", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` -------------------------------- ### MashMapAdapter - Pre-processor / simplified config Source: https://jbrowse.org/jb2/docs/config/mashmapadapter This section shows a simplified configuration for the MashMapAdapter, suitable for minimal setup. ```APIDOC ## MashMapAdapter - Pre-processor / simplified config ### Description Pre-processor to allow minimal config. ### Configuration Example ```json { "type": "MashMapAdapter", "uri": "file.out", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` ``` -------------------------------- ### BedAdapter Slot: colStart Source: https://jbrowse.org/jb2/docs/config/bedadapter Specifies the column number to use for the 'start' attribute. Defaults to column 1. ```json colStart: { type: 'number', description: 'The column to use as a "start" attribute', defaultValue: 1, } ``` -------------------------------- ### IndexedFastaAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/indexedfastaadapter Use this minimal configuration for IndexedFastaAdapter when an index file (e.g., yourfile.fa.fai) is present alongside the FASTA file. This acts as a pre-processor for simplified setup. ```json { "type": "IndexedFastaAdapter", "uri": "yourfile.fa" } ``` -------------------------------- ### MCScanAnchorsAdapter - Simplified Configuration Source: https://jbrowse.org/jb2/docs/config/mcscananchorsadapter Use this simplified configuration for the MCScanAnchorsAdapter when providing minimal setup details. ```json { "type": "MCScanAnchorsAdapter", "uri": "file.anchors", "bed1": "bed1.bed", "bed2": "bed2.bed", "assemblyNames": ["hg19", "hg38"] } ``` -------------------------------- ### LinearGenomeView Action: setVolatileGuides Source: https://jbrowse.org/jb2/docs/models/lineargenomeview Sets temporary vertical guides, for example, for LD display hover effects. ```typescript // type signature setVolatileGuides: (guides: VolatileGuide[]) => void ``` -------------------------------- ### UnindexedFastaAdapter - Basic Configuration Source: https://jbrowse.org/jb2/docs/config/unindexedfastaadapter Use this configuration for a minimal setup of the UnindexedFastaAdapter, specifying the adapter type and the FASTA file URI. ```json { "type": "UnindexedFastaAdapter", "uri": "yourfile.fa" } ``` -------------------------------- ### Example Hi-C Track Configuration Source: https://jbrowse.org/jb2/docs/config_guides/hic_track This is a basic configuration for a Hi-C track, specifying its type, ID, name, assembly, and adapter details. ```json { "type": "HicTrack", "trackId": "hic", "name": "Hic Track", "assemblyNames": ["hg19"], "adapter": { "type": "HicAdapter", "hicLocation": { "uri": "https://s3.amazonaws.com/igv.broadinstitute.org/data/hic/intra_nofrag_30.hic", "locationType": "UriLocation" } } } ``` -------------------------------- ### BedGraphAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/bedgraphadapter Use this simplified configuration for basic BedGraphAdapter setup. Specify the adapter type and the URI of your BEDGraph file. ```json { "type": "BedGraphAdapter", "uri": "yourfile.bed" } ``` -------------------------------- ### JEXL Feature Operations: get Source: https://jbrowse.org/jb2/docs/config_guides/jexl Demonstrates JEXL functions for retrieving common properties from a feature object, such as start coordinate, end coordinate, reference sequence name, CIGAR string, sequence, and feature type. ```javascript jexl: get(feature, 'start') // start coordinate, 0-based half open ``` ```javascript jexl: get(feature, 'end') // end coordinate, 0-based half open ``` ```javascript jexl: get(feature, 'refName') // chromosome or reference sequence name ``` ```javascript jexl: get(feature, 'CIGAR') // BAM or CRAM feature CIGAR string ``` ```javascript jexl: get(feature, 'seq') // BAM or CRAM feature sequence ``` ```javascript jexl: get(feature, 'type') // feature type e.g. mRNA or gene ``` -------------------------------- ### BamAdapter - Simplified Configuration Source: https://jbrowse.org/jb2/docs/config/bamadapter Use this pre-processor for minimal configuration, assuming your BAM file has a corresponding BAI index. ```json { "type": "BamAdapter", "uri": "yourfile.bam" } ``` -------------------------------- ### Example FromConfigAdapter Configuration Source: https://jbrowse.org/jb2/docs/config_guides/from_config Use FromConfigAdapter to generate features directly from values stored in the configuration. This is useful for static feature sets defined within the configuration itself. ```json { "type": "FromConfigAdapter", "features": [ { "refName": "ctgA", "uniqueId": "alias1", "aliases": ["A", "contigA"] }, { "refName": "ctgB", "uniqueId": "alias2", "aliases": ["B", "contigB"] } ] } ``` -------------------------------- ### MashMapAdapter Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/mashmapadapter Use this configuration for a simplified setup of the MashMapAdapter. It requires specifying the adapter type, the URI of the output file, and the query and target assembly names. ```json { "type": "MashMapAdapter", "uri": "file.out", "queryAssembly": "hg19", "targetAssembly": "hg38" } ``` -------------------------------- ### Set Show Vertical Guides Source: https://jbrowse.org/jb2/docs/models/sharedldmodel Toggles the visibility of vertical guides. Accepts a boolean value. ```typescript setShowVerticalGuides: (show: boolean) => void ``` -------------------------------- ### Install Custom Add Track Workflow in Plugin Source: https://jbrowse.org/jb2/docs/developer_guides/creating_addtrack_workflow Ensure your custom add track workflow component is installed within your plugin's main installation function. This makes the custom workflow available in the JBrowse interface. ```jsx // plugins/wiggle/index.jsx // ... export default class WigglePlugin extends Plugin { name = 'WigglePlugin' install(pm: PluginManager) { // ... MultiWiggleAddTrackWidgetF(pm) // ... } } ``` -------------------------------- ### Serve JBrowse 2 Locally Source: https://jbrowse.org/jb2/docs/quickstart_web Starts a local web server in the JBrowse 2 directory using `npx serve`. This is required to view JBrowse 2 in a browser, as it cannot be opened directly from the file system. ```bash cd jbrowse2/ ``` ```bash npx serve . ``` ```bash npx serve -S . ``` -------------------------------- ### Simplified NcbiSequenceReportAliasAdapter Config Source: https://jbrowse.org/jb2/docs/config/ncbisequencereportaliasadapter Use this simplified configuration for minimal setup. It specifies the adapter type and the URI of the sequence report file. ```json { "type": "NcbiSequenceReportAliasAdapter", "uri": "sequence_report.tsv" } ``` -------------------------------- ### Example AlignmentsTrack Configuration Source: https://jbrowse.org/jb2/docs/config_guides/alignments_track This is a basic configuration for an Alignments track. It specifies the track ID, name, assembly, type, and adapter details for BAM files. ```json { "trackId": "my_alignments_track", "name": "My Alignments", "assemblyNames": ["hg19"], "type": "AlignmentsTrack", "adapter": { "type": "BamAdapter", "bamLocation": { "uri": "http://yourhost/file.bam" }, "index": { "location": { "uri": "http://yourhost/file.bam.bai" } } } } ``` -------------------------------- ### Custom Panel Sizes for Horizontal Split Source: https://jbrowse.org/jb2/docs/urlparams Create a horizontal split with custom proportional sizes for panels. This example sets a 70/30 width ratio. ```url https://jbrowse.org/code/jb2/main/?config=test_data/volvox/config.json&session=spec-{"views":[{"type":"LinearGenomeView","assembly":"volvox","loc":"ctgA:1-5000","tracks":["gff3tabix_genes"]},{"type":"LinearGenomeView","assembly":"volvox","loc":"ctgB:1-5000","tracks":["gff3tabix_genes"]}],"layout":{"direction":"horizontal","children":[{"views":[0],"size":70},{"views":[1],"size":30}]}} ``` ```json { "views": [ { "type": "LinearGenomeView", "assembly": "volvox", "loc": "ctgA:1-5000" }, { "type": "LinearGenomeView", "assembly": "volvox", "loc": "ctgB:1-5000" } ], "layout": { "direction": "horizontal", "children": [ { "views": [0], "size": 70 }, { "views": [1], "size": 30 } ] } } ``` -------------------------------- ### Download JBrowse CLI Bundle Source: https://jbrowse.org/jb2/docs/quickstart_web Downloads the JBrowse CLI as a single executable file using `wget` and makes it executable with `chmod`. This method avoids npm installation. ```bash wget https://unpkg.com/@jbrowse/cli/bundle/index.js -O jbrowse ``` ```bash chmod +x jbrowse ``` ```bash ./jbrowse --help ``` -------------------------------- ### Upgrade JBrowse Web Source: https://jbrowse.org/jb2/docs/quickstart_web Upgrade an existing JBrowse 2 installation to the latest version by running the jbrowse upgrade command in the installation directory. ```bash # run this command in an existing jbrowse 2 installation jbrowse upgrade ``` -------------------------------- ### Configure TwoBitAdapter Source: https://jbrowse.org/jb2/docs/config_guides/assemblies Use the UCSC twoBit adapter. Note that 2bit format has a longer startup time due to upfront parsing. ```json { "type": "TwoBitAdapter", "twoBitLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.2bit", "locationType": "UriLocation" } } ``` -------------------------------- ### ReferenceSequenceTrack Configuration Source: https://jbrowse.org/jb2/docs/config_guides/assemblies Example configuration for a ReferenceSequenceTrack, used within the assembly section. It specifies the track type, ID, and adapter details for loading sequence data. ```json { "type": "ReferenceSequenceTrack", "trackId": "refseq_track", "adapter": { "type": "BgzipFastaAdapter", "fastaLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz", "locationType": "UriLocation" }, "faiLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai", "locationType": "UriLocation" }, "gziLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi", "locationType": "UriLocation" } }, "rendering": { "type": "DivSequenceRenderer" } } ``` -------------------------------- ### jbrowse create Source: https://jbrowse.org/jb2/docs/cli Command to download and install the latest JBrowse 2 release, with options for specifying path, forcing overwrite, using URLs, tags, branches, or nightly builds. ```APIDOC ## jbrowse create Downloads and installs the latest JBrowse 2 release Usage: jbrowse create [localPath] [options] 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 # Download latest release from github, and put in specific path $ jbrowse create /path/to/new/installation # Download latest release from github and force overwrite existing contents at path $ jbrowse create /path/to/new/installation --force # Download latest release from a specific URL $ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip # Download a specific tag from github $ jbrowse create /path/to/new/installation --tag v1.0.0 # List available versions $ jbrowse create --listVersions ``` -------------------------------- ### Toggle Vertical Guides on Hover Source: https://jbrowse.org/jb2/docs/config/sharedlddisplay Control the display of vertical guides that appear at connected genome positions when hovering over the display. The default is true. ```javascript showVerticalGuides: { type: 'boolean', defaultValue: true } ``` -------------------------------- ### TrixTextSearchAdapter - Simplified Config Source: https://jbrowse.org/jb2/docs/config/trixtextsearchadapter Use this pre-processor configuration for minimal setup when the file.ixx also exists. It assumes default file locations and requires assembly names and a text search adapter ID. ```json { "type": "TrixTextSearchAdapter", "uri": "file.ix", "assemblyNames": ["hg19"], "textSearchAdapterId": "hg19SearchIndex" } ``` -------------------------------- ### Show Vertical Guides Setting Source: https://jbrowse.org/jb2/docs/models/sharedldmodel Determines whether to show vertical guides at the connected genome positions on hover. Falls back to the configuration value if undefined. ```typescript showVerticalGuidesSetting: types.maybe(types.boolean) ``` -------------------------------- ### openLocation: Get authenticated file handle Source: https://jbrowse.org/jb2/docs/models/baseinternetaccountmodel Gets a file handle that uses fetch with authentication headers added. Use this to access remote files with authentication. ```typescript // type signature openLocation: (location: UriLocation) => RemoteFileWithRangeCache ``` -------------------------------- ### Specify Configuration File with ?config= Source: https://jbrowse.org/jb2/docs/urlparams Use the `?config=` parameter to point to a JBrowse 2 configuration file. This uses client-side fetch. ```url ?config=test_data/volvox/config.json ``` -------------------------------- ### Force Overwrite Existing JBrowse Installation Source: https://jbrowse.org/jb2/docs/cli Creates a new JBrowse 2 installation, overwriting any existing files at the specified path using the --force option. ```bash # Download latest release from github and force overwrite existing contents at path $ jbrowse create /path/to/new/installation --force ``` -------------------------------- ### React-based Renderer Implementation Source: https://jbrowse.org/jb2/docs/developer_guides/renderer_architecture Example of a custom renderer extending FeatureRendererType. It demonstrates fetching features, passing them to the parent for React element creation, and returning features for serialization. ```javascript class MyRenderer extends FeatureRendererType { async render(renderArgs) { // 1. Fetch features const features = await this.getFeatures(renderArgs) // 2. Pass to parent which creates React element const result = await super.render({ ...renderArgs, features }) // 3. Return features for serialization return { ...result, features } } } ``` -------------------------------- ### Prepare FASTA file with samtools Source: https://jbrowse.org/jb2/docs/tutorials/embed_linear_genome_view Use samtools to prepare a FASTA file for JBrowse by compressing it with bgzip and creating a FASTA index. ```bash bgzip file.fa samtools faidx file.fa ``` -------------------------------- ### Using Configuration Callbacks Source: https://jbrowse.org/jb2/docs/developer_guides/config_model Shows how to use configuration callbacks for dynamic values, such as color, by passing context variables like 'feature' to `readConfObject`. This allows for complex functions to determine configuration values based on feature attributes. ```javascript readConfObject(config, 'color', { feature }) ``` -------------------------------- ### Upgrade JBrowse 2 Installation Source: https://jbrowse.org/jb2/docs/cli Updates your JBrowse 2 installation to the latest version or a specific tagged version. It can also be used to download development builds from branches or nightly builds. ```bash jbrowse upgrade ``` ```bash jbrowse upgrade /path/to/jbrowse2/installation ``` -------------------------------- ### Upgrade JBrowse 2 to a Specific Tag Source: https://jbrowse.org/jb2/docs/cli Use this command to upgrade your JBrowse 2 installation to a specific version tag from GitHub. Ensure you provide the correct path to your JBrowse 2 installation. ```bash $ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0 ``` -------------------------------- ### Complete Assembly Configuration Example Source: https://jbrowse.org/jb2/docs/config_guides/assemblies This JSON snippet shows a full configuration for the hg19 assembly, including its name, aliases, sequence track details, and reference name aliasing. ```json { "assemblies": [ { "name": "hg19", "aliases": ["GRCh37"], "sequence": { "type": "ReferenceSequenceTrack", "trackId": "hg19_config", "adapter": { "type": "BgzipFastaAdapter", "fastaLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz", "locationType": "UriLocation" }, "faiLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.fai", "locationType": "UriLocation" }, "gziLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.fa.gz.gzi", "locationType": "UriLocation" } }, "rendering": { "type": "DivSequenceRenderer" } }, "refNameAliases": { "adapter": { "type": "RefNameAliasAdapter", "location": { "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/hg19/hg19_aliases.txt", "locationType": "UriLocation" } } } } ] } ``` -------------------------------- ### setShowVerticalGuides Source: https://jbrowse.org/jb2/docs/models/sharedldmodel Toggles the visibility of vertical guides in the visualization. ```APIDOC ## setShowVerticalGuides ### Description Toggles the visibility of vertical guides in the visualization. ### Method `setShowVerticalGuides(show: boolean) => void` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```javascript setShowVerticalGuides(true); setShowVerticalGuides(false); ``` ### Response #### Success Response (200) - None (void function) #### Response Example - None ``` -------------------------------- ### MCScanSimpleAnchorsAdapter - Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/mcscansimpleanchorsadapter Use this configuration for a simplified setup of the MCScanSimpleAnchorsAdapter. It requires the adapter type, the main anchor file URI, and paths to two BED files, along with assembly names. ```json { "type": "MCScanSimpleAnchorsAdapter", "uri": "file.anchors", "bed1": "bed1.bed", "bed2": "bed2.bed", "assemblyNames": ["hg19", "hg38"] } ``` -------------------------------- ### Get Canonical Ref Name Method Source: https://jbrowse.org/jb2/docs/models/assembly Returns the canonical reference sequence name for a given alias or refName. Note that this may differ from the FASTA file name if `refNameAliases` with `override:true` are configured. Use `getSeqAdapterRefName()` to get the FASTA file name. ```typescript getCanonicalRefName: (refName: string) => string ``` -------------------------------- ### setPluginsUpdated Action Source: https://jbrowse.org/jb2/docs/models/jbrowsedesktoprootmodel Triggers an update process for the installed plugins. ```APIDOC ## Action: setPluginsUpdated ### Description Initiates the process to update the plugins installed in the JBrowse Desktop application. ### Type Signature ```typescript setPluginsUpdated: () => Promise ``` ``` -------------------------------- ### Get LinearComparativeDisplay Height Source: https://jbrowse.org/jb2/docs/models/linearcomparativedisplay Retrieves the rendered height of the display. ```typescript height: number ``` -------------------------------- ### Get Configuration Method Source: https://jbrowse.org/jb2/docs/models/assembly Retrieves a specific configuration value by its key. ```typescript getConf: (arg: string) => any ``` -------------------------------- ### Initialize Project with Yarn Source: https://jbrowse.org/jb2/docs/developer_guides/simple_plugin Initialize your JBrowse plugin project using yarn. Ensure you provide a descriptive name for your plugin when prompted. ```bash yarn init ``` -------------------------------- ### Get All Connections - Getter Source: https://jbrowse.org/jb2/docs/models/connectionmanagementsessionmixin A getter that returns an array of all current connection instances. ```typescript connections: ({ [x: string]: any; } & NonEmptyObject & { setSubschema(slotName: string, data: Record): Record | ({ [x: string]: any; } & NonEmptyObject & { ...; } & IStateTreeNode<...>); } & IStateTreeNode<...>)[] ``` -------------------------------- ### Create a New JBrowse 2 Instance Source: https://jbrowse.org/jb2/docs/quickstart_web Creates a new JBrowse 2 instance by downloading the latest `jbrowse-web` and extracting it into a specified directory. The directory name can be customized. ```bash jbrowse create jbrowse2 ``` -------------------------------- ### moveTo Source: https://jbrowse.org/jb2/docs/models/lineargenomeview Moves the view to a specified start and end position within a displayed region. ```APIDOC ## moveTo ### Description Moves the view to a specified start and end position within a displayed region. The offset is the base-pair offset in the displayed region, and the index is the index of the displayed region in the linear genome view. ### Method moveTo ### Parameters #### Path Parameters - **start** (BpOffset) - Optional - The starting offset. - **end** (BpOffset) - Optional - The ending offset. ``` -------------------------------- ### Make Linux AppImage Executable and Run Source: https://jbrowse.org/jb2/docs/quickstart_desktop Use these terminal commands to make the JBrowse desktop AppImage executable and then launch it. This only needs to be done once. ```bash # Make the AppImage file executable, only need to do this once chmod a+x jbrowse-desktop-*-linux.AppImage # Run! ./jbrowse-desktop-*-linux.AppImage ``` -------------------------------- ### Get Adapter Render Properties Source: https://jbrowse.org/jb2/docs/models/linearpileupdisplay This method returns properties required by the adapter for rendering. ```typescript adapterRenderProps: () => any ``` -------------------------------- ### Example FromConfigSequenceAdapter Configuration Source: https://jbrowse.org/jb2/docs/config_guides/from_config FromConfigSequenceAdapter provides similar functionality to FromConfigAdapter but is optimized for performance when dealing with sequence features. It allows defining sequence data directly within the configuration. ```json { "type": "FromConfigSequenceAdapter", "features": [ { "refName": "SEQUENCE_1", "uniqueId": "firstId", "start": 0, "end": 33, "seq": "CCAAGATCTAAGATGTCAACACCTATCTGCTCA" }, { "refName": "SEQUENCE_2", "uniqueId": "secondId", "start": 0, "end": 44, "seq": "CCGAACCACAGGCCTATGTTACCATTGGAAAGCTCACCTTCCCG" } ] } ``` -------------------------------- ### Get LinearArcDisplay Renderer Configuration Source: https://jbrowse.org/jb2/docs/models/lineararcdisplay This getter returns the configuration for the renderer used by the LinearArcDisplay. ```typescript rendererConfig: "renderer" ``` -------------------------------- ### Get LinearArcDisplay Render Delay Source: https://jbrowse.org/jb2/docs/models/lineararcdisplay This getter returns the render delay for the LinearArcDisplay, which is a number. ```typescript renderDelay: 0 ``` -------------------------------- ### jbrowse upgrade Source: https://jbrowse.org/jb2/docs/cli Commands for upgrading JBrowse 2 installations to specific versions or from various sources. ```APIDOC ## jbrowse upgrade Commands for upgrading JBrowse 2 installations. ### Usage ```bash jbrowse upgrade [/path/to/jbrowse2/installation] [--tag ] [--listVersions] [--url ] [--nightly] ``` ### Options - `--tag `: Upgrade to a specific tag (version). - `--listVersions`: List available versions on GitHub. - `--url `: Upgrade from a specific URL. - `--nightly`: Get the nightly release from the main branch. ### Examples ```bash # Upgrade to a specific tag jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0 # List versions available on github jbrowse upgrade --listVersions # Upgrade from a specific URL jbrowse upgrade --url https://sample.com/jbrowse2.zip # Get nightly release from main branch jbrowse upgrade --nightly ``` ``` -------------------------------- ### HicAdapter Basic Configuration Source: https://jbrowse.org/jb2/docs/config/hicadapter Use this minimal configuration to set up the HicAdapter with a specified Hi-C file. Ensure the 'uri' points to your '.hic' file. ```json { "type": "HicAdapter", "uri": "file.hic" } ``` -------------------------------- ### VcfAdapter Minimal Configuration Source: https://jbrowse.org/jb2/docs/config/vcfadapter Use this minimal configuration for basic VCF file loading. Ensure the 'uri' points to your VCF file. ```json { "type": "VcfAdapter", "uri": "yourfile.vcf" } ``` -------------------------------- ### setOffsets Source: https://jbrowse.org/jb2/docs/models/lineargenomeview Sets the left and right offsets for the rubberband selection, used in the get sequence dialog. ```APIDOC ## setOffsets ### Description Sets the left and right offsets for the rubberband selection, used in the get sequence dialog. You can call `view.getSelectedRegions(view.leftOffset, view.rightOffset)` to compute the selected regions from the offsets. ### Method setOffsets ### Parameters #### Path Parameters - **left** (BpOffset) - Optional - The left offset. - **right** (BpOffset) - Optional - The right offset. ### Return Value (void) ``` -------------------------------- ### Get LinearArcDisplay Display Mode Setting Source: https://jbrowse.org/jb2/docs/models/lineararcdisplay This getter returns the display mode setting for the LinearArcDisplay. ```typescript displayModeSetting: "displayMode" ``` -------------------------------- ### Configure TwoBitAdapter with Chrom Sizes Source: https://jbrowse.org/jb2/docs/config_guides/assemblies Optionally specify a .chrom.sizes file to speed up 2bit loading, especially for assemblies with many chromosomes. ```json { "type": "TwoBitAdapter", "twoBitLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.2bit", "locationType": "UriLocation" }, "chromSizesLocation": { "uri": "https://jbrowse.org/genomes/hg19/fasta/hg19.chrom.sizes", "locationType": "UriLocation" } } ``` -------------------------------- ### MCScanAnchorsAdapter - Pre-processor / simplified config Source: https://jbrowse.org/jb2/docs/config/mcscananchorsadapter This configuration provides a simplified way to set up the MCScanAnchorsAdapter with essential parameters. ```APIDOC ## MCScanAnchorsAdapter - Pre-processor / simplified config preprocessor to allow minimal config: ```json { "type": "MCScanAnchorsAdapter", "uri": "file.anchors", "bed1": "bed1.bed", "bed2": "bed2.bed", "assemblyNames": ["hg19", "hg38"] } ``` ``` -------------------------------- ### Get LinearArcDisplay Block Type Source: https://jbrowse.org/jb2/docs/models/lineararcdisplay This getter returns the type of block used by the LinearArcDisplay, which is a string. ```typescript blockType: "LinearArcDisplay" ``` -------------------------------- ### Get LinearComparativeDisplay Level Source: https://jbrowse.org/jb2/docs/models/linearcomparativedisplay Retrieves the current level of the display, typically used for zoom or detail. ```typescript level: number ``` -------------------------------- ### Action to Set Line Width Source: https://jbrowse.org/jb2/docs/models/linearreadarcsdisplaysettingsmixin Sets the line width for arcs. For example, thin=1, bold=2, extrabold=5. ```typescript setLineWidth: (n: number) => void ``` -------------------------------- ### Dynamically Add Track with &sessionTracks= Source: https://jbrowse.org/jb2/docs/urlparams Use `&sessionTracks=` to dynamically add a track to the session, including tracks defined with `FromConfigAdapter` for inline feature data. ```url https://jbrowse.org/code/jb2/main/?config=test_data/volvox/config.json&loc=ctgA:1-800&assembly=volvox&tracks=gff3tabix_genes,volvox_filtered_vcf,volvox_microarray,volvox_cram,url_track&sessionTracks=[{"type":"FeatureTrack","trackId":"url_track","name":"URL track","assemblyNames":["volvox"],"adapter":{"type":"FromConfigAdapter","features":[{"uniqueId":"one","refName":"ctgA","start":190,"end":191,"name":"Boris"}}]}] ``` -------------------------------- ### Defining a Configuration Schema with a Sub-Schema Source: https://jbrowse.org/jb2/docs/developer_guides/config_model Example of defining a ConfigurationSchema for BamAdapter, including a nested ConfigurationSchema for its index. ```typescript ConfigurationSchema( 'BamAdapter', { bamLocation: { type: 'fileLocation', defaultValue: { uri: '/path/to/my.bam', locationType: 'UriLocation' }, }, index: ConfigurationSchema('BamIndex', { indexType: { model: types.enumeration('IndexType', ['BAI', 'CSI']), type: 'stringEnum', defaultValue: 'BAI', }, location: { type: 'fileLocation', defaultValue: { uri: '/path/to/my.bam.bai', locationType: 'UriLocation', }, }, }), }, { explicitlyTyped: true }, ) ``` -------------------------------- ### Get LinearArcDisplay Renderer Type Name Source: https://jbrowse.org/jb2/docs/models/lineararcdisplay This getter returns the type name of the renderer used by the LinearArcDisplay. ```typescript rendererTypeName: "LinearArcRenderer" ``` -------------------------------- ### Get Renderer Type Name for LinearBareDisplay Source: https://jbrowse.org/jb2/docs/models/linearbaredisplay This getter returns the type name of the renderer associated with LinearBareDisplay. ```typescript rendererTypeName: any ``` -------------------------------- ### Prepare and Add VCF Track Source: https://jbrowse.org/jb2/docs/quickstart_web Compress and index VCF files using bgzip and tabix before adding them as a track. If the VCF is not sorted, use bcftools to sort it first. ```bash bgzip file.vcf tabix file.vcf.gz jbrowse add-track file.vcf.gz --load copy --out /var/www/html/jbrowse ``` ```bash bcftools sort file.vcf > file.sorted.vcf bgzip file.sorted.vcf tabix file.sorted.vcf.gz ``` ```bash bcftools view volvox.vcf --output-type z > volvox.vcf.gz rm volvox.vcf bcftools index --tbi volvox.vcf.gz ``` -------------------------------- ### Add Global Menu Item with No-Build Plugin Source: https://jbrowse.org/jb2/docs/developer_guides/no_build_plugin This example demonstrates adding a new menu to the JBrowse toolbar and appending a menu item to it using the `configure` method. Ensure to check for `pluginManager.rootModel` existence as `configure` can be called in a web worker. ```javascript export default class MyPlugin { name = 'MyPlugin' version = '1.0' install() {} configure(pluginManager) { if (pluginManager.rootModel) { pluginManager.rootModel.insertMenu('Citations', 4) pluginManager.rootModel.appendToMenu('Citations', { label: 'Cite this JBrowse session', onClick: session => { /* do nothing for now, see below for example */ }, }) } } } ``` -------------------------------- ### Get Adapter Map Entry Method Source: https://jbrowse.org/jb2/docs/models/assembly Retrieves a map entry for a given adapter configuration and options. ```typescript getAdapterMapEntry: (adapterConf: AdapterConf, options: BaseOptions) => Promise ```