Commit f2ccd67d authored by Hoogenboom, Jerry's avatar Hoogenboom, Jerry
Browse files

FDSTools v1.0.1.dev1

* Samplevis v2.1.2:
  * Added 'Save page' link to HTML visualisations, which offers for download a
    copy of the entire HTML visualisation including the user's changes.
  * Added automatic allele calling to static visualisations.
* Pipeline v1.0.2:
  * Added -A/--in-allelelist option to the pipeline tool to provide an existing
    allele list file when running the ref-db analysis, bypassing Allelefinder.
* Vis v1.0.3:
  * The -n/--min-abs and -s/--min-per-strand options now accept non-integer
    values as well.
  * Added six options to control the Table Filtering Options of Samplevis.
  * The Display Options now have a separate option group on the command line.
parent 21b61ecd
......@@ -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', '0', 'rc3')
__version_info__ = ('1', '0', '1', 'dev1')
__version__ = '.'.join(__version_info__)
usage = __doc__.split("\n\n\n")
......
......@@ -57,7 +57,7 @@ from ..lib import split_quoted_string, DEF_TAG_EXPR, DEF_TAG_FORMAT, get_tag, \
from ConfigParser import RawConfigParser, NoSectionError, NoOptionError
__version__ = "1.0.1"
__version__ = "1.0.2"
# Pattern that matches a long argparse argument name.
......@@ -97,8 +97,8 @@ ANALYSIS_ARGS = {
"reference-sample":
("analysis", "in-library", "in-sample-raw", "tag-expr", "tag-format"),
"reference-database":
("analysis", "in-library", "in-samples", "prefix", "tag-expr",
"tag-format"),
("analysis", "in-library", "in-samples", "in-allelelist", "prefix",
"tag-expr", "tag-format"),
"case-sample":
("analysis", "in-library", "in-sample-raw", "in-stuttermodel",
"in-bgprofiles", "store-predictions", "tag-expr", "tag-format")
......@@ -417,21 +417,27 @@ def run_ref_database_analysis(arg_defs, config):
prefix = ini_try_get_option(config, NAME, "prefix", "")
if prefix and prefix[-1] not in "-_./\\":
prefix += "-"
allelefile = ini_try_get_option(config, NAME, "in-allelelist")
run_allelefinder = False
if allelefile is None:
allelefile = prefix + "allelelist.txt"
run_allelefinder = True
# Overwrite any explicit I/O configuration.
if not config.has_section("allelefinder"):
config.add_section("allelefinder")
config.set("allelefinder", "infiles", in_samples)
config.set("allelefinder", "outfile", prefix + "allelelist.txt")
config.set("allelefinder", "report", prefix + "allelereport.txt")
config.set("allelefinder", "library", in_library)
config.set("allelefinder", "tag-expr", tag_expr)
config.set("allelefinder", "tag-format", tag_format)
if not config.has_option("allelefinder", "stuttermark-column"):
config.set("allelefinder", "stuttermark-column", "annotation")
if run_allelefinder:
if not config.has_section("allelefinder"):
config.add_section("allelefinder")
config.set("allelefinder", "infiles", in_samples)
config.set("allelefinder", "outfile", allelefile)
config.set("allelefinder", "report", prefix + "allelereport.txt")
config.set("allelefinder", "library", in_library)
config.set("allelefinder", "tag-expr", tag_expr)
config.set("allelefinder", "tag-format", tag_format)
if not config.has_option("allelefinder", "stuttermark-column"):
config.set("allelefinder", "stuttermark-column", "annotation")
if not config.has_section("bgestimate"):
config.add_section("bgestimate")
config.set("bgestimate", "allelelist", prefix + "allelelist.txt")
config.set("bgestimate", "allelelist", allelefile)
config.set("bgestimate", "infiles", in_samples)
config.set("bgestimate", "outfile", prefix + "bgprofiles.txt")
config.set("bgestimate", "library", in_library)
......@@ -439,7 +445,7 @@ def run_ref_database_analysis(arg_defs, config):
config.set("bgestimate", "tag-format", tag_format)
if not config.has_section("stuttermodel"):
config.add_section("stuttermodel")
config.set("stuttermodel", "allelelist", prefix + "allelelist.txt")
config.set("stuttermodel", "allelelist", allelefile)
config.set("stuttermodel", "infiles", in_samples)
config.set("stuttermodel", "outfile", prefix + "stuttermodel.txt")
config.set("stuttermodel", "library", in_library)
......@@ -448,7 +454,7 @@ def run_ref_database_analysis(arg_defs, config):
config.set("stuttermodel", "raw-outfile", prefix + "stuttermodel-raw.txt")
if not config.has_section("bghomraw"):
config.add_section("bghomraw")
config.set("bghomraw", "allelelist", prefix + "allelelist.txt")
config.set("bghomraw", "allelelist", allelefile)
config.set("bghomraw", "infiles", in_samples)
config.set("bghomraw", "outfile", prefix + "bgprofiles-raw.txt")
config.set("bghomraw", "library", in_library)
......@@ -469,10 +475,11 @@ def run_ref_database_analysis(arg_defs, config):
config.set("seqconvert", "marker-column", "marker")
config.set("seqconvert", "allele-column", "sequence")
# Start with Allelefinder.
p_allelefinder = subprocess.Popen(
get_argv("allelefinder", arg_defs, config))
p_allelefinder.wait()
if run_allelefinder:
# Start with Allelefinder.
p_allelefinder = subprocess.Popen(
get_argv("allelefinder", arg_defs, config))
p_allelefinder.wait()
p_bgestimate = subprocess.Popen(get_argv("bgestimate", arg_defs, config))
......@@ -482,7 +489,7 @@ def run_ref_database_analysis(arg_defs, config):
p_bghomraw = subprocess.Popen(get_argv("bghomraw", arg_defs, config))
config.set("vis", "type", "allele")
config.set("vis", "infile", prefix + "allelelist.txt")
config.set("vis", "infile", allelefile)
config.remove_option("vis", "infile2")
config.set("vis", "outfile", prefix + "allelegraph.html")
p_allelevis = subprocess.Popen(get_argv("vis", arg_defs, config))
......@@ -868,6 +875,11 @@ def add_arguments(parser):
group.add_argument("-S", "--in-samples", metavar="SAMPLE", nargs="+",
help="[ref-database] file names of reference sample data files "
"('.csv' output files of the 'reference-sample' analysis)")
group.add_argument('-A', '--in-allelelist', metavar="ALLELEFILE",
help="[ref-database] file containing a list of the true alleles of "
"each sample; if not given, Allelefinder will be run as part of "
"the pipeline to create this file; it is ESSENTIAL that you "
"check the correctness and completeness of the allele list")
group.add_argument("-P", "--prefix",
help="[ref-database] if specified, all output file names are prefixed "
"with this value")
......
......@@ -55,7 +55,7 @@ from pkg_resources import resource_stream, resource_string
from ..lib import pos_int_arg
__version__ = "1.0.2"
__version__ = "1.0.3"
# Default values for parameters are specified below.
......@@ -78,6 +78,33 @@ _DEF_THRESHOLD_PCT_OF_SUM = 0.0
# This value can be overridden by the -s command line option.
_DEF_THRESHOLD_ORIENTATION = 0
# Default minimum number of reads to mark as allele in Samplevis.
# This value can be overridden by the -n command line option.
_DEF_THRESHOLD_ABS_ALLELE = 30
# Default minimum percentage of reads w.r.t. the highest allele of the
# marker to mark as allele in Samplevis.
# This value can be overridden by the -m command line option.
_DEF_THRESHOLD_PCT_OF_MAX_ALLELE = 2.
# Default minimum percentage of reads w.r.t. the marker's total number
# of reads to mark as allele in Samplevis.
# This value can be overridden by the -p command line option.
_DEF_THRESHOLD_PCT_OF_SUM_ALLELE = 1.5
# Default minimum percentage of correction to mark as allele in Samplevis.
# This value can be overridden by the -c command line option.
_DEF_THRESHOLD_CORRECTION_ALLELE = 0
# Default minimum number of recovered reads as a percentage of the
# number of reads after correction to mark as allele in Samplevis.
# This value can be overridden by the -r command line option.
_DEF_THRESHOLD_RECOVERY_ALLELE = 0
# Default minimum number of reads per strand to mark as allele in Samplevis.
# This value can be overridden by the -b command line option.
_DEF_THRESHOLD_ORIENTATION_ALLELE = 1
# Default percentage of reads on one strand to mark as bias.
# This value can be overridden by the -B command line option.
_DEF_THRESHOLD_BIAS = 25.0
......@@ -163,7 +190,10 @@ def create_visualisation(vistype, infile, infile2, outfile, vega, online, tidy,
min_per_strand, bias_threshold, bar_width, padding,
marker, width, height, log_scale, repeat_unit,
no_alldata, no_aggregate, no_ce_length_sort,
max_seq_len, jitter, title):
max_seq_len, jitter, title, allele_min_abs,
allele_min_pct_of_max, allele_min_pct_of_sum,
allele_min_correction, allele_min_recovery,
allele_min_per_strand):
# Get graph spec.
spec = json.load(resource_stream(
"fdstools", "vis/%svis/%svis.json" % (vistype, vistype)))
......@@ -208,6 +238,17 @@ def create_visualisation(vistype, infile, infile2, outfile, vega, online, tidy,
set_signal_value(spec, "show_other", not no_aggregate)
set_signal_value(spec, "sort_str_by_length", not no_ce_length_sort)
set_signal_value(spec, "max_seq_len", max_seq_len)
set_signal_value(spec, "allele_amplitude_threshold", allele_min_abs)
set_signal_value(spec, "allele_amplitude_pct_threshold",
allele_min_pct_of_max)
set_signal_value(spec, "allele_amplitude_markerpct_threshold",
allele_min_pct_of_sum)
set_signal_value(spec, "allele_correction_threshold",
allele_min_correction)
set_signal_value(spec, "allele_recovery_threshold",
allele_min_recovery)
set_signal_value(spec, "allele_orientation_threshold",
allele_min_per_strand)
# Apply axis scale settings.
if vistype != "stuttermodel" and vistype != "allele":
......@@ -312,7 +353,7 @@ def add_arguments(parser):
visgroup = parser.add_argument_group("visualisation options",
description="words in [brackets] indicate applicable visualisation "
"types")
visgroup.add_argument('-n', '--min-abs', metavar="N", type=int,
visgroup.add_argument('-n', '--min-abs', metavar="N", type=float,
default=_DEF_THRESHOLD_ABS,
help="[sample, profile, bgraw] only show sequences with this minimum "
"number of reads (default: %(default)s)")
......@@ -326,8 +367,8 @@ def add_arguments(parser):
default=_DEF_THRESHOLD_PCT_OF_SUM,
help="[sample] only show sequences with at least this percentage of "
"the total number of reads of a marker (default: %(default)s)")
visgroup.add_argument('-s', '--min-per-strand', metavar="N",
type=int, default=_DEF_THRESHOLD_ORIENTATION,
visgroup.add_argument('-s', '--min-per-strand', metavar="N", type=float,
default=_DEF_THRESHOLD_ORIENTATION,
help="[sample] only show sequences with this minimum number of reads "
"for both orientations (forward/reverse) (default: %(default)s)")
visgroup.add_argument('-B', '--bias-threshold', metavar="N", type=float,
......@@ -351,43 +392,74 @@ def add_arguments(parser):
visgroup.add_argument('-A', '--no-alldata', action="store_true",
help="[stuttermodel] if specified, show only marker-specific fits")
visgroup.add_argument('-a', '--no-aggregate', action="store_true",
help="[sample] if specified, do not replace filtered sequences with a"
help="[sample] if specified, do not replace filtered sequences with a "
"per-marker aggregate 'Other sequences' entry")
visgroup.add_argument('-L', '--log-scale', action="store_true",
visgroup.add_argument('-I', '--input2', dest="infile2", metavar="FILE",
type=argparse.FileType("r"),
help="[profile, stuttermodel] raw data points file to overlay on the "
"background noise profiles or stutter model graphs; if not "
"specified, HTML visualisation files will contain a file "
"selection control")
dispgroup = parser.add_argument_group("display options")
dispgroup.add_argument('-L', '--log-scale', action="store_true",
help="[sample, profile, bgraw, bganalyse] use logarithmic scale (for "
"sample and bganalyse: square root scale) instead of linear "
"scale")
visgroup.add_argument('-b', '--bar-width', metavar="N", type=pos_int_arg,
dispgroup.add_argument('-b', '--bar-width', metavar="N", type=pos_int_arg,
default=_DEF_BAR_WIDTH,
help="[sample, profile, bgraw, bganalyse] width of the bars in pixels "
"(default: %(default)s)")
visgroup.add_argument('-p', '--padding', metavar="N", type=pos_int_arg,
dispgroup.add_argument('-p', '--padding', metavar="N", type=pos_int_arg,
default=_DEF_SUBGRAPH_PADDING,
help="[sample, profile, bgraw, stuttermodel] amount of padding (in "
"pixels) between graphs of different markers/alleles (default: "
"%(default)s)")
visgroup.add_argument('-w', '--width', metavar="N", type=pos_int_arg,
dispgroup.add_argument('-w', '--width', metavar="N", type=pos_int_arg,
default=_DEF_WIDTH,
help="[sample, profile, bgraw, stuttermodel, bganalyse, allele] width "
"of the graph area in pixels (default: %(default)s)")
visgroup.add_argument('-H', '--height', metavar="N", type=pos_int_arg,
dispgroup.add_argument('-H', '--height', metavar="N", type=pos_int_arg,
default=_DEF_HEIGHT,
help="[stuttermodel, allele] height of the graph area in pixels "
"(default: %(default)s)")
visgroup.add_argument('-x', '--max-seq-len', metavar="N", type=pos_int_arg,
dispgroup.add_argument('-x', '--max-seq-len', metavar="N", type=pos_int_arg,
default=_DEF_MAX_SEQ_LEN,
help="[sample] truncate long sequences to this number of characters "
"(default: %(default)s)")
visgroup.add_argument('-j', '--jitter', metavar="N", type=float,
dispgroup.add_argument('-j', '--jitter', metavar="N", type=float,
default=_DEF_JITTER,
help="[stuttermodel] apply this amount of jitter to raw data points "
"(between 0 and 1, default: %(default)s)")
visgroup.add_argument('-I', '--input2', dest="infile2", metavar="FILE",
type=argparse.FileType("r"),
help="[profile, stuttermodel] raw data points file to overlay on the "
"background noise profiles or stutter model graphs; if not "
"specified, HTML visualisation files will contain a file "
"selection control")
allelegroup = parser.add_argument_group("allele calling options",
"for sample visualisations only; sequences that match the -C or -Y "
"option (or both) and all of the other settings are marked as "
"'allele'")
allelegroup.add_argument('-N', '--allele-min-abs', metavar="N", type=float,
default=_DEF_THRESHOLD_ABS_ALLELE,
help="the minimum number of reads (default: %(default)s)")
allelegroup.add_argument('-X', '--allele-min-pct-of-max', metavar="PCT",
type=float, default=_DEF_THRESHOLD_PCT_OF_MAX_ALLELE,
help="the minimum percentage of reads w.r.t. the highest allele of "
"the marker (default: %(default)s)")
allelegroup.add_argument('-Q', '--allele-min-pct-of-sum', metavar="PCT",
type=float, default=_DEF_THRESHOLD_PCT_OF_SUM_ALLELE,
help="the minimum percentage of reads w.r.t. the marker's total "
"number of reads (default: %(default)s)")
allelegroup.add_argument('-C', '--allele-min-correction', metavar="N",
type=float, default=_DEF_THRESHOLD_CORRECTION_ALLELE,
help="the minimum change in read count due to correction by e.g., "
"bgcorrect (default: %(default)s)")
allelegroup.add_argument('-Y', '--allele-min-recovery', metavar="N",
type=float, default=_DEF_THRESHOLD_RECOVERY_ALLELE,
help="the minimum number of reads that was recovered thanks to "
"noise correction (by e.g., bgcorrect), as a percentage of the "
"total number of reads after correction (default: %(default)s)")
allelegroup.add_argument('-Z', '--allele-min-per-strand', metavar="N",
type=float, default=_DEF_THRESHOLD_ORIENTATION_ALLELE,
help="the minimum number of reads in both orientations (default: "
"%(default)s)")
#add_arguments
......@@ -417,5 +489,9 @@ def run(args):
args.height, args.log_scale, args.repeat_unit,
args.no_alldata, args.no_aggregate,
args.no_ce_length_sort, args.max_seq_len, args.jitter,
args.title)
args.title, args.allele_min_abs,
args.allele_min_pct_of_max,
args.allele_min_pct_of_sum,
args.allele_min_correction, args.allele_min_recovery,
args.allele_min_per_strand)
#run
......@@ -21,10 +21,10 @@
# along with FDSTools. If not, see <http://www.gnu.org/licenses/>.
-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sample Visualisation - FDSTools</title>
<!-- VERSION 2.1.1 -->
<!-- VERSION 2.1.2 -->
<!-- BEGIN_LIBRARIES -->
<script src="https://vega.github.io/vega-editor/vendor/d3.min.js"></script>
<script src="https://vega.github.io/vega/vega.min.js"></script>
......@@ -487,6 +487,7 @@
<td>
<a id="saveImageLink" href="javascript:void(saveImage())" class="disabled">Save image</a>
<a id="saveTableLink" href="javascript:void(saveTable())" class="disabled">Save table</a>
<a id="savePageLink" href="javascript:void(savePage())" class="disabled">Save page</a>
</td>
</tr>
</table>
......@@ -645,6 +646,7 @@
</div>
<div id="vis-tooltip"></div>
<script type="text/javascript">
var PAT_LOAD_SCRIPT = /(<!--\s*BEGIN_LOAD_SCRIPT\s*-->\s*)([^]*?\s*<\/script>)/;
var PAT_SEQ_RAW = /^[ACGT]*$/;
var PAT_ALLELENAME_SPLIT = /[\]\)_]/g;
var graphs = false;
......@@ -676,6 +678,7 @@ function parse(maintainSelection){
document.getElementById("saveImageLink").setAttribute("class", "disabled");
document.getElementById("saveTableLink").setAttribute("class", "disabled");
document.getElementById("clearSelectionLink").setAttribute("class", selectedAlleles.length? "" : "disabled");
document.getElementById("savePageLink").setAttribute("class", "");
//Get a list of marker names and render a graph for each of them.
var splitMarkers = document.getElementById("splitmarkers").checked;
......@@ -1395,8 +1398,89 @@ function updateTable(i){
document.getElementById("saveTableLink").setAttribute("class", (autoSelected.length + userSelected.length? "" : "disabled"));
}
function onLoadSpec(has_data){
if(!has_data){
var pagehtml = "";
function savePage(){
var link = document.getElementById("savePageLink");
if(link.getAttribute("class") == "disabled")
return false;
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"){
graph_specx.signals[i].init = document.getElementById("markerFilter").value;
break;
}
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;
});
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);
else{
sel.splice(i, 1);
desel.push(sa);
}
});
var b = new Blob(
[[pagehtml.substr(0, x.index + x[1].length),
"<","script type=\"text/javascript\">",
"var graph_spec=",JSON.stringify(graph_specx),
";onLoadSpec(false,true)",
";linebreak=",JSON.stringify(linebreak),
";data_values=",JSON.stringify(data_values),
";missing_markers=",JSON.stringify(missing_markers),
";userSelected=",JSON.stringify(sel),
";userDeselected=",JSON.stringify(desel),
";document.getElementById(\"splitmarkers\").checked=",(splitMarkers? "true": "false"),
";document.getElementById(\"commonrange\").disabled=",(splitMarkers? "true": "false"),
";document.getElementById(\"renderSVG\").checked=",(rendererName == "svg"? "true": "false"),
";document.getElementById(\"renderCanvas\").checked=",(rendererName == "canvas"? "true": "false"),
";parse(true);",
"<","/script>",
pagehtml.substr(x.index + x[1].length + x[2].length)].join("")],
{type: "text/html"});
if(window.navigator.msSaveOrOpenBlob)
window.navigator.msSaveOrOpenBlob(b, fileName + ".html");
else{
var url = URL.createObjectURL(b);
link.setAttribute("href", url);
link.setAttribute("download", fileName + ".html");
link.click();
link.setAttribute("href", "javascript:void(savePage())");
link.removeAttribute("download");
}
if(b.msClose)
b.msClose();
return false;
}
function onLoadSpec(has_data, no_file_chooser){
pagehtml = "<!DOCTYPE html>\n" + document.documentElement.outerHTML;
if(!has_data && !no_file_chooser){
//Handle files from the file input.
document.getElementById("fileselect").addEventListener('change', function(){
loadDataset(document.getElementById("fileselect").files);
......@@ -1423,10 +1507,14 @@ function onLoadSpec(has_data){
}, false);
}
//Doing allele calling outside of Vega.
graph_spec.data[6].source = null;
graph_spec.data[6].transform = null;
//Parse data outside of Vega.
data_format = graph_spec.data[0].format;
graph_spec.data[0].format = null;
if(has_data){
if(has_data)
data_values = vg.util.read(graph_spec.data[0].values, data_format).filter(function(datum){
if(datum.sequence == "No data"){
missing_markers.push(datum.marker);
......@@ -1434,18 +1522,16 @@ function onLoadSpec(has_data){
}
return true;
});
if(graph_spec.data[0].fdstools_filename){
var rows = document.querySelectorAll(".filenamedisplayrow");
for (var i = 0; i < rows.length; i++)
rows[i].style.display = "table-row";
var cell = document.getElementById("filenamedisplay");
removeChildren(cell);
cell.appendChild(document.createTextNode(graph_spec.data[0].fdstools_filename));
setFileName(graph_spec.data[0].fdstools_filename);
}
if(graph_spec.data[0].fdstools_filename && (has_data || no_file_chooser)){
var rows = document.querySelectorAll(".filenamedisplayrow");
for (var i = 0; i < rows.length; i++)
rows[i].style.display = "table-row";
var cell = document.getElementById("filenamedisplay");
removeChildren(cell);
cell.appendChild(document.createTextNode(graph_spec.data[0].fdstools_filename));
setFileName(graph_spec.data[0].fdstools_filename);
}
//Update graph when rendering mode or axis scale is changed.
document.getElementById("renderCanvas").addEventListener('change', function(){
setRenderer(this.value);
......@@ -1519,6 +1605,48 @@ function onLoadSpec(has_data){
return;
setSignalValue("orientation_threshold", value);
}, false);
document.getElementById("minNa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_amplitude_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("minPa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_amplitude_pct_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("minTa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_amplitude_markerpct_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("minCa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_correction_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("minAa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_recovery_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("minOa").addEventListener('change', function(){
var value = parseFloat(this.value);
if(isNaN(value))
return;
setSignalValue("allele_orientation_threshold", value);
autoSelectAlleles();
}, false);
document.getElementById("markerFilter").addEventListener('change', function(){
if(graphs !== false)
parse(true);
......@@ -1539,30 +1667,6 @@ function onLoadSpec(has_data){
setSignalValue("sort_str_by_length", this.checked);
updateAllTables();
}, false);
document.getElementById("minNa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
document.getElementById("minPa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
document.getElementById("minTa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
document.getElementById("minCa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
document.getElementById("minAa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
document.getElementById("minOa").addEventListener('change', function(){
if(!isNaN(parseFloat(this.value)))
autoSelectAlleles();
}, false);
//Sync graph_spec and display.
if(getScale() == "linear"){
......@@ -1582,10 +1686,17 @@ function onLoadSpec(has_data){
document.getElementById("minP").value = getSignalValue("amplitude_pct_threshold");
document.getElementById("minT").value = getSignalValue("amplitude_markerpct_threshold");
document.getElementById("minO").value = getSignalValue("orientation_threshold");
document.getElementById("minNa").value = getSignalValue("allele_amplitude_threshold");
document.getElementById("minPa").value = getSignalValue("allele_amplitude_pct_threshold");
document.getElementById("minTa").value = getSignalValue("allele_amplitude_markerpct_threshold");
document.getElementById("minCa").value = getSignalValue("allele_correction_threshold");
document.getElementById("minAa").value = getSignalValue("allele_recovery_threshold");
document.getElementById("minOa").value = getSignalValue("allele_orientation_threshold");
document.getElementById("minBias").value = getSignalValue("bias_threshold");
document.getElementById("shownegative").checked = getSignalValue("show_negative");
document.getElementById("showother").checked = getSignalValue("show_other");
document.getElementById("sortstrbylength").checked = getSignalValue("sort_str_by_length");
document.getElementById("commonrange").checked = (graph_spec.marks[1].scales[0].domain.data == "table");
//Automatically move the tooltip with the mouse pointer.
var tt = document.getElementById("vis-tooltip");
......
{
"fdstools_visversion": "2.1.1",
"fdstools_visversion": "2.1.2",
"width": 600,
"height": 10,
"signals": [
......@@ -19,6 +19,30 @@
"name": "orientation_threshold",
"init": 0
},
{
"name": "allele_amplitude_threshold",
"init": 30