4.1.0 • Published 6 years ago

angularjs-genoverse v4.1.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

AngularJS - Genoverse

Build Status npm version Bower version

An AngularJS (1.x) directive, wrapping the Genoverse genome browser version 3.

Read more about how to use the browser here: http://wtsi-web.github.io/Genoverse/.

Example

A complete example is available at: https://RNAcentral.github.io/angularjs-genoverse/

Use this directive as a "web component" in your HTML:

<genoverse genome="genome" chromosome="chromosome" start="start" end="end" example-locations="exampleLocations">
    <genoverse-track name="'Sequence'" model="Genoverse.Track.Model.Sequence.Ensembl" view="Genoverse.Track.View.Sequence" controller="Genoverse.Track.Controller.Sequence" url="urls.sequence" resizable="'auto'" auto-height="true" extra="{100000: false}"></genoverse-track>
    <genoverse-track name="'Genes'" labels="true" info="'Ensembl API genes'" model="Genoverse.Track.Model.Gene.Ensembl" view="Genoverse.Track.View.Gene.Ensembl" url="urls.genes" resizable="'auto'" auto-height="true"></genoverse-track>
    <genoverse-track name="'Transcripts'" labels="true" info="'Ensembl API transcripts'" model="Genoverse.Track.Model.Transcript.Ensembl" view="Genoverse.Track.View.Transcript.Ensembl" url="urls.transcripts" resizable="'auto'" auto-height="true"></genoverse-track>
</genoverse>

Installation and requirements

This package is available at NPM and Bower.

We don't provide wrappers for AMD, CommonJS or ECMA6 modules, so you might need a shim for Webpack, Browserify, SystemJS or RequireJS.

To include the script with this directive in your HTML, use:

<!-- Uglified version -->
<script src=".../angularjs-genoverse/dist/angularjs-genoverse.min.js"></script>

<!-- Concatenated, but non-obfuscated source -->
<script src=".../angularjs-genoverse/dist/angularjs-genoverse.all.js"></script>

You'll also need the Genoverse browser itself (both JS and CSS). You can either download it directly from github, or use the version, included in this repository's lib folder:

<!-- CSS -->
<link rel="stylesheet" href="/lib/Genoverse/css/genoverse.css">
<link rel="stylesheet" href="/lib/Genoverse/css/controlPanel.css">
<link rel="stylesheet" href="/lib/Genoverse/css/fileDrop.css">
<link rel="stylesheet" href="/lib/Genoverse/css/karyotype.css">
<link rel="stylesheet" href="/lib/Genoverse/css/resizer.css">
<link rel="stylesheet" href="/lib/Genoverse/css/trackControls.css">
<link rel="stylesheet" href="/lib/Genoverse/css/tooltips.css">

<!-- Javascript -->
<script src=".../angularjs-genoverse/lib/Genoverse/js/genoverse.combined.js"></script>
<script src=".../angularjs-genoverse/lib/Genoverse/js/genomes/grch38.js"></script>

To use it in your AngularJS module, you need to specify Genoverse module as a dependency, e.g.

angular.module("Example", ["Genoverse"]);

AngularJS-Genoverse depends on angular.js and jquery. Don't forget to include them as well.

Configuration

We have 2 directives in this package: <genoverse> and <genoverse-track>.

Below is the full description of their attributes that you can use to configure them.

Note that all attributes are interpolated, i.e. use 2-way data-binding. So if you try passing an attribute as <genoverse attr="val">, angular will look for variable, called "val", not a string "val". If you want just to pass a literal, use another pair of quotes like: <genoverse attr="'literal'".

genoverse

Global configuration of the browser. To specify tracks, use nested <genoverse-track> tags within genoverse.

For more details, see: https://github.com/simonbrent/Genoverse/blob/master/docs/configuration.md (:warning: This fork of Genoverse contains latest documentation, but obsolete codebase).

AttributeTypeRequiredDefaultDescription
genomeObjecttrueName of genome to display with lowercase letters and underscore, e.g. 'homo_sapiens'
chrStringtrueEnsembl-style chromosome name, e.g. 'X' or '1' or '3R' or 'III'
startNumbertrueCurrent genome location, where viewport starts
endNumbertrueCurrent genome location, where viewport ends
example-locationsObjectfalseWhat location to display, when switching to another species e.g. {'homo_sapiens': {'chr': 'X', 'start': 73819307, 'end': 73856333}}
highlightsArrayfalse[]Array of regions to highlight, in the form { "start": 100, "end", 200, "label": "My highlight", "removable": false }
pluginsArrayfalse'controlPanel', 'karyotype', 'resizer', 'fileDrop'Array of plugins to use (chosen from Genoverse/js/plugins) ! Default different from original Genoverse
url-param-templateString/BooleanfalsefalseReplace url upon browser drags with this template interpolation ! Default different from original Genoverse
useHashBoolean/undefinedfalseundefinedHow URL is updated upon navigation (options: true=window.location.hash, false=window.history.pushState, undefined=HTML5history if available or fallback to hash, if not)
drag-actionStringfalse"scroll"Action performed on mouse drag (options: "scroll", "select", "off")
wheel-actionStringfalse"off"Action performed on wheel spin (options: "zoom", "off")
is-staticBooleanfalsefalseIf true, will stop drag, select and zoom actions occuring
saveableBooleanfalsefalseIf true, track configuration and ordering will be saved in sessionStorage/localStorage
storage-typeStringfalse"sessionStorage"Storage to use to save track configuration (options: "sessionStorage", "localStorage")
save-keyStringfalseundefinedDefault key, used in configuration storage is "genoverse". saveKey will be appended to it, if defined
auto-hide-messagesBooleanfalsetrueDetermines, whether to collapse popups with messages on tracks by default
track-auto-heightBoolean/undefinedfalsetrueDetermines, whether to auto-resize tracks to show all feauteres (can be overridden per-track by track's auto-height)
hide-empty-tracksBoolean/undefinedfalsetrueDetermines, whether to auto-hide tracks with no features in viewport (can be overridden per-track with track's hide-empty)

genoverseTrack

Configuration of a single track. Note that you don't have to create Scalebar track - it's present by default.

For more details, see: https://github.com/simonbrent/Genoverse/blob/master/docs/tracks/configuration.md (:warning: This fork of Genoverse contains latest documentation, but obsolete codebase).

AttributeTypeRequiredDefaultDescription
modelObjecttrueGenoverse.Track.Model subclass
model-extraObjectfalseExtra parameters to extend your model with: model.extend(modelExtra)
viewObjecttrueGenoverse.Track.View subclass
view-extraObjectfalseExtra parameters to extend your view with: view.extend(viewExtra)
controllerObjectfalseGenoverse.Track.Controller subclass
controller-extraObjectfalseExtra parameters to extend your controller with: controller.extend(controllerExtra)
extraObjectfalseExtra parameters to extend your track's configuration, e.g. track.extend(extra)
nameStringtrueTrack name
heightNumberfalse12Initial height of track in pixels
resizableBoolean/StringfalsetrueIf track's able to change height (options: true, false, "auto")
auto-heightBoolean/undefinedfalsebrowser.trackAutoHeightIf track automatically resizes to keep features visible (options: true, false, undefined for default)
hide-emptyBoolean/undefinedfalsebrowser.hideEmptyTracksIf track is hidden if there are no features to display in viewport (options: true, false, undefined for default)
marginNumberfalse2Space in pixels below the track and next track
borderBooleanfalsetrueIf true, track has a border under it
unsortableBooleanfalsefalseIf true, track re-ordering can't touch this track
urlString/Functiontrue! Different from original Genoverse: String template OR function that returns string template that track uses to download features data to display. E.g. 'https://rest.ensemblgenomes.org/sequence/region/homo_sapiens/CHR:START-END?content-type=text/plain'.Note that it uses __ASSEMBLY__, __CHR__, __START__ and __END__ variables, but doesn't support a variable for species/genome.
url-paramsObjectfalseundefinedObject of query params, added to url, e.g. {'foo': 'bar', 'x': 'y'} -> /?foo=bar&x=y
datafalseundefinedInstead of loading feautures with AJAX, pass them pre-defined.
all-dataBooleanfalsefalseIf all data are loaded in a single request and consequent AJAX calls are not required upon scrolling.
data-request-limitNumberfalseundefined
data-typeStringfalseundefineddataType setting to be used in the jQuery.ajax for getting data ! Different from original Genoverse: default undefined, not "json"
xhr-fieldsPlainObjectfalseundefinedxhrFieds setting to be used in the jQuery.ajax for getting data
feature-heightNumberfalsetrack.heightHeight of each feature
feature-marginObjectfalse{ top: 3, right: 1, bottom: 1, left: 0 }Space in pixels around each feature, when positioning on canvas and for bumping
colorStringfalse"#000000"Color of each feature
font-colorStringfalsefeature.color (if any) or track.colorDefault color for feature labels
font-weightString/Numberfalse"normal"Font weight
font-heightNumberfalse10Font height
font-familyStringfalse"sans-serif"Font family
labelsBoolean/StringfalsetrueDetermines, how labels are drawn (options: true, "overlay", "separate" or false)
repeat-labelsBooleanfalsefalseIf true, label is repeated along the length of feature
bumpBoolean/StringfalsefalseIf features are moved vertically within the track so that they don't overlap (options: true, false, "labels")
depthNumberfalseundefinedMaximum bumping depth for features in track, if required depth for a features is greater, it's not drawn
thresholdNumberfalseInfinityIf threshold is exceeded, features on track are not drawn
click-toleranceNumberfalse0By how many pixels at most you can drag the mouse, so that it's still considered a click (showing a popup), not a drag.
idStringfalse
4.1.0

6 years ago

4.0.5

6 years ago

4.0.4

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.1.0

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago