Bio

JBrowse Configuration Guide

GMOD.org recent changes - Sat, 05/19/2018 - 20:01

← Older revision Revision as of 00:01, 20 May 2018 (2 intermediate revisions by the same user not shown)Line 3,450: Line 3,450:     These pageres commands using the --scale argument can upscale content to make high-res images automatically, but using highResolutionMode: 2 or similar is still recommended for canvasfeatures. These pageres commands using the --scale argument can upscale content to make high-res images automatically, but using highResolutionMode: 2 or similar is still recommended for canvasfeatures. −       === Other links === === Other links === Line 3,465: Line 3,464:     [[Image:ABLo6WJ.jpg|800px]] [[Image:ABLo6WJ.jpg|800px]]  +  +== Rendering high resolution screenshots using Puppeteer ==  +  +The Google Chrome headless browser "Puppeteer" is an alternative to PhantomJS  +  +The jbrowse-rasterize tool from cpgJBrowseToolkit provides a tool for automating puppeteer https://github.com/cancerit/cgpJBrowseToolkit/  +  +A stripped down puppeteer example is as follows  +  +First run "npm install puppeteer" in a new directory, then create a file screenshot.js  +  +    const puppeteer = require('puppeteer');  +    function delay(ms) {  +        return new Promise(r => setTimeout(r, ms));  +    }  +    (async () => {  +      const browser = await puppeteer.launch();  +      const page = await browser.newPage();  +      const argv=process.argv;  +      await page.goto(argv[2]);  +      //debug  +      //page.on('console', msg => console.log('PAGE LOG:', msg.text()));  +      await page.setViewport({  +        width:argv[4]||1000,  +        height:argv[5]||600,  +        deviceScaleFactor:argv[6]||2  +      });  +      // wait five seconds for rendering, add or remove time as needed  +      await delay(5000);  +      await page.screenshot({path: argv[3]||"example.png"});  +      await browser.close();  +    })();  +  +Then you can run "node screenshot.js http://localhost/jbrowse/" or other URL argument as needed. The third, fourth, fifth and sixth arguments are optional a) output filename b) output width c) output height and d) zoom factor to make it higher resolution  +  +     =External Links= =External Links= Colin Diesh
Categories: Bio

gmod.org is DOWN, 1526400481

GMOD.org status - Tue, 05/15/2018 - 12:36
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Sun, 05/13/2018 - 02:08

‎How do I access data about my features in my callback or plugin

← Older revision Revision as of 06:08, 13 May 2018 Line 458: Line 458:       −Note that if you have multiple values for a value in column 9 (specified by comma separated values), then feature.get('your_value') will return an array+Note that if you have multiple values for a value in column 9 (specified by comma separated values), then feature.get('your_value') will return an array (except for for Note which turns into Note, Note2, Note3, etc)     For reference JBrowse/Model/SimpleFeature is a widely used feature class. The BAM features for example use a different model because they must be smaller and quicker to operate at speed (they are called Lazy features, so not all their info is evaluated unless it is needed on-demand). BAM features also have things like feature.get('seq'), to get the sequence of the alignments, but normal features like genes do not have feature.get('seq') For reference JBrowse/Model/SimpleFeature is a widely used feature class. The BAM features for example use a different model because they must be smaller and quicker to operate at speed (they are called Lazy features, so not all their info is evaluated unless it is needed on-demand). BAM features also have things like feature.get('seq'), to get the sequence of the alignments, but normal features like genes do not have feature.get('seq') Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Sun, 05/13/2018 - 02:08

‎How do I access data about my features in my callback or plugin

← Older revision Revision as of 06:08, 13 May 2018 (2 intermediate revisions by the same user not shown)Line 458: Line 458:       −Note that if you have multiple values for a value in column 9 (specified by comma separated values), then feature.get('your_value') will return an array+Note that if you have multiple values for a value in column 9 (specified by comma separated values), then feature.get('your_value') will return an array (except for for Note which turns into Note, Note2, Note3, etc)     For reference JBrowse/Model/SimpleFeature is a widely used feature class. The BAM features for example use a different model because they must be smaller and quicker to operate at speed (they are called Lazy features, so not all their info is evaluated unless it is needed on-demand). BAM features also have things like feature.get('seq'), to get the sequence of the alignments, but normal features like genes do not have feature.get('seq') For reference JBrowse/Model/SimpleFeature is a widely used feature class. The BAM features for example use a different model because they must be smaller and quicker to operate at speed (they are called Lazy features, so not all their info is evaluated unless it is needed on-demand). BAM features also have things like feature.get('seq'), to get the sequence of the alignments, but normal features like genes do not have feature.get('seq') Line 520: Line 520:  If you use sequenceserver, you create a custom JBrowse link by creating a links.rb file and running   If you use sequenceserver, you create a custom JBrowse link by creating a links.rb file and running      −sequenceserver -D database_dir -r links.rb+ sequenceserver -D database_dir -r links.rb     The links.rb is then a file that gets included by sequenceserver to generate new links to external resources automatically. In our case, we parse all the HSPs (high scoring pairs) from the hits from BLAST and string them together into a single feature (e.g. by taking the min and max of all hsps) The links.rb is then a file that gets included by sequenceserver to generate new links to external resources automatically. In our case, we parse all the HSPs (high scoring pairs) from the hits from BLAST and string them together into a single feature (e.g. by taking the min and max of all hsps) Line 599: Line 599:               first_hit_start = hsps.map(&:sstart).at(0)              first_hit_start = hsps.map(&:sstart).at(0)               first_hit_end = hsps.map(&:send).at(0)              first_hit_end = hsps.map(&:send).at(0) −             organism = accession.partition('-').last+             organism = accession.partition('-').first −             mid = accession.partition('-').first+             sequence_id = accession.partition('-').last               my_features = ERB::Util.url_encode(JSON.generate([{              my_features = ERB::Util.url_encode(JSON.generate([{ −                 :seq_id => mid,+                 :seq_id => sequence_id,                   :start => sstart,                  :start => sstart,                   :end => send,                  :end => send, Line 623: Line 623:                   }                  }               ]))              ])) −             url = "http://yourwebsite.com/jbrowse/?data=#{organism}" \+             url = "http://yourwebsite.com/jbrowse/" \ −                         "?loc=#{accession}:#{first_hit_start-500}..#{first_hit_start+500}" \+                        "?data=#{organism}" \  +                         "&loc=#{sequence_id}:#{first_hit_start-500}..#{first_hit_start+500}" \                           "&addFeatures=#{my_features}" \                          "&addFeatures=#{my_features}" \                           "&addTracks=#{my_track}" \                          "&addTracks=#{my_track}" \ Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Sun, 05/13/2018 - 02:08

‎How do I access data about my features in my callback or plugin

Show changes Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Thu, 05/10/2018 - 15:23

‎How can I link BLAST results to JBrowse

Show changes Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Tue, 05/08/2018 - 12:46

‎Can I get started with JBrowse without all the fuss of setup.sh and what-not

Show changes Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Tue, 05/08/2018 - 12:34

‎How can I link BLAST results to JBrowse

← Older revision Revision as of 16:34, 8 May 2018 (3 intermediate revisions by the same user not shown)Line 522: Line 522:  sequenceserver -D database_dir -r links.rb sequenceserver -D database_dir -r links.rb    −Where links.rb is something like this+The links.rb is then a file that gets included by sequenceserver to generate new links to external resources automatically. In our case, we parse all the HSPs (high scoring pairs) from the hits from BLAST and string them together into a single feature (e.g. by taking the min and max of all hsps)     +Note: in this code     +- qend means query end  +- send means subject end  +- sstart means subject start   +- qstart means query start  +  +  +We use the addFeatures URL parameter of JBrowse to make the features appear. For reference, see http://gmod.org/wiki/JBrowse_Configuration_Guide#Controlling_JBrowse_with_the_URL_Query_String  +  + require 'json'  + module SequenceServer  +    module Links  +        def jbrowse  +            qstart = hsps.map(&:qstart).min  +            sstart = hsps.map(&:sstart).min  +            qend = hsps.map(&:qend).max  +            send = hsps.map(&:send).max  +            my_features = ERB::Util.url_encode(JSON.generate([{  +                :seq_id => accession,  +                :start => sstart,  +                :end => send,  +                :type => "match",  +                :subfeatures =>  hsps.map {  +                  |hsp| {  +                    :start => hsp.send<hsp.sstart ? hsp.send : hsp.sstart,  +                    :end => hsp.send<hsp.sstart ? hsp.sstart : hsp.send,  +                    :type => "match_part"  +                  }  +                }  +            }]))  +            my_track = ERB::Util.url_encode(JSON.generate([  +                {  +                    :label => "BLAST",  +                    :key => "BLAST hits",  +                    :type => "JBrowse/View/Track/CanvasFeatures",  +                    :store => "url",  +                    :glyph => "JBrowse/View/FeatureGlyph/Segments"  +                }  +            ]))  +            url = "http://yourwebsite.com/jbrowse/?loc=#{accession}:#{sstart}..#{send}&addFeatures=#{my_features}&addTracks=#{my_track}&tracks=BLAST"  +            {  +              :order => 2,  +              :title => 'JBrowse',  +              :url  => url,  +              :icon  => 'fa-external-link'  +            }  +        end  +    end  + end  +  +  +Important note: if you have multiple organisms, then you should encode your FASTA files to contain the organism name, e.g.  +  + >Human-chr1  + ACCGAATCAGCTATCGA...  +  +  +This is because BLAST does not tell you which database your hits come from.  +  +  +Then you must modify your links.rb use this information by parsing the "accession" variable.       Line 535: Line 596:               qend = hsps.map(&:qend).max              qend = hsps.map(&:qend).max               send = hsps.map(&:send).max              send = hsps.map(&:send).max −             url = ""+             organism = accession.partition('-').last −            if accession.include? "animal1"+             mid = accession.partition('-').first −                mid = accession.sub(/^animal1-/, '')+             my_features = ERB::Util.url_encode(JSON.generate([{ −                organism = "animal1"+ −             elsif accession.include? "animal2"+ −                mid = accession.sub(/^animal2-/, '')+ −                organism = "animal2"+ −             elsif accession.include? "animal3"+ −                organism = "animal3"+ −                mid = accession.sub(/^animal3-/, '')+ −            else + −                return nil+ −            end+ −            my_hash = [{+                   :seq_id => mid,                  :seq_id => mid,                   :start => sstart,                  :start => sstart,                   :end => send,                  :end => send,                   :type => "match",                  :type => "match", −                 :subfeatures =>  hsps.map { |hsp| {:start => hsp.send<hsp.sstart ? hsp.send : hsp.sstart, :end => hsp.send<hsp.sstart ? hsp.sstart : hsp.send, :type => "match_part" } }+                 :subfeatures =>  hsps.map { −             }]+                  |hsp| { −            my_json = ERB::Util.url_encode(JSON.generate(my_hash))+                    :start => hsp.send<hsp.sstart ? hsp.send : hsp.sstart, −             my_track = ERB::Util.url_encode(JSON.generate([{"label":"BLAST","key": "BLAST hits","type":"JBrowse/View/Track/CanvasFeatures","store":"url", "glyph": "JBrowse/View/FeatureGlyph/Segments"}]))+                    :end => hsp.send<hsp.sstart ? hsp.sstart : hsp.send, −             url = "http://yourwebsite.com/jbrowse/?data=#{organism}&loc=#{mid}:#{sstart}..#{send}&addFeatures=#{my_json}&addTracks=#{my_track}&tracks=BLAST"+                    :type => "match_part"  +                  }    +                }  +             }]))  +             my_track = ERB::Util.url_encode(JSON.generate([  +                {  +                    :label => "BLAST",  +                    :key => "BLAST hits",  +                    :type => "JBrowse/View/Track/CanvasFeatures",  +                    :store => "url",  +                    :glyph => "JBrowse/View/FeatureGlyph/Segments"  +                }  +            ]))  +             url = "http://yourwebsite.com/jbrowse/?data=#{organism}&loc=#{mid}:#{sstart}..#{send}&addFeatures=#{my_features}&addTracks=#{my_track}&tracks=BLAST"               {              {                 :order => 2,                :order => 2, Line 569: Line 632:        +Another important note: you should BLAST the actual genome sequence if you are linking to genomic coordinates of JBrowse. If you BLAST a CDS database, you may need to load CDS sequences into JBrowse, or translate the CDS coordinates into genomic coordinates    −This code has the the following stipulations     −# if you have multiple organisms, then the sequence identifiers in your blast database must contain the organism name e.g. every > line in your fasta file should be formatted like "animal1-sequence123" (The reason is that sequenceserver and blast itself doesn't tell you which database the result came from, so encoding the info in the fasta sequence IDs is the only efficient way)  −# that you are blasting actual genome coordinates, e.g. it won't translate a CDS blast database into genome coordinates for JBrowse (however if individual CDS were loaded as sequences into jbrowse that could work, but that is an abnormal usage of jbrowse)     −Note that if you are running sequenceserver through apache, then you instead modify config.ru to have a "require './links.rb'" line e.g.+Also also note: if you are running sequenceserver through apache e.g. with Passenger Phusion, then you can modify the config.ru to have a "require './links.rb'" line and keep the links.rb in that same directory as config.ru e.g.       require 'sequenceserver'   require 'sequenceserver' Colin Diesh
Categories: Bio

JBrowse Configuration Guide

GMOD.org recent changes - Wed, 04/18/2018 - 12:18

‎CanvasFeatures Configuration Options

← Older revision Revision as of 16:18, 18 April 2018 (3 intermediate revisions by the same user not shown)Line 422: Line 422:  | If set to true, show the feature's "Note" attribute as a regular attribute in the feature detail dialog. This is mostly useful for projects that want the blue description text on a feature to be different from the feature's Notes attribute, but still display the Notes attribute in the detail dialog | If set to true, show the feature's "Note" attribute as a regular attribute in the feature detail dialog. This is mostly useful for projects that want the blue description text on a feature to be different from the feature's Notes attribute, but still display the Notes attribute in the detail dialog  |- |-  +| <code>topLevelFeatures</code>  +| Specifies which feature types should be considered "top-level" for this track. For example, if you have a track with gene->mRNA->CDS features, but for some reason want to only display the mRNA features, you can set topLevelFeatures=mRNA. Can also be an array of string types, or a function callback that returns an array of types. Default: all features are displayed. Added in 1.14.0  |} |}    Line 538: Line 540:  | <code>enableCollapsedMouseover</code> | <code>enableCollapsedMouseover</code>  | Enables the mouseover action when track is collapsed. Default: false. Added in 1.13.0. See the ChromHMM track in volvox sample browser for example of mouseover on the collapsed track | Enables the mouseover action when track is collapsed. Default: false. Added in 1.13.0. See the ChromHMM track in volvox sample browser for example of mouseover on the collapsed track  +|-  +| <code>topLevelFeatures</code>  +| Specifies which feature types should be considered "top-level" for this track. For example, if you have a track with gene->mRNA->CDS features, but for some reason want to only display the mRNA features, you can set topLevelFeatures=mRNA. Can also be an array of string types, or a function callback that returns an array of types. Default: all features are displayed. Added in 1.14.0  +|-  +| <code>ItemRgb</code>  +| If set to true, the RGB colors specified in BigBed or BED files will be used for the feature's background color. Default true. Added in 1.14.0  |} |}    Line 1,902: Line 1,910:  == addBookmarks == == addBookmarks ==    −Bookmarks are available in JBrowse>1.12.2 (unreleased at time of writing), which allows you to add static coloured overlays to specific regions of the genome.+Bookmarks are available in JBrowse starting in 1.12.2, which allows you to add static coloured overlays to specific regions of the genome.       RobertBuels
Categories: Bio

JBrowse Configuration Guide

GMOD.org recent changes - Wed, 04/18/2018 - 12:11

‎HTMLFeatures Configuration Options: added topLevelFeatures

← Older revision Revision as of 16:11, 18 April 2018 (One intermediate revision by the same user not shown)Line 422: Line 422:  | If set to true, show the feature's "Note" attribute as a regular attribute in the feature detail dialog. This is mostly useful for projects that want the blue description text on a feature to be different from the feature's Notes attribute, but still display the Notes attribute in the detail dialog | If set to true, show the feature's "Note" attribute as a regular attribute in the feature detail dialog. This is mostly useful for projects that want the blue description text on a feature to be different from the feature's Notes attribute, but still display the Notes attribute in the detail dialog  |- |-  +| <code>topLevelFeatures</code>  +| Specifies which feature types should be considered "top-level" for this track. For example, if you have a track with gene->mRNA->CDS features, but for some reason want to only display the mRNA features, you can set topLevelFeatures=mRNA. Can also be an array of string types, or a function callback that returns an array of types. Default: all features are displayed. Added in 1.14.0  |} |}    Line 538: Line 540:  | <code>enableCollapsedMouseover</code> | <code>enableCollapsedMouseover</code>  | Enables the mouseover action when track is collapsed. Default: false. Added in 1.13.0. See the ChromHMM track in volvox sample browser for example of mouseover on the collapsed track | Enables the mouseover action when track is collapsed. Default: false. Added in 1.13.0. See the ChromHMM track in volvox sample browser for example of mouseover on the collapsed track  +|-  +| <code>topLevelFeatures</code>  +| Specifies which feature types should be considered "top-level" for this track. For example, if you have a track with gene->mRNA->CDS features, but for some reason want to only display the mRNA features, you can set topLevelFeatures=mRNA. Can also be an array of string types, or a function callback that returns an array of types. Default: all features are displayed. Added in 1.14.0  |} |}    RobertBuels
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Tue, 04/10/2018 - 16:14

‎Why this is needed

← Older revision Revision as of 20:14, 10 April 2018 Line 7: Line 7:  The most common solution that is used when people need this functionality from JBrowse has been to put the needed URL in an html iframe.  This approach has a few down sides: The most common solution that is used when people need this functionality from JBrowse has been to put the needed URL in an html iframe.  This approach has a few down sides:    −* The content in the iframe remains active.  Users can interact with it in the same way that they can interact with a full JBrowse instance.  While this is kind of neat in some instances, there is no way to get back to the original view.  If the designer of the page put that view there for a reason, the user might want to see that view in the context of the page.+* The content in the iframe remains active.  Users can interact with it in the same way that they can interact with a full JBrowse instance.  While this is kind of neat in some instances, there is no way to get back to the original view.  If the designer of the page put that view there for a reason, the user might want to see that view in the context of the page.  (Note that this is technically not true--one could write some JavaScript and attach it to a "reset" button, but it is an ugly solution).  +* The iframe captures mouse scroll wheel events.  If a user is scrolling down a page and the mouse pointer enters a JBrowse iframe, the iframe starts capturing the scroll so that scrolling in the page stops while the JBrowse in the iframe scrolls.  This is *very* annoying to the user.  * There is no way to know before the JBrowse URL is invoked how tall the resulting "image" (JBrowse page) will be, so the page designer generally has to assign a fixed height and then the resulting JBrowse page is frequently either too large or too small.  When it's too large, it results in ugly white space; but even worse, when it's too small, it requires the user to scroll to see the entirety of the content, which can result in accidentally scrolling away from the genomic location originally defined for the page. * There is no way to know before the JBrowse URL is invoked how tall the resulting "image" (JBrowse page) will be, so the page designer generally has to assign a fixed height and then the resulting JBrowse page is frequently either too large or too small.  When it's too large, it results in ugly white space; but even worse, when it's too small, it requires the user to scroll to see the entirety of the content, which can result in accidentally scrolling away from the genomic location originally defined for the page.  * iframes are ugly. * iframes are ugly. Scott
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Tue, 04/10/2018 - 16:14

‎Why this is needed

Show changes Scott
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Mon, 04/09/2018 - 14:44

‎CSS tricks

← Older revision Revision as of 18:44, 9 April 2018 (5 intermediate revisions by the same user not shown)Line 19: Line 19:     The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner). The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner).  +  +===Fetch JBrowse into a div===  +  +The first thing to do is to fetch JBrowse into a div using an html object tag with the URL that you need to fetch in the "data" attribute of the object tag.  In practice, the result looks like this:  +  +<pre>  +<div class="jbrowse-view-iframe" style="overflow: hidden;">  +  <object id="innerJBrowse"  +        type="text/html"  +        style="pointer-events: none; position: relative; top: -1px; left: 0px; width: 100%; height: 1273px; overflow: hidden;"  +        data="/tools/genome/jbrowse-simple/full.html?overview=0&amp;tracks=Curated_Genes%2CClassical_alleles%2CYACs_Fosmids_Cosmids&amp;loc=II%3A158247..173104&amp;data=data%2Fc_elegans_simple&amp;nav=0&amp;tracklist=0">  +  </object>  +</div>  +</pre>  +  +But the trick is that the object tag gets created dynamically when the page is loaded, using some simple JavaScript like this:  +  +<pre>  +<script type="text/javascript">  +    var preembedURL = "full.html?tracks=Curated_Genes%2CClassical_alleles%2CYACs_Fosmids_Cosmids&loc=X%3A12392257..12418393&data=data%2Fc_elegans_simple";  +    var embed_part = "&nav=0&tracklist=0&overview=0";  +    $("#jbrowse-view-iframe").html('<object id="innerJBrowse" type="text/html" style="pointer-events: none; position: relative; top: -1px; left: 0px; width: 100%; height: 14px; overflow: hidden;" data="'+preembedURL+embed_part+'"></object>');  +</script>  +</pre>  +  +Note that the class of the div is "jbrowse-view-iframe" but of course, it's really a div, not an iframe.  +  +===CSS tricks===  +  +Now for a few comments about the styling of the JBrowse div.  There are few neat tricks that are going on here that are important to making this work.  Here they are laid out in full:  +  +* <code>pointer-events: none;</code> This is one of the most important items; pointer-effects none tells the browser to ignore anything the mouse does inside this div, so there is no clicking on features or scrolling with the mouse wheel.  +* <code>position: relative; </code>  Makes the coordinate assignments in the next line work properly.  +* <code>top: -1px; left: 0px; </code>  Positioning--put JBrowse starting at the top left of the div.  +* <code>width: 100%; </code>  Not supper important what the width is; I like 100% in our implementation because it just fills with width of the parent.  +* <code>height: 14px; </code>  This height will allow the top coordinate bar of JBrowse be visible while it's loading; another option is to set it to zero so the user sees nothing while it's loading.  Finally, what was implemented at WormBase was to place a "loading spinner" in the div while it's loading.  +* <code>overflow: hidden;</code> This prevents the browser from creating a scroll bar from forming when the content gets bigger than the div height.  Of course, the scrollbar wouldn't work anyway because of the pointer-events setting.  +  +===Monitor JBrowse loading===  +  +  +  +==="Div overlay" to allow clicking===  +  +==Acknowledgments==  +  +Special thanks to Sibyl Gao at WormBase for taking the prototype I created and turning it into something that would actually work well in the context of a full website.     [[Category:JBrowse]] [[Category:JBrowse]] Scott
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Mon, 04/09/2018 - 14:35

‎CSS tricks

← Older revision Revision as of 18:35, 9 April 2018 (3 intermediate revisions by the same user not shown)Line 19: Line 19:     The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner). The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner).  +  +===Fetch JBrowse into a div===  +  +The first thing to do is to fetch JBrowse into a div using an html object tag with the URL that you need to fetch in the "data" attribute of the object tag.  In practice, the result looks like this:  +  +<pre>  +<div class="jbrowse-view-iframe" style="overflow: hidden;">  +  <object id="innerJBrowse"  +        type="text/html"  +        style="pointer-events: none; position: relative; top: -1px; left: 0px; width: 100%; height: 1273px; overflow: hidden;"  +        data="/tools/genome/jbrowse-simple/full.html?overview=0&amp;tracks=Curated_Genes%2CClassical_alleles%2CYACs_Fosmids_Cosmids&amp;loc=II%3A158247..173104&amp;data=data%2Fc_elegans_simple&amp;nav=0&amp;tracklist=0">  +  </object>  +</div>  +</pre>  +  +But the trick is that the object tag gets created dynamically when the page is loaded, using some simple JavaScript like this:  +  +<pre>  +<script type="text/javascript">  +    var preembedURL = "full.html?tracks=Curated_Genes%2CClassical_alleles%2CYACs_Fosmids_Cosmids&loc=X%3A12392257..12418393&data=data%2Fc_elegans_simple";  +    var embed_part = "&nav=0&tracklist=0&overview=0";  +    $("#jbrowse-view-iframe").html('<object id="innerJBrowse" type="text/html" style="pointer-events: none; position: relative; top: -1px; left: 0px; width: 100%; height: 14px; overflow: hidden;" data="'+preembedURL+embed_part+'"></object>');  +</script>  +</pre>  +  +Note that the class of the div is "jbrowse-view-iframe" but of course, it's really a div, not an iframe.  +  +===CSS tricks===  +  +Now for a few comments about the styling of JBrowse div.  There are few neat tricks that are going on here that are important to making this work.  Here they are laid out in full:  +  +===Monitor JBrowse loading===  +  +  +  +==="Div overlay" to allow clicking===  +  +==Acknowledgments==  +  +Special thanks to Sibyl Gao at WormBase for taking the prototype I created and turning it into something that would actually work well in the context of a full website.     [[Category:JBrowse]] [[Category:JBrowse]] Scott
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Mon, 04/09/2018 - 11:04

‎What this solution does

← Older revision Revision as of 15:04, 9 April 2018 Line 19: Line 19:     The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner). The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner).  +  +==Acknowledgments==  +  +Special thanks to Sibyl Gao at WormBase for taking the prototype I created and turning it into something that would actually work well in the context of a full website.     [[Category:JBrowse]] [[Category:JBrowse]] Scott
Categories: Bio

Reproducing gbrowse img functinality with JBrowse

GMOD.org recent changes - Mon, 04/09/2018 - 10:59

Created page with "That is, "Reproducing gbrowse_img functionality with JBrowse" (underscores don't survive the Mediawiki page naming process). ==Why this is needed== While JBrowse is a te..."

New page

That is, "Reproducing gbrowse_img functionality with JBrowse" (underscores don't survive the Mediawiki page naming process).

==Why this is needed==

While [[JBrowse]] is a terrific tool for browsing genomes, there is one piece of functionality that is missing from this excellent client-side tool: getting an image from the server with a URL request that can be dynamically inserted into a web page, like what one might want for a gene page at a model organism database.

The most common solution that is used when people need this functionality from JBrowse has been to put the needed URL in an html iframe. This approach has a few down sides:

* The content in the iframe remains active. Users can interact with it in the same way that they can interact with a full JBrowse instance. While this is kind of neat in some instances, there is no way to get back to the original view. If the designer of the page put that view there for a reason, the user might want to see that view in the context of the page.
* There is no way to know before the JBrowse URL is invoked how tall the resulting "image" (JBrowse page) will be, so the page designer generally has to assign a fixed height and then the resulting JBrowse page is frequently either too large or too small. When it's too large, it results in ugly white space; but even worse, when it's too small, it requires the user to scroll to see the entirety of the content, which can result in accidentally scrolling away from the genomic location originally defined for the page.
* iframes are ugly.

==What this solution does==

* Puts the JBrowse content in a div with a JavaScript function
* Uses CSS to prevent mouse interactions (like scrolling) in the JBrowse div
* Uses JavaScript to monitor the size of the resulting JBrowse content and dynamically resize the div to show all of the content
* Creates a div "overlay" for the resulting image so that a click on it goes to the full JBrowse site.

The example code below uses JQuery but could easily be reimplemented in another framework (or vanilla JavaScript, which is how it was originally written--putting it into JQuery made it much cleaner).

[[Category:JBrowse]] Scott
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Sun, 04/08/2018 - 17:28

‎How do I collapse categories in the Hierarchical data selector by default?

← Older revision Revision as of 21:28, 8 April 2018 (4 intermediate revisions by the same user not shown)Line 694: Line 694:  == How do I collapse categories in the Hierarchical data selector by default? == == How do I collapse categories in the Hierarchical data selector by default? ==    −You can set add+You can set the following config       collapseCategories=ParentCategory1/ChildCategory,ParentCategory2/ChildCategory   collapseCategories=ParentCategory1/ChildCategory,ParentCategory2/ChildCategory Line 728: Line 728:  == How do I install a plugin == == How do I install a plugin ==     +  +'''NOTE: After version 1.13 you must re-run "setup.sh" or "npm run build" after adding or removing a plugin. Other than this the directions in this section are fine'''     To install a JBrowse plugin, generally the easiest thing to do is to put the code in the plugins directory (e.g. plugins/GCContent and plugins/SashimiPlot), and then just say this in your jbrowse.conf To install a JBrowse plugin, generally the easiest thing to do is to put the code in the plugins directory (e.g. plugins/GCContent and plugins/SashimiPlot), and then just say this in your jbrowse.conf Line 799: Line 801:  Understanding "*dojo declare*" and *asynchronous module definition (AMD)* will help you understand the “preamble” on the top of every file that jbrowse uses, and which you can use in your plugin Understanding "*dojo declare*" and *asynchronous module definition (AMD)* will help you understand the “preamble” on the top of every file that jbrowse uses, and which you can use in your plugin     +In version 1.13 and forward, the plugin system also relies on re-building JBrowse using webpack. This actually allows you to use ES6 javascript and node js modules in your browser code. Therefore, you might want to review webpack, babel, and node js module systems     == How do I create a plugin? == == How do I create a plugin? == Colin Diesh
Categories: Bio

JBrowse FAQ

GMOD.org recent changes - Sun, 04/08/2018 - 15:01

‎What background should I have for creating a plugin

← Older revision Revision as of 19:01, 8 April 2018 (3 intermediate revisions by the same user not shown)Line 728: Line 728:  == How do I install a plugin == == How do I install a plugin ==     +  +'''NOTE: After version 1.13 you must re-run "setup.sh" or "npm run build" after adding or removing a plugin. Other than this the directions in this section are fine'''     To install a JBrowse plugin, generally the easiest thing to do is to put the code in the plugins directory (e.g. plugins/GCContent and plugins/SashimiPlot), and then just say this in your jbrowse.conf To install a JBrowse plugin, generally the easiest thing to do is to put the code in the plugins directory (e.g. plugins/GCContent and plugins/SashimiPlot), and then just say this in your jbrowse.conf Line 799: Line 801:  Understanding "*dojo declare*" and *asynchronous module definition (AMD)* will help you understand the “preamble” on the top of every file that jbrowse uses, and which you can use in your plugin Understanding "*dojo declare*" and *asynchronous module definition (AMD)* will help you understand the “preamble” on the top of every file that jbrowse uses, and which you can use in your plugin     +In version 1.13 and forward, the plugin system also relies on re-building JBrowse using webpack. This actually allows you to use ES6 javascript and node js modules in your browser code. Therefore, you might want to review webpack, babel, and node js module systems     == How do I create a plugin? == == How do I create a plugin? == Colin Diesh
Categories: Bio

Using the topoview Glyph

GMOD.org recent changes - Fri, 04/06/2018 - 18:29

← Older revision Revision as of 22:29, 6 April 2018 Line 16: Line 16:  about normalizing the expression profiles across the whole                                                                                                                                                                                                                                                                                                                                                                                                                                    about normalizing the expression profiles across the whole                                                                                                                                                                                                                                                                                                                                                                                                                                     experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    −                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            +                               +==Demonstration==  +Setting up this Glyph can be complicated.  If you have access to Amazon Web Services, there is an AMI with a demonstration instance of Gbrowse using the topoview track for RNASeq data at:  +   +GBrowse 2.56 with topoview track - ami-c2d677bf                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Line 234: Line 238:  [[Category:GBrowse_Developer]] [[Category:GBrowse_Developer]]  [[Category:HOWTO]] [[Category:HOWTO]]  +[[Category:GMOD_Component]] Mckays
Categories: Bio

Pages