GithubHelp home page GithubHelp logo

decipher-genomics / genoverse Goto Github PK

View Code? Open in Web Editor NEW
105.0 27.0 44.0 15.66 MB

HTML5 scrollable genome browser

Home Page: https://genoverse.org/

License: Other

HTML 0.49% CSS 3.52% JavaScript 95.98%
genome visualisation

genoverse's Introduction

Genoverse Build Status

Genoverse is a portable, customizable, back-end independent JavaScript and HTML5 based genome browser which allows the user to explore data in a dynamic and interactive manner.

Data is visualized in the browser, meaning Genoverse can be installed on any website and show data from a wide range of online or local sources.

Genoverse works with a variety of formats, such as JSON, BED, BAM, VCF, GFF, delimited text files, or XML, and can be customized to parse and display any data source as required.

Genoverse works using a system of tracks - essentially horizontal sections of the genome browser which display features - genes, variants, etc. with defined genomic start and end points. Each track has its own data set stored in a model, a method for displaying that data, stored in a view, and a controller to manage the creation of DOM elements, and user interactions with them.

Tracks can have multiple models and views, which allows for switching between displays at different zoom levels. An example of this would be a track where you show genes when looking at a large region of a chromosome, and then switch to showing transcripts as the user zooms in.

In addition to this, Genoverse has a set of plugins, which allow additional functionality beyond the core genome browser. These include a control panel for adding and removing tracks, and interacting with the browser more easily, a way to add controls to each individual track, and a way to enable drag and drop of local data files onto the genome browser.

Installation

Install from npm

yarn add genoverse

Basic embedding

Embed Genoverse using

<script src="/path/to/genoverse/dist/genoverse.js"></script>

Add a script tag or JavaScript file which initializes Genoverse, e.g.

<script>
  const genoverse = new Genoverse({ ... configuration ... });
</script>

Once initalized, the instance of Genoverse is avaliable as a jQuery data attribute on the container DOM element, and can be accessed by

const genoverse = Genoverse.jQuery(container).data('genoverse');

Build options

By default, the Genoverse distribution in created with Babel and certain polyfills, in order to support old web browsers like Internet Explorer 11.

If you want to create your own distribution bundle, see devDependencies in package.json for Webpack/Babel packages you need to install in order to be able to do so.

Once these dependencies are installed, distributions can be built with webpack-cli.

Polyfills can be disabled, either with

yarn webpack --env no-polyfills

which still uses Babel to create ES5-compatible code, but doesn't include the polyfills (useful if the page already includes polyfills), or with

yarn webpack --env modern

which does not transpile to ES5-compatible code or include polyfills, and thus will not work in old browsers at all.

Additionally, you can set the webpack output.publicPath with

yarn webpack --env public-path=/public/path/to/genoverse

This is necessary if /path/to/genoverse/dist is not your webserver's root directory for static files.

This option can be combined with --env no-polyfills or --env modern, e.g.

yarn webpack --env modern --env public-path=/public/path/to/genoverse

Importing into other webpack-bundled code

You can use webpack's import keyword to import Genoverse's source code into another application, without needing to build a distribution (or installing any additional packages):

// static import
import Genoverse from 'genoverse';

// dynamic import, useful if you need to avoid server-side importing Genoverse,
// which doesn't work because it depends on `window`
const Genoverse = await import('genoverse').then(module => module.default);

Using Genoverse.configure()

The Genoverse class provides a configure function which allows you to change what code will be imported. This function is run automatically when an instance of Genoverse is constructed, but can also be called manually - only the first execution will have any affect.

The default arguments are as follows:

Genoverse.configure({
  tracks      : {},    // see below
  plugins     : {},    // see below
  genomes     : {},    // see below
  css         : true,  // if true, Genoverse's css file will by dynamically imported
  fontawesome : true,  // if true, fontawesome 6 will be dynamically imported. Set to false if fontawesome is already in use on the page
  force       : false, // if true, configuration is updated according to the other arguments
});
tracks: {
  // A list of tracks, controllers, models, or views which you don't want to appear in the Genoverse.Track namespace.
  // Note: this does not stop files containing excluded code from being present in the webpack bundle.
  exclude: [
    // The code in src/js/Track/Model/Transcript/Ensembl.js will not be present as Genoverse.Track.Model.Transcript.Ensembl
    'Model.Transcript.Ensembl',

    // The code in src/js/Track/View/Sequence/Variation.js will not be present as Genoverse.Track.View.Sequence.Variation
    'View/Sequence/Variation',

    // The code in src/js/Track/library/Gene.js will not be present as Genoverse.Track.Gene
    'Gene',

    // The code in src/js/Track/library/dbSNP.js will not be present as Genoverse.Track.dbSNP
    'library/dbSNP',

    ...
  ],

  // A webpack `require.context` for a folder containing custom track definitions.
  // This folder must be structured in the same way as src/js/Track, i.e. with some/or of the sub-folders Controller, Model, View, library
  include: require.context('/path/to/custom/tracks/folder', true, /\.js$/),
}
plugins: {
  // A webpack `require.context` for a folder containing custom plugins.
  include: require.context('/path/to/custom/plugins/folder', true, /\.js$/),
}
genomes: {
  // A webpack `require.context` for a folder containing custom genome definitions.
  // The human genomes GRCh37 and GRCh38 are included in the Genoverse repo, and imported dynamically if needed (see src/js/genomes).
  // Additional genomes can be loaded with the following option, or by using new Genoverse({ ... genome: aGenomeDefinitionObject ... })
  include: require.context('/path/to/custom/genomes/folder', true, /\.js$/),
}

Before Genoverse.configure is executed, Genoverse.Track, Genoverse.Track.Controller, Genoverse.Track.Model, and Genoverse.Track.View all exist, but none of their children (i.e. Genoverse.Track.Foo) will.

Because of this, if you want to use track classes as options in new Genoverse(), you need to call Genoverse.configure() first, i.e.

Genoverse.configure({ ... });

new Genoverse({
  ...
  tracks: [
    Genoverse.Track.Foo,
    Genoverse.Track.Bar.extend({ foo: false, bar: true, ... }),
    Genoverse.Track.extend({
      controller : Genoverse.Track.Controller.Foo,
      model      : Genoverse.Track.Model.Foo.extend({ foo: true }),
      view       : Genoverse.Track.View.Foo.Bar,
    }),
  ]
});

Alternatively, you can do the following without having to call Genoverse.configure() first:

new Genoverse({
  ...
  tracks: [
    'Foo',                                     // -> Genoverse.Track.Foo
    [ 'Foo' ],                                 // -> Genoverse.Track.Foo
    [ 'Bar', { foo: false, bar: true, ... } ], // -> Genoverse.Track.Bar.extend({ foo: false, bar: true, ... })
    {                                          // -> Genoverse.Track.extend({
      foo        : false,                      // ->   foo        : false,
      bar        : false,                      // ->   bar        : false,
      controller : [ 'Foo' ],                  // ->   controller : Genoverse.Track.Controller.Foo,
      model      : [ 'Foo', { foo: true }],    // ->   model      : Genoverse.Track.Model.Foo.extend({ foo: true }),
      view       : 'Foo.Bar',                  // ->   view       : Genoverse.Track.View.Foo.Bar,
    }                                          // -> })
  ]
});

See index.html for example configuration, or the documentation for more details about configuration properties.

genoverse's People

Contributors

andrewtikhonov avatar ashimiblessing avatar dependabot[bot] avatar eugenebragin avatar hsriat avatar sarahhunt avatar simonbrent avatar sourabh2k15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

genoverse's Issues

How practical

I want to use the genoverte plug-in. I feel great, but I can't find the API file. There are only simple examples. What do I need to do if I want to use full functionality?

Document karyotype initialisation

How does one initialise the chromosome track after the karyotype plugin rewrite (07b1a74)?

I tried something like:

var genoverseConfig = {
  container     : '#genoverse',
  chr: 7,
  genome: 'grch37',
  plugins       : [ 'controlPanel', 'karyotype'],
  tracks        : [
    Genoverse.Track.Chromosome,
    Genoverse.Track.Scalebar,
    // more code

but the chromosome is not rendered properly:

screen shot 2014-07-17 at 11 37 16

Any guidance will be greatly appreciated!

Track available but not displayed

Hi everybody.

first thanks for this great browser. It is the best for me.
I would like to put tracks as available and to not displayed its in my browser.
How can I do that ?

Thanks

Detecting when a Genoverse instance is ready

Currently Genoverse initialisation is highly asynchronous, and as far as I know there is no way of detecting when a newly created Genoverse instance is ready for further instructions like browser.zoomOut() or browser.moveTo().

This would be particularly useful when a Genoverse browser is created dynamically or when a browser needs to be controlled by some external UI elements.

Any advice on how to manage situations like this?

Wrong reference sequence for GRCh37

Hello,

Just noticed that "Sequence" track shows GRCH38 genome sequence even if I switch to GRCH37 in index.html options:

<script type="text/javascript" src="js/genoverse.combined.js">
      {
        container : '#genoverse', // Where to inject Genoverse (css/jQuery selector)
        // If no genome supplied, it must have at least chromosomeSize, e.g.:
        // chromosomeSize : 249250621, // chromosome 1, human
        genome    : 'grch37', // see js/genomes/

May be it will be useful to choose genome version in Genoverse.Track.Model.Sequence.Ensembl url like this:

Genoverse.Track.Model.Sequence.Ensembl = Genoverse.Track.Model.Sequence.extend({
  url              : '//rest.ensembl.org/sequence/region/human/__CHR__:__START__-__END__?content-type=text/plain;coord_system_version=GRCh37', // Example url
  dataRequestLimit : 10000000 // As per e! REST API restrictions
});

Thank you!

In new Genoverse exon-intron structure is not displayed, what's wrong with my parseData?

I tried to adapt RNAcentral track to new Genoverse and it mostly works, except by the fact that exon-intron structure is lost.

Here's my parseData function, which previously worked. I added subFeatures attribute to parent transcripts and started adding child exons to subFeatures array.

    GenoverseUtils.prototype.RNAcentralParseData = function(data) {
        for (i = 0; i < data.length; i++) {
            var feature = data[i];

            // prepare a label
            var label = feature.description || feature.external_name;
            if (label.length > 50) { label = label.substr(0, 47) + "..."; }
            if (feature.strand == 1) { label = label + " >"; }
            else if (feature.strand == -1) { label = "< " + label; }

            if (feature.feature_type === 'transcript' && !this.featuresById[feature.ID]) {
                feature.id    = feature.ID;
                feature.label = label; // used to be feature.external_name
                feature.exons = {};
                feature.subFeatures = [];
                feature.cds   = [];
                feature.chr   = feature.seq_region_name;

                this.insertFeature(feature);
            }
            else if (feature.feature_type === 'exon' && this.featuresById[feature.Parent]) {
                feature.id  = feature.ID;
                feature.chr = feature.seq_region_name;

                if (!this.featuresById[feature.Parent].exons[feature.id]) {
                    this.featuresById[feature.Parent].subFeatures.push(feature);
                    this.featuresById[feature.Parent].exons[feature.id] = feature;
                }
            }
        }
    };

I'm using model="Genoverse.Track.Model.Transcript.Ensembl" and view="Genoverse.Track.View.Transcript.Ensembl".

jQuery.Deferred exception: Cannot read property 'start' of undefined TypeError: Cannot read property 'start' of undefined

Hi, I'm using Genoverse release 2.4.1 (commit: b46d566)

I experience the following error:

jQuery.Deferred exception: Cannot read property 'start' of undefined TypeError: Cannot read property 'start' of undefined

which happens in makeFirstImage() function:

      var buffer = this.prop('dataBuffer');

      this.model.getData(start - buffer.start - length, end + buffer.end + length).done(makeImages).fail(function (e) {
        controller.showError(e);
      });

Seems, like dataBuffer property is undefined. I'm initializing Genoverse as follows:

new Genoverse({
    container: element.find('#genoverse'),
    chr: scope.chromosome,
    species: scope.genome.species,
    showUrlCoords: false, // do not show genomic coordinates in the url
    plugins: ['controlPanel', 'resizer', 'fileDrop'],
         tracks: [
             Genoverse.Track.Scalebar,
             Genoverse.Track.extend({
                 name: 'Sequence',
                 model: configureGenoverseModel('ensemblSequence'),
                 view: Genoverse.Track.View.Sequence,
                 controller: Genoverse.Track.Controller.Sequence,
                 resizable: 'auto',
                 100000: false,
             }),
             Genoverse.Track.extend({
                 name: 'Genes',
                 info: 'Ensembl API genes',
                 labels: true,
                 model: configureGenoverseModel('ensemblGene'),
                 view: Genoverse.Track.View.Gene.Ensembl,
                 controller: Genoverse.Track.Controller.Ensembl,
              }),
              Genoverse.Track.extend({
                  name: 'Transcripts',
                  info: 'Ensembl API transcripts',
                  labels: true,
                  model: configureGenoverseModel('ensemblTranscript'),
                  view: Genoverse.Track.View.Transcript.Ensembl,
                  controller: Genoverse.Track.Controller.Ensembl,
              }),
              Genoverse.Track.extend({
                  name: 'RNAcentral',
                  id: 'RNAcentral',
                  info: 'Unique RNAcentral Sequences',
                  labels: true,
                  model: configureGenoverseModel('rnacentral'),
                  view: Genoverse.Track.View.Transcript.Ensembl,
                  controller: Genoverse.Track.Controller.Ensembl,
              })
          ]
      })

where scope.genome.species is "Homo Sapiens", scope.chromosome is "X", scope.start and scope.stop are reasonable. I'm trying to create an Angular directive, wrapping your code.

Why would that happen?

Resizing tracks to view hidden elements from message

When Genoverse tells you it has suppressed features there is no obvious way to resize the height of the track to view these features. It would be really nice if there was a Click here to resize link or something similar on that message. I know this is replicating functionality already present on the image if you click on the track height resize widget but it would make it more usable.

screen shot 2014-07-11 at 11 53 43

Persistent highlighting a region of the genome

UCSC released a new feature on the 4th March called *Genome Browser Highlight". The idea is you can drag select a region (holding shift & draw a region) and then choose to highlight it rather than zooming in. The highlight persists on multiple levels of zoom (if you zoom into the highlighted region then everything is highlighted).

They also support highlighting of a region based on a feature (it makes finding co-located features with a gene/transcript a lot easier).

ScatterPlots?

Any plans on developing a Scatter Plot Track?

Thanks!

Matt

How can i load my local genome feature file and perform it in the web?

I have my own genomes features in a json file, (shows below): I put the file in the path -- '/src/js/genomes' of Genoverse and named it 'mvp.js', and i use the follwing code, but it didn't work.

Need your help! sir!

or can someone just tell me how i can use only my own genome feature in the web?

the genoverse script code:

<script> 
new Genoverse({ 
container: '#genoverse', 
genome: 'mvp', 
plugins: ['controlPanel', ['karyotype', { showAssembly: true }], 'trackControls', 'resizer', 'focusRegion', 'fullscreen', 'tooltips', 'fileDrop'], tracks: [ 
['Scaleline', { strand: false }], 
'Scalebar', { name: 'Sequence', controller: 'Sequence', model: 'Sequence.Ensembl', view: 'Sequence', 100000: false, resizable: 'auto', }, 'Gene', { 
name: 'my_gene Features', 
data: '../public/Genoverse_files/mvp.js',    //also copied one here
resizable: 'auto',
 model: { dataRequestLimit: 5000000 }, 
setFeatureColor: function (f) { f.color = '#AAA'; } }, ] });
 </script>

the content of 'mvp.js' just like this:
[{
"logic_name": "gene",
"feature_type": "gene",
"end": 67859,
"biotype": "protein_coding",
"gene_acc": "SG0050.p01",
"protein_acc": "BAE73325.1",
"strand": 0,
"id": "flagellum-specific ATP synthase FliI (SG0050)",
"start": 66483
}, {
"logic_name": "gene",
"feature_type": "gene",
"end": 68615,
"biotype": "protein_coding",
"gene_acc": "SGP1_0042.p01",
"protein_acc": "BAE75749.1",
"strand": 0,
"id": "achromobactin biosynthetic and transport gene yhcA (SGP1_0042)",
"start": 67227
}
...........
]

Can you make a bundle without jquery and other standard dependencies, available via npm?

Unfortunately, Genoverse bundle conflicts with other instances of jquery (so can do other libraries in Genoverse bundle) that I have in the project. Can you do a version of bundle with Genoverse and its modules only and specify required libraries in npm dependencies section?

I saw some Webpack files in newer version of Genoverse. I wanted to mention that Webpack is not suitable for libraries distribution - it's meant for website distribution. For bundling libraries, they usually use some npm script/gulp/grunt chain of commands. For libraries they also recommend Rollup, especially, if it's in ECMA6.

Thanks and cheers!

Tracks for Coverage

Hi,

We are using Genoverse for a very important project and part of the requirements is to display a track for Coverage. But I don't see a clue how to implement this. Does Genoverse have a way to display this type of track? Is it supported?

Selecting a different chromosome without reloading the whole page

I'm currently integrating Genoverse into a genomic data site. So far I'm really liking it.

I made a chromosome menu, which I want to use to change the visible chromosome dynamically, i.e. without reloading the whole page. I did try hacking around with Genoverse.init() and a few other methods, to try and force it to initialise with an altered "chr" parameter in the config, but just ended up with javascript errors. Adding a method to easily change the chromosome would be nice. Or just point me in the right direction. :) Thank you, Matt

Sequence track dissapears

When clicking on the Karyotype at the top, the sequence track disappears and won't reappear until the reset focus button is clicked.

Mixing GRCh37 with GRCh38

Hi,

I noticed that the dbSNP track (Genoverse.Track.dbSNP) is showing SNPs in exons but calling them intronic snps. This is evident on the sample setup you maintain on genoverse.org. I think the problem is that you’ve hard-coded the ensembl GRCh37 build into the URL called by Genovese.Track.dbSNP.

I suspect that this is a very easy fix, however, it might be a problem for other tracks that I haven’t seen yet. It is also very difficult to identify since we sort of trust that the features that we say are on a track really are there!

Need help to add custom track

Hello,

I would like implementing your genome browser in my web site (made with LARAVEL).
The url used is a script which perform a sql query to get data and return results as json.
I used the parseData function to create feature with start, end and id.
The problem is I'm not able to display the track in the browser, more exactly the track is created but it is empty. The Gene and dbSNP tracks are OK.

Could you help me please ?

Main script :

var genoverseConfig = {
container : '#genoverse',
width    : 1000,
genome    : 'grch37',
plugins   : [ 'controlPanel', 'karyotype', 'trackControls', 'resizer', 'focusRegion', 'fullscreen', 'tooltips',     'fileDrop' ],
   tracks    : [
    Genoverse.Track.Scalebar,
   Genoverse.Track.extend({
        name       : 'Sequence',
        controller : Genoverse.Track.Controller.Sequence,
       model      : Genoverse.Track.Model.Sequence.Ensembl,
        view       : Genoverse.Track.View.Sequence,
        100000     : false,
        resizable  : 'auto'
      }),
 Genoverse.Track.Chromosome,
 Genoverse.Track.Gene,
 Genoverse.Track.test,
 Genoverse.Track.dbSNP
  ]
};
 document.addEventListener('DOMContentLoaded', function () { window.genoverse = new
 Genoverse(genoverseConfig);
 });

js of my custom track.

 Genoverse.Track.test = Genoverse.Track.extend({
  id               : 'test',
   name             : 'test',
   info             : 'show cnv from test databases',
   url              : 'http://localhost:8888/select_cnv_browser',
   height : 55,
   bump: true,
   label : true,
   model:Genoverse.Track.Model.extend({
     parseData : function(data){
       for (var i = 0; i < data.length; i++) {
         var feature = data[i];
         var color = '#FFFFFF';
         if (feature["chromosome"] === this.browser.chr){
           // console.log(feature);
           this.insertFeature({
             start           : feature["hg19_start"],
             end             : feature["hg19_end"],
             id              : feature["cnv_id"],
             label           : feature["cnv_id"],
             originalFeature : feature
          });
         }
       }
     }
   })
 });

Configuration menu

To begin with - to have list of available tracks for user to choose from

Trix & BigTab Support

Trix is a free text search engine (http://genome.ucsc.edu/goldenPath/help/trix.html) developed by UCSC allowing you to search for values within a track and returning an ID in which that value was found. Their main use-case is in TrackHubs where a track can have a trix index attached using the searchTrix parameter. Supporting this and allowing searching of the trix index from Genoverse would be really cool.

BigTab is an attribute format from UCSC not yet released but should hold IDs to attribute lists. Once we have more information I will feed this back to you

Big File Support

Native BigFile support such as:

  • BigBed
  • BigWig
  • Tabix indexed files (block gzipped)
    • This includes VCF but could be rolled out to other tab delimited formats

Hide tracks by default

Hi,

Is it possible to make a track available in the "Tracks" menu but hide it by default ?
i.e. I want to have the dbSNP track available in the menu but I would like this track to be hidden when I load the Genoverse widget.

Thanks,

Laurent

jquery-ui clashes with d3 for mouseup event

If you have genoverse on a page, running at the same time with d3, jquery-ui in genoverse will break d3 mouseup events - e.g. your d3 brushes will stop emitting brushend event, your selections will never be closed and zooms won't work.

To reproduce, try a page with both Genoverse and some d3 plugin (such as feature-viewer or fornac) and with d3 only. Open Chrome Developer Tools, go to Event Listener Breakpoints and try settings a breakpoint to mouseup - you'll find out that d3's brushend event is fired when Genoverse is not displayed, but is not fired, when Genoverse is displayed.

genoverse leaves some dangling deferreds after browser.destroy()

I'm observing the following incorrect behaviour with Genoverse.

I initialise Genoverse with 3 tracks, one of them is loading very slowly.

screen shot 2018-05-10 at 18 00 14

After that user might opt to destroy the browser (I call browser.destroy()).

If I destroy Genoverse before all the track data were loaded and their respective images were rendered by makeImage()/makeFirstImage(), 5 seconds after destruction of the browser, the asynchronous callback of getData() fires.

This is happening because of the following async call stack:

loadGenome() ->
$when(Genoverse.ready, this.loadGenome(), this.loadPlugins()) ->
init() ->
setRange() ->
setScale() ->
onTracks("makeFirstImage") ->
makeFirstImage() ->
makeImages() ->
makeImage() ->
getData()

getData() creates a deferred, which fires 5 seconds after destruction of the browser. But all deferreds on tracks are supposed to be cleared by browser.destroy()! And indeed the list of deferreds on all tracks is empty after I call browser.destroy():

console.log(ctrl.browser.tracks.reduce((accumulator, track) => return accumulator.concat(track.controller.deferreds), []));
browser.destroy();
console.log(ctrl.browser.tracks.reduce((accumulator, track) => return accumulator.concat(track.controller.deferreds), []));

returns

(12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
[]

I've been scratching my head for 3 days, I guess, I need help.

You can observe this behaviour here, if you try to switch species (I destroy the old instance of browser and create a new one upon species switch): https://test.rnacentral.org/genome-browser.

How to load my own genome feature in the Genoverse tracks?

I have my own genomes features in a json file, (shows below): I put the file in the path -- '/src/js/genomes' of Genoverse and named it 'mvp.js', and i use the follwing code, but it didn't work.

Need your help! sir!

can someone just tell me how i can use my own genome feature in the web?

the genoverse script code:

"""

<script> new Genoverse({ container: '#genoverse', genome: 'mvp', plugins: ['controlPanel', ['karyotype', { showAssembly: true }], 'trackControls', 'resizer', 'focusRegion', 'fullscreen', 'tooltips', 'fileDrop'], tracks: [ ['Scaleline', { strand: false }], 'Scalebar', { name: 'Sequence', controller: 'Sequence', model: 'Sequence.Ensembl', view: 'Sequence', 100000: false, resizable: 'auto', }, 'Gene', { name: 'my_gene Features', data: '../public/Genoverse_files/mvp.js', resizable: 'auto', model: { dataRequestLimit: 5000000 }, setFeatureColor: function (f) { f.color = '#AAA'; } }, ] }); </script>

""""

the content of 'mvp.js' just like this:
[{
"logic_name": "gene",
"feature_type": "gene",
"end": 67859,
"biotype": "protein_coding",
"gene_acc": "SG0050.p01",
"protein_acc": "BAE73325.1",
"strand": 0,
"id": "flagellum-specific ATP synthase FliI (SG0050)",
"start": 66483
}, {
"logic_name": "gene",
"feature_type": "gene",
"end": 68615,
"biotype": "protein_coding",
"gene_acc": "SGP1_0042.p01",
"protein_acc": "BAE75749.1",
"strand": 0,
"id": "achromobactin biosynthetic and transport gene yhcA (SGP1_0042)",
"start": 67227
}
...........
]

Track for Coverage 2018

Hello Simon. I´m new to Javascript and programming in general but have been working for several weeks on Genoverse trying to add a read coverage track. This issue has a similar one from 2016 but in August 2017 you added WIG and BIGWIG support to Genoverse so I believe things have changed. The WIG display is spot on what we need, I just added some code so it could discard headers and read in several times "fixedStep..." in case they were any gaps in the WIG, as it only reads this statement at the start of the file.

I was making WIGs from small BAMs to test it all out, but everything came crashing down when my "employers" asked me to load up a transcript.bam of a whole chromosome. To start off they are not budging to any explanations that they can just as easily make a genomic bam adding another option to their command (they are using rsem-calculate-expression which by default can give either a transcript or a genomic bam, but they just want the transcript bam now, unless I convince them otherwise) so I must work with that. The transcript start and end positions would be extracted from an accompanying gff3 supposedly.

I also observed you have coping mechanisms for large files (bam works with a bai and dalliance, vcf works with tbi and tabix) but it doesn´t seem there is such a thing for the WIGs right?

Therefore my questions are:
1- Any tips on how to work with a large WIG file?
2- Any tips on sending data from one filereader to another filereader (or something similar)?

PD: Sorry for the rant, this public version of Genoverse is very well organised but if I find out anything you could also find useful I´ll share if you want

Wiggle Support

It would be great if genoverse could support continuous data sets such as those found in wig files. Ideally supporting:

  • line drawing
  • bar charts

I would really like to see support for the following (but they can be pushed into separate issues once the basic support is there):

  • configurable axis/cut-offs
  • set a cut-off but just draw a line across to highlight the outliers
  • log rendering
  • support more than 1 wiggle data set in a single track

How to display highlights? What's the difference between highlights and mouse drag action mode highlights?

I'm trying to create highlights either in a declarative way by passing highlights option to Genoverse constructor:

      browser = new Genoverse({
        container : '#genoverse', // Where to inject Genoverse (css/jQuery selector/DOM element)
        // If no genome supplied, it must have at least chromosomeSize, e.g.:
        // chromosomeSize : 249250621, // chromosome 1, human
        genome    : 'grch38', // see js/genomes/
        chr       : 13,
        start     : 32296945,
        end       : 32370557,
        plugins   : [ 'controlPanel', 'karyotype', 'trackControls', 'resizer', 'focusRegion', 'fullscreen', 'tooltips', 'fileDrop' ],
        // !!!!!!!!!!!!!!!!!!!!!!!!!!!! highlights !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        highlights: [{start: 32296945, end: 32370557, label: "highlight", removable: true}],
       // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        tracks    : [
          Genoverse.Track.Scalebar,
          Genoverse.Track.extend({
            name       : 'Sequence',
            controller : Genoverse.Track.Controller.Sequence,
            model      : Genoverse.Track.Model.Sequence.Ensembl,
            view       : Genoverse.Track.View.Sequence,
            100000     : false,
            resizable  : 'auto'
          }),
          Genoverse.Track.Gene,
          Genoverse.Track.extend({
            name            : 'Regulatory Features',
            url             : 'http://rest.ensembl.org/overlap/region/human/__CHR__:__START__-__END__?feature=regulatory;content-type=application/json',
            resizable       : 'auto',
            model           : Genoverse.Track.Model.extend({ dataRequestLimit : 5000000 }),
            setFeatureColor : function (f) { f.color = '#AAA'; }
          }),
          Genoverse.Track.dbSNP
        ]
      });

or invoking

browser.addHighlight({start: 32296945, end: 32370557, label: "highlight", removable: true})

All in vain, nothing is displayed.

At the same time, if I try to go to mouse drag action mode to select a region and then press "highlight" it creates some highlights. But those highlights are apparently different from highlights in menu. In the bottom right corner of the screen I have console open and it still shows my declarative highlight.

2018-01-26 13-57-03

I'm on the tip of my pull request.

Thank you!

How to load my own genome feature in the Genoverse tracks?

I have my own genomes features in a json file, (shows below): I put the file in the path -- '/src/js/genomes' of Genoverse and named it 'mvp.js', and i use the follwing code, but it didn't work.

Need your help! sir!

can someone just tell me how i can use my own genome feature in the web?

the genoverse script code:

"""

<script> new Genoverse({ container: '#genoverse', genome: 'mvp', plugins: ['controlPanel', ['karyotype', { showAssembly: true }], 'trackControls', 'resizer', 'focusRegion', 'fullscreen', 'tooltips', 'fileDrop'], tracks: [ ['Scaleline', { strand: false }], 'Scalebar', { name: 'Sequence', controller: 'Sequence', model: 'Sequence.Ensembl', view: 'Sequence', 100000: false, resizable: 'auto', }, 'Gene', { name: 'my_gene Features', data: '../public/Genoverse_files/mvp.js', resizable: 'auto', model: { dataRequestLimit: 5000000 }, setFeatureColor: function (f) { f.color = '#AAA'; } }, ] }); </script>

""""

the content of 'mvp.js' just like this:
[{
"logic_name": "gene",
"feature_type": "gene",
"end": 67859,
"biotype": "protein_coding",
"gene_acc": "SG0050.p01",
"protein_acc": "BAE73325.1",
"strand": 0,
"id": "flagellum-specific ATP synthase FliI (SG0050)",
"start": 66483
}, {
"logic_name": "gene",
"feature_type": "gene",
"end": 68615,
"biotype": "protein_coding",
"gene_acc": "SGP1_0042.p01",
"protein_acc": "BAE75749.1",
"strand": 0,
"id": "achromobactin biosynthetic and transport gene yhcA (SGP1_0042)",
"start": 67227
}
...........
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.