Datahub

From wubrowse wiki
Revision as of 10:20, 4 August 2017 by Dli (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A minimum example:

[
# this is comment
{
    type:"bedgraph",
    url:"http://vizhub.wustl.edu/hubSample/hg19/GSM432686.gz",
    name:"my track",
    mode:"show",
    colorpositive:"#ff33cc",
    height:50,
},
]


Defining track colors

Currently the browser only works with color notations such as #ffcc00 or rgb(255,150,50), but rather literal color names such as "red" or "white".

color

This attribute works for two types of tracks:

  1. genome alignment, defines the rendering color for the query genome
  2. hammock, defines item color, same as "boxcolor" attribute, but not applicable for items with category assignment

boxcolor

Defines the rendering color of hammock tracks.

boxcolor:"#3366ff",

This attribute will be ignored if "categories" attribute also presents, which supplies category-specific rendering color.

barplot_bg

In the bar plot of numerical values, background shade can be added to positions with valid value. Missing value or NaN (Javascript notation) will not have this bar background. This is useful for distinguishing near-0 values (with very low or 0 bar heights) from missing values, such as methylation level data over unmethylated CpGs.

barplot_bg:'#c0c0c0',

With barplot background Barplot bg true.png

Without background Barplot bg false.png

strokecolor

To define the color of vertical stroke lines. hammock: line stroke at single base pair

strokecolor:'#0000ff',

colorpositive

Defines rendering color for positive values in a numerical track, applicable for bedgraph, bigwig, and long range interaction tracks.

colorpositive:"#3366ff",
colorpositive:"#ff33cc/#B30086",

Two color strings may be used (joined by forward slash), the second color will be used for values that are greater than maximum threshold. The second color is not applicable for long range interaction track.

colornegative

Defines rendering color for negative values in a numerical track, same usage as "colorpositive".

backgroundcolor

Defines the background color of a track:

backgroundcolor:"#ffe5ff",

Other track attributes

All the attribute names are case-insensitive, e.g. both "horizontallines" or "HorizontalLines" can be used.

height

mode

Set to "hide" so this track remains hidden when the hub is loaded. To show a track by default, following values can be used conditional on track type: "show", "thin", "full", "densithy", "arc", "trihm", "hammock#barplot".

Using value "hide" or simply omit mode attribute will keep this track hidden when the datahub is loaded.

defaultmode

To define initial display mode for a track when it's first brought into display.

defaultmode:'barplot',

geo

To associate one or more GEO accessions with this track, value can either be string or array:

geo:"GSM429321",
geo:"GSM11111,GSM22222",
geo:["GSM1111","GSM2222"],

metadata

When metadata vocabulary is included in the datahub (either as private or as shared vocabulary), the metadata terms can be used to annotate tracks.

From multiple shared metadata vocabularies (identified by "assay" and "sample", terms are identified by integer ID):

metadata:{assay:[1,2], sample:[3,4]},

From single shared vocabulary:

metadata:[1,2],

Or if there's only one term used:

metadata:1,

From private metadata vocabulary:

metadata:[1,2],

Or:

metadata:1,

Or using term name directly:

metadata:"IMR90 cell line",

See metadata for details.

group

To allow multiple numerical tracks to share a Y scale range. Applicable to bedgraph, bigwig, and hammock in barplot mode.

Value must be positive integer (1,2, ...). Tracks with the same group value will be in the same group.

group:1,

This feature is not yet configurable on the user interface.

horizontallines

Adds one or more horizontal lines in the track. Only applicable for numerical tracks (bedgraph, bigwig, or annotation tracks displayed in density mode).

Value is an array, each element defines a horizontal line in the form of an object: {value:1,color:'#858585'}

"value" specifies the position on the Y axis to draw the horizontal line, thus if the value is out of range of track's Y scale, the line will not be drawn.

Multiple lines can be defined by adding multiple elements to the "horizontalline" array.

horizontalLines:[ {value:10,color:'#858585'} ],

This feature is not yet configurable.

categories

Defines the numerical ID, name, and rendering color for each category.

categories:{
    1:["SINE - short interspersed nuclear elements","#cc0000"],
    2:["LINE - long interspersed nuclear element","#FF6600"],
    3:["LTR - long terminal repeat element","#006600"],
},

This attribute works for either categorical or hammock track.

When used for the hammock track, track items should contain the "category" attribute to take effect, explain here: hammock:category

fixedscale

To set Y scale with both minimum and maximum values, making truly fixed scale:

fixedscale:{min:0,max:10},

To set only minimum value for Y scale:

fixedscale:{min:2},

To set only maximum value for Y scale:

fixedscale:{max:10},

log scale

For the track you want to apply default log scale, you can add a qtc object, like:

qtc:{logtype:2}

this will set the log scale to log2, other possible values include:

        log_no=1,  # no log
        log_2=2,  # log2
        log_e=3, # ln
        log_10=4, # log10

category_set_index

This refers to a category definition. The value is an index that is used in the "category_set" object. See "category_set" section for details.

Non-track objects or directives

Geneset

A gene set can be consisted both of gene names and coordinates. Example:

{
type:"geneset",
name:"this is a gene set",
list:["CYP4Z1","CYP2A7","CYP2A6","chr1:222-333"]
},

The "geneset" object can be repeated in a datahub to define multiple gene sets.

metadata

See metadata for details.

category_set

Defines categories that is common among a group of tracks. Applicable for both categorical and hammock tracks. This can reduce a lot of repetition in the datahub when many tracks use the same category definition.

Following example contains two definitions for categories, as indexed by 1 and 2:

{type:'category_set',
set:{
    1:{
        '1':['Active TSS','#ff0000'],
        '2':['Flanking Active TSS','#ff4500'],
        '3':['Transcr at gene 5\' and 3\'','#32cd32']
    },
    2:{
        1:['coding','rgb(0,60,179)'],
        2:['non-coding','rgb(0,128,0)'],
        3:['pseudogene','rgb(230,0,172)']
    },
}
},

To reference the category definition, a track must use the "category_set_index" attribute.

Fixed Y scale for a group of tracks

(experimental) Defines fixed Y axis scale for any numerical tracks in a specified group. This is a shared (or common) Y scale.

{
type:'group_yscale_fixed',
groups:{
    1:{min:0,max:30}, 
    2:{min:0,max:7},
    },
},

Customized colors

The browser has a built-in color array used in multiple occasions, mostly rendering the metadata color map. This parameter allows user to override the default color choices in that array so novel colors can be used on the browser. The first integer is order of appearance for that color (internally it is array index so it must be non-negative integer), the second is color string.

{
type:'customized_color',
list:[
    [0, '#ff33cc'],
    [1, '#6633ff'],
    [2, '#ff6633'],
    ],
},

Split panels

Let the browser add a few split panels when the datahub is loaded. Each split panel will be shown for every given coordinate string:

{
 type:'splinters',
 list:['chr1:222-333','chr2:444-555'],
},

Comment

Comment takes an entire line and must start with '#'. Following use of comment is NOT SUPPORTED at the moment:

{
type:'bedgraph',
url:'http://xxx/y.gz', # comment on this url
}

The correct way to use is:

{
type:'bedgraph',
# comment on this url
url:'http://xxx/y.gz',
}

Please be aware that the comment is not valid JSON syntax and may break a JSON parser. Datahubs containing comments can only be used in WashU Browser. Please remove comment from the hub if you want to process it with a third party JSON parser.

Display datahub on browser

To submit a datahub via the user interface, search for the "datahub" app on the browser. Enter the datahub file URL and submit.

Alternatively, submit the datahub URL as a URL parameter, this creates a URL in the form of http://browser/?genome=hg19&datahub=datahub_URL. By clicking this URL the browser will be launched with the datahub loaded. See URL parameter#datahub.

If the datahub file is saved on local storage, upload it to the browser for display by clicking the "upload from file" button.