Lollipop ‐ mds3 - stjude/proteinpaint GitHub Wiki
Table of contents
Overview
Same configurations may be applied for both official and custom tracks.
runpp({
tklst:[
// track from an official dataset
{type:'mds3', dslabel:'GDC', … },
// custom track with client-side data
{type:'mds3', name:'custom tk', custom_data:[ … ], … },
// custom track with server-side vcf file
{type:'mds3', name:'', vcf:{file:'path/to/vcf.gz'}},
]
})
tk.dslabel: str
Optional.
If provided:
- The track loads from a server-side official dataset available from this genome, identified by the dslabel value.
- Tk.mds{} contents are copied from the server-side dataset.
If missing:
- It’s a custom dataset. The data source can still be server-side, e.g. from a bcf file.
- Tk.mds{} contents can be defined through runpp() arguments.
mds.queries{}
queries.snvindel{}
snvindel.skewerRim{}
Optional. If present, allow to enable rims over skewer dots.
queries.ld{}
ld.tracks[{name}]
List of LD data tracks
ld.colorScale
Auto-created to interpolate r2 value to a color
ld.mOverlay{}
If set, indicates the track is overlaying LD r2 value for all variants against a selected one.
mOverlay = {
ldtkname: 'name of the overlaying track'
m: {chr,pos,ref,alt,ssm_id} // the selected variant
data: [ {pos,alleles,r2} ] // r2 values for variants from the view range
}
Skewer data and rendering
Data types renderable in the “skewer” track, including SNV/indels, and fusion/SV breakpoints.
Highlighting data points
A red box is rendered over the dot of a highlighted data point.
tk.hlaachange or tk.hlssmid
Value is a string of comma-separated variant names (amino acid changes) or SSM id, depending on attribute name. Values are case sensitive. Example
tk.custom_variants:[]
Required when “dslabel” is missing. Supply ad-hoc variant list from client side
m.dt: int
Required. Value=1 for sequence variants, e.g. SNV or indels Value=2 for SV/fusion breakpoints.
m.chr=STR, m.pos=INT
Required. Pos is 0-based.
m.ref=str, m.alt=str
Optional. Provides REF and ALT alleles of a mutation.
m.class
Optional. Decides the rendering color of a variant
m.mname
Optional. Provides content for a text label for a variant.
m.occurrence: INT
Optional. Value is expected to be a non-negative integer.
m.sample_id:str, m.sample:str
Optional. If “sample” is used, it will be renamed to “sample_id”. .sample_id is the hardcoded attribute for sample identifier. If sample_id is set but occurrence is missing, mds3 will dynamically group samples together for the same
m.samples[]
Samples[] array is created when samples are aggregated. Each element is: { sample_id, }
m.htmlSections[]
Optional. To be displayed in single variant panel.
htmlSections=[
{ key:STR, html:'xxx'},
Custom sv/fusion event
Example:
{
gene1:'PAX5', chr1:'chr9', pos1:37002646, strand1:'-',
gene2:'JAK2', chr2:'chr9', pos2:5081726, strand2:'+',
dt:2,
class:'Fuserna'
}
tk.click_snvindel(m{})
Optional. Provide a click handler on snv/indel data points (dots rendered in a “skewer” track). In such case it will highlight the “kick” cover of the clicked dot (red border, bigger size), which won’t happen otherwise.
tk.skewerModes:[]
Optional. Define one or more methods to render the “skewer” track.
skewerModes:[
{
type:'numeric',
byAttribute:'lpv', label:'-log10(p-value)', inuse:true, axisheight:100
},
{
type:'numeric',
byAttribute:'value2', label:'other numbers', axisheight:200
},
]
Below “nm” is a short-hand of a method, an element in this array.
nm.type: STR
Required. Value must be one of following string
- type="skewer"
- Display a skewer graph. An object will be automatically added to skewerModes[] array if this type is missing.
- type="numeric"
- Project variants on a numerical vertical axis.
Numeric mode (nm.type=numeric)
Numeric mode data method One of the following has to be set for type=”numeric”
nm.byAttribute: STR
To check the given attribute on a variant m{} for numeric value. E.g. if byAttribute=”occurrence”, then m.occurrence will be the numeric value. If the resulting value is not a number, the data point will be placed at the bottom of the Y axis.
nm.axisheight: INT
Optional. Defines axis height for numeric mode. Default 150.
nm.isinteger: true
If true, will print integer values in the left-side Y axis.
nm.label: STR
Optional. Provide a label to show on Y axis. If missing, show “Numeric value”.
nm.inuse: true
If true, indicates this method is in use.
nm.tooltipPrintValue(m)
Optional. Take variant object m as argument.
Custom data point shapes when in numeric mode
Custom data point shapes are only available for numeric mode.
m.shape
Available shapes are
If no shape is specified, the data point is rendered as a filled in circle, ●
tk.legend.customShapeLabels: {}
Optional. Allows to show the name/count of each shape in the legend. Example:
legend: {
customShapeLabels: {
filledCircle: "Serine",
filledTriangle: "Threonine",
emptyCircle: "Tyrosine"
}
}
Other customizations
tk.filter0={}
Provide a JSON object to be used when querying GDC API.
tk.filter0 = {
"op": "and",
"content": [{
"op": "in",
"content": {
"field": "cases.primary_site",
"value": ["breast", "bronchus and lung"]
}
}]
}
When PP is embedded in the GDC Analysis Tools Framework, “filter0” is used to pass an external filter (e.g. cohort filter constructed in ATF) to PP. PP mds3 client code simply passes this JSON object to PP backend for API queries.
Important: “filter0” is invisible, read-only, and used as-is, as mds3 does not compute/modify/visualize it.
tk.filterObj = {}
A PP filter object, to filter down samples represented in this track. This is used in tandem with filter0. Mds3 will compute, modify, and visualize filterObj.
tk.allow2selectSamples = {}
If set, allow to select samples, e.g. by displaying check boxes and “Select” button in the sample tables.
allow2selectSamples = {
buttonText:'Select',
attributes:['sample_id'],
callback: samples=>{}
}
- buttonText
- Text to display on button.
- If missing, use “Select samples”
- attributes[]
- Array of keys to fetch attribute values from sample objects and return to callback
- If missing, defaults to ["sample_id"]
- callback()
- Required. Parameter is list of objects, each with key/value pairs defined in attributes[]
tk.callbackOnRender(tk,block)
If present, will call after each re-rendering.