FromConfig adapters
TL;DR: the FromConfig adapters take their data from an array written into
config.json, for small datasets or for features an API handed you. There are
three: FromConfigAdapter for features, FromConfigSequenceAdapter for
sequence, and FromConfigRegionsAdapter for refNames and lengths with no
sequence.
FromConfigAdapter
Each entry in features needs refName, start, end and a unique
uniqueId; type, name and any other attribute are optional and readable
from a jexl callback. It works under any feature
track type:
{
"type": "FeatureTrack",
"trackId": "inline_features",
"name": "Inline features",
"assemblyNames": ["volvox"],
"adapter": {
"type": "FromConfigAdapter",
"features": [
{
"refName": "ctgA",
"uniqueId": "feature1",
"start": 190,
"end": 250,
"type": "gene",
"name": "MyGene"
},
{
"refName": "ctgA",
"uniqueId": "feature2",
"start": 300,
"end": 400,
"type": "mRNA",
"name": "MyTranscript"
}
]
}
}
jbrowse add-track-json '{
"type": "FeatureTrack",
"trackId": "inline_features",
"name": "Inline features",
"assemblyNames": ["volvox"],
"adapter": {
"type": "FromConfigAdapter",
"features": [
{
"refName": "ctgA",
"uniqueId": "feature1",
"start": 190,
"end": 250,
"type": "gene",
"name": "MyGene"
},
{
"refName": "ctgA",
"uniqueId": "feature2",
"start": 300,
"end": 400,
"type": "mRNA",
"name": "MyTranscript"
}
]
}
}'
In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "FeatureTrack",
"trackId": "inline_features",
"name": "Inline features",
"assemblyNames": ["volvox"],
"adapter": {
"type": "FromConfigAdapter",
"features": [
{
"refName": "ctgA",
"uniqueId": "feature1",
"start": 190,
"end": 250,
"type": "gene",
"name": "MyGene"
},
{
"refName": "ctgA",
"uniqueId": "feature2",
"start": 300,
"end": 400,
"type": "mRNA",
"name": "MyTranscript"
}
]
}
}
FromConfigSequenceAdapter
The sequence adapter of an assembly, with each
feature's seq holding the bases for its region:
{
"name": "inline_assembly",
"sequence": {
"adapter": {
"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"
}
]
}
}
}
FromConfigRegionsAdapter
Names and lengths with no sequence, so a view can navigate and tracks can draw against an assembly whose FASTA you do not have or do not want to load. Same place in the config, and each feature is just an interval:
{
"name": "regions_only",
"sequence": {
"adapter": {
"type": "FromConfigRegionsAdapter",
"features": [
{ "uniqueId": "ctgA", "refName": "ctgA", "start": 0, "end": 50000 },
{ "uniqueId": "ctgB", "refName": "ctgB", "start": 0, "end": 6079 }
]
}
}
}
The same thing from a file is a
ChromSizesAdapter over a .chrom.sizes.