Package: dash-jbrowse
Dash JBrowseDashis a popular open-source framework
for building data-driven web apps. It is built on top of ReactJS, and provides atoolkitfor converting React components into
dash components that can be used in Dash apps written in Python, R, Julia, F# or
Matlab.Dash JBrowse'sLinearGenomeViewis a Dash component that wraps theJBrowse React Linear Genome Viewand
makes it possible to embed an interactive genome browser into any Dash
application. Now supporting theCircularGenomeViewas well.Quickstart$ pip install dash_jbrowseBasic linear genome view with an assemblyimport dash
import dash_jbrowse
from dash import html

print(dash_jbrowse.__version__)
app = dash.Dash(__name__)

my_assembly = {
    "name": "GRCh38",
    "sequence": {
        "type": "ReferenceSequenceTrack",
        "trackId": "GRCh38-ReferenceSequenceTrack",
        "adapter": {
            "type": "BgzipFastaAdapter",
            "fastaLocation": {
                "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz",
            },
            "faiLocation": {
                "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.fai",
            },
            "gziLocation": {
                "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/fasta/GRCh38.fa.gz.gzi",
            },
        },
    },
    "aliases": ["hg38"],
    "refNameAliases": {
        "adapter": {
            "type": "RefNameAliasAdapter",
            "location": {
                "uri": "https://s3.amazonaws.com/jbrowse.org/genomes/GRCh38/hg38_aliases.txt",
            },
        },
    },
}

app.layout = html.Div(
    [
        dash_jbrowse.LinearGenomeView(
            id="lgv-hg38",
            assembly=my_assembly
        ),
    ],
    id='test'
)

if __name__ == "__main__":
    app.run_server(debug=True)An example of the CGV can be found inusage_cgv.py.InstallationPyPI$ pip install dash_jbrowseInstall with virtual venvAfter cloning this repository, install virtualenv$ pip install virtualenv$ cd dash_jbrowse
$ python3 -m venv ./venv
$ source venv/bin/activate
$ pip install -r requirements.txtThen you can run the example app found in usage.pypython usage.pyUser GuideThe views can be customized in many ways, but the only properties that are
required to launch it are the id required for dash call backs and the assembly.id(string, required): the id used for dash callbacks. A basic example of
this component using dash callbacks can be found under the examples directory)assembly(object, required): the configuration object of the assembly being
used for the browser. More information about the configuration of the assembly
can be foundhere.top level assembly config{"name":"assemblyName","aliases":[],"sequence":{},"refNameAliases":{}}tracks(list, optional) - list of track configuration objects.top level track config{"trackId":"test-id","name":"track name","assemblyNames":[],"category":[]}defaultSession(object, optional) - information about the current app state
such as what views are opendefault session config{"name":"this session","view":{"id":"linearGenomeView","type":"LinearGenomeView"}}Note:"type": "CircularGenomeView"for CGVlocation(string or object, optional) - initiallocationfor when the browser first loads, e.g '1:500-1000' or location objectlocation object{"refName":1,"start":500,"end":1000}Note:Use 0-based coordinates in the location object.The location field is only used for LGV and not CGV.Checkout the storybookJBrowse React Linear Genome View docsor theJBrowse React Circular Genome View docsfor more configuration examples.Advanced CustomizationText SearchingAdding text searching to the JBrowse React Linear Genome View (not currently
available for the CGV) requires a couple of extra steps. We first need to create
an index via theJBrowse CLI tools. Once
an index is created, we can add a text search adapter to the list of aggregate
text search adapters in this component or to the configuration object of a
track.aggregateTextSearchAdapters(object, optional) - configuration of an index
used for text searchingAggregate text search adapter to use in the component.{"type":"TrixTextSearchAdapter","textSearchAdapterId":"adapter-id","ixFilePath":{"uri":"url/path/to/my/ix/file","locationType":"UriLocation"},"ixxFilePath":{"uri":"url/path/to/my/ixx/file","locationType":"UriLocation"},"metaFilePath":{"uri":"url/path/to/my/meta.json/file","locationType":"UriLocation"}}On a track configuration.{"trackId":"yourtrack","name":"Track name","adapter":{"type":"Gff3TabixAdapter","gffGzLocation":{"uri":"yourfile.gff.gz","locationType":"UriLocation"},"index":{"location":{"uri":"yourfile.gff.gz.tbi","locationType":"UriLocation"}}},"textSearching":{"textSearchAdapter":{"type":"TrixTextSearchAdapter","textSearchAdapterId":"hg19-index","ixFilePath":{"uri":"https://jbrowse.org/genomes/hg19/trix/hg19.ix","locationType":"UriLocation"},"ixxFilePath":{"uri":"https://jbrowse.org/genomes/hg19/trix/hg19.ixx","locationType":"UriLocation"},"metaFilePath":{"uri":"https://jbrowse.org/genomes/hg19/trix/meta.json","locationType":"UriLocation"},"assemblyNames":["hg19"]},"indexingAttributes":["Name","ID"],"indexingFeatureTypesToExclude":["CDS","exon"]}}Custom themes are also available.configuration- (object, optional) - color scheme configuration{"theme":{"palette":{"primary":{"main":"#311b92"},"secondary":{"main":"#0097a7"},"tertiary":{"main":"#f57c00"},"quaternary":{"main":"#d50000"},"bases":{"A":{"main":"#98FB98"},"C":{"main":"#87CEEB"},"G":{"main":"#DAA520"},"T":{"main":"#DC143C"}}}}}Academic UseThis package was written with funding from theNHGRIas
part of the JBrowse project. If you use it in an academic project that you
publish, please cite the most recent JBrowse paper, which will be linked fromjbrowse.org.ResourcesMore information aboutDashcan be found in thispostExamples of theLinearGenomeViewcomponent can be found in theusage.py, andbrowser.pyExamples of theCircularGenomeViewcomponent can be found in theusage.pyJBrowse React Linear Genome View-
documentation and examples of the React LGV component.JBrowse React Circular Genome View-
documentation and examples of the React CGV component.Config Guide- a guide to
configuring assemblies, tracks, text searching and more.JBrowse CLI tools- installation and
documentationTextSearching-
documentation of text indexing and text search adaptersContact usWereallylove talking to our users. Please reach out with any thoughts you
have on what we are building!Report a bug or request a feature athttps://github.com/GMOD/dash_jbrowse/issues/newJoin our developers chat athttps://gitter.im/GMOD/jbrowse2Send an email to our mailing list atgmod-ajax@lists.sourceforge.net