Commit 98c434ed authored by Hoogenboom, Jerry's avatar Hoogenboom, Jerry

FDSTools v1.0.1.dev2

* Samplevis v2.1.2 (additionally):
  * The net effect of the allele calling thresholds (table filtering options)
    is now visualised in the graphs as a dashed vertical red line.
  * Fixed issue with allele calling thresholds not working anymore after having
    used the 'Save page' link in HTML visualisations.
parent f2ccd67d
......@@ -24,7 +24,7 @@ including tools for characterisation and filtering of PCR stutter artefacts and
other systemic noise, and for automatic detection of the alleles in a sample.
"""
__version_info__ = ('1', '0', '1', 'dev1')
__version_info__ = ('1', '0', '1', 'dev2')
__version__ = '.'.join(__version_info__)
usage = __doc__.split("\n\n\n")
......
......@@ -35,7 +35,7 @@
font-size: 1em;
}
.icon {
padding: 1em;
padding: 0em 1em;
margin-right: .25em;
background-size: contain;
background-position: center;
......@@ -1403,9 +1403,10 @@ function savePage(){
var link = document.getElementById("savePageLink");
if(link.getAttribute("class") == "disabled")
return false;
//Get current settings and copy graph spec.
var rendererName = document.querySelector("input[name=renderer]:checked").value;
var splitMarkers = document.getElementById("splitmarkers").checked;
var x = PAT_LOAD_SCRIPT.exec(pagehtml);
var graph_specx = JSON.parse(JSON.stringify(graph_spec));
for(i in graph_specx.signals)
if(graph_specx.signals[i].name == "filter_marker"){
......@@ -1415,28 +1416,11 @@ function savePage(){
graph_specx.data[0].fdstools_filename = fileName;
graph_specx.data[0].format = data_format;
graph_specx.data[0].values = "";
var sel = userSelected.map(function(sa){
sa._prev = null;
sa._id = null;
sa.aggr._id = null;
sa.rank = null;
sa.thedatum = null;
return sa;
});
var desel = userDeselected.map(function(sa){
sa._prev = null;
sa._id = null;
sa.aggr._id = null;
sa.rank = null;
sa.thedatum = null;
return sa;
});
//Gather user-selected and user-deselected alleles.
var sel = userSelected.slice();
var desel = userDeselected.slice();
selectedAlleles.forEach(function(sa){
sa._prev = null;
sa._id = null;
sa.aggr._id = null;
sa.rank = null;
sa.thedatum = null;
var i = sel.indexOf(sa);
if(i < 0)
sel.push(sa);
......@@ -1445,8 +1429,31 @@ function savePage(){
desel.push(sa);
}
});
sel = sel.map(function(sa){
var c = {};
for(var prop in sa)
c[prop] = sa[prop];
c._prev = null;
c._id = null;
c.rank = null;
c.thedatum = null;
return c;
});
desel = desel.map(function(sa){
var c = {};
for(var prop in sa)
c[prop] = sa[prop];
c._prev = null;
c._id = null;
c.rank = null;
c.thedatum = null;
return c;
});
//Write page to Blob and offer it for download.
var loadscript_pos = PAT_LOAD_SCRIPT.exec(pagehtml);
var b = new Blob(
[[pagehtml.substr(0, x.index + x[1].length),
[[pagehtml.substr(0, loadscript_pos.index + loadscript_pos[1].length),
"<","script type=\"text/javascript\">",
"var graph_spec=",JSON.stringify(graph_specx),
";onLoadSpec(false,true)",
......@@ -1461,7 +1468,7 @@ function savePage(){
";document.getElementById(\"renderCanvas\").checked=",(rendererName == "canvas"? "true": "false"),
";parse(true);",
"<","/script>",
pagehtml.substr(x.index + x[1].length + x[2].length)].join("")],
pagehtml.substr(loadscript_pos.index + loadscript_pos[1].length + loadscript_pos[2].length)].join("")],
{type: "text/html"});
if(window.navigator.msSaveOrOpenBlob)
window.navigator.msSaveOrOpenBlob(b, fileName + ".html");
......
......@@ -429,8 +429,12 @@
{
"name": "d",
"type": "ordinal",
"range": ["transparent"],
"domain": ["\u2014 Strand balance"]
"range": ["black", "red"]
},
{
"name": "e",
"type": "ordinal",
"range": ["M-0.5,0L0.5,0", "M-0.5,0L-0.115385,0M0.115385,0L0.5,0"]
}
],
"marks": [
......@@ -532,13 +536,12 @@
}
},
{
"fill": "d",
"stroke": "d",
"shape": "e",
"values": ["Strand balance", "Allele threshold"],
"properties": {
"symbols": {
"stroke": {"value": "transparent"}
},
"labels": {
"x": {"value": 2}
"size": {"value": 100}
}
}
}
......@@ -759,6 +762,46 @@
}
]
},
{
"type": "rule",
"from": {
"transform": [
{
"type": "aggregate",
"groupby": ["marker"],
"summarize": {"xhigh": "max"}
},
{
"type": "lookup",
"on": "aggr",
"onKey": "marker",
"keys": ["marker"],
"as": ["aggr"],
"default": {"max_total_added": 0, "sum_total_added": 0}
},
{
"type": "formula",
"field": "threshold",
"expr": "max(allele_amplitude_threshold, allele_orientation_threshold*2, allele_amplitude_pct_threshold*datum.aggr.max_total_added/100, allele_amplitude_markerpct_threshold*datum.aggr.sum_total_added/100)"
},
{
"type": "filter",
"test": "datum.threshold <= datum.max_xhigh"
}
]
},
"properties": {
"update": {
"x": {"scale": "x", "field": "threshold"},
"y": {"value": 0},
"y2": {"field": {"group": "height"}},
"stroke": {"value": "red"},
"strokeOpacity": {"value": 0.5},
"strokeWidth": {"value": 1},
"strokeDash": {"value": [5, 3]}
}
}
},
{
"name": "alleleSelector",
"type": "rect",
......
......@@ -4,7 +4,6 @@ To-do:
* Detect whether correction was performed; hide related columns if not.
* Option to choose complete table download (all columns, not all rows).
* Option to freely adjust the sorting (currently CE length toggle only).
* Visualise table filtering thresholds in the graphs.
* Some of the media query breakpoints overlap, fix this.
* Make Samplevis more responsive when rendering/updating graphs. To do this,
the work should be broken up into chunks and each chunk should set off the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment