用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/GMOD/jbrowse-components --skill jbrowse-hosted-data命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when authoring a JBrowse 2 config.json, session, or track from scratch — including fetching and indexing the data files first — or when asked to build/show/open a genome-browser view of some data, add a track, set up a demo, or check that a JBrowse config is correct. Covers the config shape, the session spec, and a validator that catches the config errors JBrowse itself accepts silently.
Use when you need to see a JBrowse view rather than just build one — screenshot a genome browser, render a figure, check that a config you wrote actually shows data, drive JBrowse with Puppeteer, or automate clicking through the app. Covers the two capture tools and, above all, how to know the browser has finished rendering, which is the part that silently produces pictures of empty browsers.
基于 SOC 职业分类
正在显示 SKILL.md
| name | jbrowse-hosted-data |
| description | Use when a JBrowse task involves a genome that already exists publicly — |
Before building an assembly, check whether it is already published.
genomes.jbrowse.org hosts a self-contained
JBrowse config.json per assembly, covering the UCSC genome browser databases
and the UCSC GenArk assemblies. Each is CORS-enabled and needs no setup.
Downloading and indexing hg38 to show a gene is the single most common way to turn a two-minute task into an hour of bandwidth.
One config.json carries the remote 2bit sequence, refName aliases (1 /
chr1 / NC_000001.11 all resolve), cytobands for the ideogram, the UCSC track
catalog with a trackId each, and — for the UCSC databases — a text-search
index that makes a gene name work as a location.
GenArk assemblies carry sequence, aliases and their own smaller track set; not
all ship a text index. Check for aggregateTextSearchAdapters before relying on
a gene name.
UCSC database https://jbrowse.org/ucsc/<db>/config.json
GenArk accession https://jbrowse.org/hubs/genark/<GCA|GCF>/<3>/<3>/<3>/<accession>/config.json
GenArk fans the first nine digits into three directories: GCA_964188535.1 ->
.../genark/GCA/964/188/535/GCA_964188535.1/config.json. Both are wrapped by
the --hub flag below, so usually you name the assembly and never build the
URL.
https://jbrowse.org/ucsc/all.json is every UCSC assembly in one config, with
both directions of every pairwise liftOver. Reach for it when a session spans
two genomes, since both assemblies are then already declared and neither has to
be resolved at run time. It is a much bigger fetch, so use a per-assembly config
otherwise.
npx @jbrowse/img list prints the couple of hundred UCSC databases. The GenArk
tail is tens of thousands, so search it instead —
https://genomes.jbrowse.org/searchIndex.json, one bare array per assembly:
[accession, commonName, scientificName, assemblyName, assemblyStatus,
source, taxonId, ncbiStatusBits, year, ucscRank, altAccession]
curl -s https://genomes.jbrowse.org/searchIndex.json |
jq -r '.[] | select((.[2]|ascii_downcase) | test("ambystoma mexicanum")) |
"\(.[0])\t\(.[1])\t\(.[3])"'
# GCF_040938575.1 axolotl (Mex_15411 2024 refseq) UKY_AmexF1_1
The accession is the --hub name; the config URL follows from the scheme above.
7.5 MB, so filter it with jq — do not read it into context. source == "ucsc"
means a UCSC db exists for that row; prefer the db name, its track set is
richer. ncbiStatusBits & 1 marks NCBI's designated reference for the species.
npx @jbrowse/img list # every hosted UCSC assembly
npx @jbrowse/img list hg38 # its tracks: trackId / type / name
npx @jbrowse/img list hg38 clinvar # filtered on id or display name
Or read the config directly:
curl -s https://jbrowse.org/ucsc/hg38/config.json |
jq -r '.tracks[] | "\(.trackId)\t\(.type)\t\(.name)"'
trackIds are prefixed with the assembly (hg38-clinvarMain). Do not guess
one — a trackId that does not exist opens nothing and reports nothing.
## a static image, no browser
npx @jbrowse/img --hub hg38 --track hg38-ncbiRefSeqCurated --loc BRCA1 --width 1200 --out out.png
## a link
npx @jbrowse/capture url --hub hg38 --loc BRCA1 --track hg38-ncbiRefSeqCurated
## the real app, screenshotted once it has drawn
npx @jbrowse/capture --hub hg38 --loc BRCA1 --track hg38-ncbiRefSeqCurated -o out.png
The link is a plain
?config=<hub config URL>&assembly=<name>&loc=<where>&tracks=<ids> against any
JBrowse Web instance.
Two behaviours to know, because both mislead:
&loc= accepts a gene name (via the text index). The loc field inside a
session spec does not — it is parsed as a locstring and throws on a name.
Symbol -> URL parameters; coordinates -> either.&tracks= adds to the hub's own default session, it does not replace it,
so the view opens with your tracks plus whatever the config already showed.The pattern that removes the slow step: hosted assembly and annotation, your data as a session track, nothing written to disk.
{
"sessionTracks": [
{
"type": "VariantTrack",
"trackId": "my_variants",
"name": "My variants",
"assemblyNames": ["hg38"],
"adapter": {
"type": "VcfTabixAdapter",
"uri": "https://your-host/yours.vcf.gz"
}
}
],
"views": [
{
"type": "LinearGenomeView",
"assembly": "hg38",
"loc": "chr17:43,044,000-43,126,000",
"tracks": ["hg38-ncbiRefSeqCurated"
npx @jbrowse/capture --hub hg38 --session spec.json -o mine.png
assemblyNames names the hub's assembly; the view's tracks mixes a hosted id
with the one just defined. Your file has to be reachable by the browser — a
public URL with CORS, or a local server. Pick the adapter type with
jbrowse-authoring's references/config-types.md.
hgdownload.soe.ucsc.edu.Then use jbrowse add-assembly — see the jbrowse-authoring skill.
&sessionTracks= and &hubURL=