Monday, July 22, 2013

v21: Creating and managing multiple gene sets

Version 21 features the all-new gene set creating and management functions.



Create a gene set

Click the "Apps" button, then select "Gene set" option to see following panel:



Click the "Add new gene set" button:



To use the default list of genes, simply click Submit button, a new gene set will be added:



To add additional gene sets, click the Add button again. Let's try "BED file" option this time:



You can upload a BED file and get a "gene set" with all the regions in the file. In fact, you have freedom to use any format for your text file, not restricted to BED or GFF or whatever. You only need to specify column index of required fields to load it.

Once a text file is loaded, it will be shown as a second entry:



Additionally you can query and load a KEGG pathway as the third method.




Manage/edit a gene set

Click (left-click) on a gene set entry to get available options:



Choose the first option "View and edit" to get following panel:



As indicated, you can use options in this panel to edit this gene set, including re-ordering, switch gene model, mark and delete items, add new items, change flanking regions, and rename this set.

Click button Done to hide the editing options.


Run gene set view

Click a gene set and choose Gene set view option:



The browser will run Gene set view using the genes or coordinates in this gene set. To quit Gene set view, click the "Turn off" button pointed by the cursor in the screenshot:


Note: to add flanking regions to the gene set view (or to add/remove items and such), you need to perform edit to the gene set, then re-run Gene set view using the updated set.


Use gene set in other apps

You can choose a gene set and send it to any other appropriate apps. Simply click the gene set and choose the option that corresponds to the desired app. From the app's configuration panel (if available) you can also find the option to choose gene set.



Extra: gene sets from datahub

You can put a gene set in your datahub descriptor file. Click this link to see the sample hg19 datahub now hosting two gene sets:

http://vizhub.wustl.edu/hubSample/hg19/hub2.txt

Click this link to display this datahub and load the gene sets defined in this hub (go to Gene set management panel to check it out):

http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub=http://vizhub.wustl.edu/hubSample/hg19/hub2.txt

The sample hub file contains description on how to write a gene set. Very simply, just enclose your gene set inside a pair of keywords: genesetstart and genesetend. The browser will try to use all contents between this two keywords as a gene set.

This makes sure that your gene set will always be there unless you change it, because it doesn't rely on session database to store.



Finally a few notable points:

  1. All your gene sets can be saved in a session (and recovered by it).
  2. By contrast, with URL parameter you can only keep one gene set.
  3. You can save multiple gene sets with a datahub (but you need to put it on the web).
  4. When a gene set is sent to an app (e.g. Gene set view), it duplicates a copy of itself and is separate from the set that is running the app. So if you modified the gene set, the change will *not* be automatically reflected in the app, but you need to re-submit the gene set to the app again to get updated results.
  5. Gene Set View operation panel is no longer around.
  6. Due to some hard changes with the new gene set function, sessions with Gene set view saved prior to Version 21 release might not be correctly recovered. We apologize for any inconvenience! We recommend the use of datahub to encode gene set which should be both stable and convenient.




You can get the source code from dropbox, or our server.

A very brief list of steps to install mirrors of our Browser is now available. It is rather sketchy and imcomplete and we will try to improve it.

Friday, July 5, 2013

v20 (3 of 3): refresh cache of custom tracks

When you have some custom tracks displayed on the Browser, and you updated the track files, you need tell the Browser to refresh cache of the updated track, so that it can be correctly displayed.

To refresh cache of custom tracks, click "CustomTK" button on the top of browser and find the button  (this button will only be shown when custom tracks have been submitted):




Click the button to open a new panel:


Choose tracks that need to be refreshed by clicking the track box, then click button to refresh the cache. You can select multiple of tracks and submit. Do not hide this panel while the server is working.

When the cache is refreshed, the track will be marked by a green tick. Upon any error the track will be marked by a red cross:


After the cache has been successfully refreshed, you can resume browsing by closing this panel.

v20 (2 of 3): embedding browser

Created: 2013/7/5
Last updated: 2014/2/6


From version 20 you can now embed the WashU EpiGenome Browser in your website! You only need to do some trivial HTML and JavaScript coding to have it. The embedded browser is full-blown browser as the one running on our server, and you can customize it to a great extent to show your stuff in your own way. Best of all, it's part of your website.



Examples
http://cgs.wustl.edu/~xzhou/embed/1.html

This web page has a browser embedded in it. It automatically embeds the browser as soon as the webpage itself is loaded. It shows the default tracks from the Roadmap Epigenomics public hub on human hg19 genome.

http://cgs.wustl.edu/~xzhou/embed/2.html

This example loads human/hg19 genome and displays a set of custom tracks.

http://cgs.wustl.edu/~xzhou/embed/3.html

This example can embed browser according to user's actions (you need to click a button to embed a browser).

You can see the source code of these examples in the HTML files (1.html, 2.html, 3.html) and adapt them for your purpose.



How the first example works

1. add following lines in the <HEAD> section of your web page:

<link rel="stylesheet" type="text/css" href="http://epigenomegateway.wustl.edu/browser/style.css" />
<script type="text/javascript" src="http://epigenomegateway.wustl.edu/browser/base.js"></script>
<script type="text/javascript" src="http://epigenomegateway.wustl.edu/browser/personality.js"></script>
<script type="text/javascript" src="http://epigenomegateway.wustl.edu/browser/embed.js"></script>

2. call the function embed_washugb to embed a browser. Most simply it can be done with following lines of javascript:


<script type='text/javascript'>
embed_washugb({
host:'http://epigenomegateway.wustl.edu',
container:document.getElementById('container_id'),
genome:'hg19',
});
</script>

This example requires a <div> element with ID of "container_id" in the web page.

The embed_washugb function requires a hash object as its only argument. All customization will be done through contents of this hash, as explained below.



embed_washugb options


All parameter names (keywords) are in bold face and are case-sensitive.



host
URL of the hosting server
value: url string

container
DIV object in which the browser will be embedded. You can supply the object programmatically, or by the object's ID (document.getElementById('xxx'))
value: DIV object 

genome
genome name, e.g. hg19, mm9
value: genome name string

leftSpaceWidth (optional)
the width of space on the left of genome heatmap (where track names are shown)
value: positive integer

panelWidth (optional)
width of the genome heatmap panel
value: positive integer

noPanelwidthConfig (optional)
do not show browser panel width configuration button (gear button)
value: true (or 1 or anything evaluates to true in javascript)


noDeleteButton (optional)
do not show delete button (for deleting the embedded panel)
value: true

hideTrackName (optional)
do not show track name on the left of browser
value: true

hideChromNavigator (optional)
do not show the chromosome navigator on top of the browser tracks
value: true

hideTopRuler (optional)
do not show ruler on top of the browser tracks
value: true

hideMetadataColormap (optional)
do not show metadata color map
value: true

maxTrackHeight (optional)
maximum track height, this only applies for the automatic track height adjustment when the browser loads for the first time
value: positive integer

noDefaultTrack (optional)
do not load any default native tracks
value: true

showContent (optional, new parameter)
define contents to be displayed in the embedded browser
value: an array of objects, each object defines a track in the same fashion a JSON data hub is written.