Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 755c7132 authored by marc duez's avatar marc duez
Browse files

Merge branch 'feature-c/axis_fix+doc' into 'dev'

Feature c/axis fix+doc

See merge request !983
parents 41b39b93 6ac0bd03
Pipeline #265531 failed with stages
in 8 minutes and 34 seconds
......@@ -64,7 +64,7 @@ function loadAfterConf() {
"js/clone",
"js/dynprog",
"js/list",
"js/axes",
"js/axis_conf",
"js/axis",
"js/graph",
"js/scatterPlot_menu",
......
......@@ -103,6 +103,7 @@ Axis.prototype = {
this.fct = json.fct
this.color = json.color
this.sort = json.sort
this.min_step = json.min_step
this.germline = "multi"
if ('germline' in json)
......@@ -230,7 +231,8 @@ Axis.prototype = {
var delta = this.scale.max - this.scale.min
var nice = nice_min_max_steps(this.scale.min, this.scale.max, max)
this.step = nice.step
if (typeof this.min_step == "undefined") this.min_step = nice.step
this.step = Math.max(nice.step, this.min_step)
this.precision = nice_number_digits(this.step, 1)
this.scale.nice_min = nice.min
......
......@@ -132,7 +132,8 @@ AXIS_DEFAULT = {
name: "N length",
doc: "N length, from the end of the V/5' segment to the start of the J/3' segment (excluded)",
fct: function(clone) {return clone.getNlength()},
autofill: true
autofill: true,
min_step: 1
},
"CDR3 length (nt)": {
name: "CDR3 length (nt)",
......@@ -148,22 +149,22 @@ AXIS_DEFAULT = {
"productive": {text:"productive"},
},
fct: function(clone) {return clone.getProductivityName()},
pretty: function(tag) { return icon_pm(tag, "productive", "not productive") },
pretty: function(tag) { return icon_pm(tag, "productive", "not productive") },
isInAligner: true
},
"productivity detailed": {
name: "productivity detailed",
labels: {
"no CDR3 detected": {text:"no CDR3 detected"},
"productive": {text:"productive"},
"stop-codon": {text:"stop codon"},
"out-of-frame": {text:"out of frame"},
"no-WPGxG-pattern": {text:"no {WP}GxG pattern"},
"not-productive": {text:"not productive"}
},
fct: function(clone) {return clone.getProductivityNameDetailed()},
sort : false,
isInAligner: true
sort : function(a,b){
var order = ["productive","not-productive","stop-codon","out-of-frame","no-WPGxG-pattern","no CDR3 detected"]
return order.indexOf(a) - order.indexOf(b);
},
isInAligner:true,
autofill : true
},
"productivity IMGT": {
name : "productivity [IMGT]",
......
......@@ -28,7 +28,7 @@ var lib_vidjil = [ //"js/conf",
"js/info",
"js/list",
"js/axis",
"js/axes",
"js/axis_conf",
"js/graph",
"js/scatterPlot_menu",
"js/scatterPlot_selector",
......
......@@ -215,12 +215,12 @@ QUnit.test("axes productivity detailed", function(assert) {
var axes_legend = document.getElementById("visu_axis_x_container").childNodes
setTimeout( function() {
assert.equal( axes_legend[0].__data__.text, "no CDR3 detected", "sp legend productivity; no CDR3 detected")
assert.equal( axes_legend[1].__data__.text, "productive", "sp legend productivity; productive")
assert.equal( axes_legend[2].__data__.text, "stop codon", "sp legend productivity; stop codon")
assert.equal( axes_legend[3].__data__.text, "out of frame", "sp legend productivity; out of frame")
assert.equal( axes_legend[4].__data__.text, "no {WP}GxG pattern", "sp legend productivity; no {WP}GxG pattern")
assert.equal( axes_legend[5].__data__.text, "not productive", "sp legend productivity; not productive")
assert.equal( axes_legend[0].__data__.text, "productive", "sp legend productivity; productive")
assert.equal( axes_legend[1].__data__.text, "not productive", "sp legend productivity; not productive")
assert.equal( axes_legend[2].__data__.text, "out-of-frame", "sp legend productivity; out of frame")
assert.equal( axes_legend[3].__data__.text, "stop-codon", "sp legend productivity; stop codon")
assert.equal( axes_legend[4].__data__.text, "no CDR3 detected", "sp legend productivity; no cdr3 detected")
assert.equal( axes_legend[5].__data__.text, "no-WPGxG-pattern", "sp legend productivity; no-WPGxG-pattern")
ready()
}, 150);
})
\ No newline at end of file
......@@ -91,7 +91,7 @@ Moreover, the state of the client can be encoded in the URL, as in <http://app.v
| `plot=x,y,m` | plot (x axis, y axis) |
| `clone=xx,xx,xx` | selected clone ids |
For `plot` the axis names are found in `browser/js/axes.js`. `m` is optional, and defines the type of plot (either `grid` or `bar`).
For `plot` the axis names are found in `browser/js/axis_conf.js`. `m` is optional, and defines the type of plot (either `grid` or `bar`).
We intend to encode more parameters in the URL.
......@@ -283,14 +283,35 @@ In the `console.log`, the field `priority` takes one of those priorities.
You want to add a dimension in the scatterplot or as a color? Read the
following.
1. Scatterplot
1. Axis
In [scatterPlot.js](../browser/js/scatterPlot.js), the `available_axis` object defines the dimensions that
In [axes.js](../browser/js/axes.js), the `AXIS_DEFAULT` object defines the dimensions that
can be displayed. It suffices to add an entry so that it will be proposed
in the X and Y axis. This kind of way of doing should be generalized to
the other components.
The presets are defined in the `preset` object.
Here is some of the settings you can use to customize your axis.
- name
a short description of the axis
- doc
a more detailled description of the axis
- fct
a javascript function that must return a value to be displayed on the axis for a given clone ID
- scale
used to define numerical axis min/max value
- labels
a list of labels that must always be present on the axis even if no clones has returned the corresponding value.
- autofill
autofill : true mean the list of label will be created or extended with all unique values returned by the clones.
It will also create an adapted scale with the min/max value returned by the clones in case of a numerical axis.
- sort
you can provide a custom comparison function to sort the labels in a specific order
There is also other settings that can be used to customize even further labels appearance or display, please check the already defined axes in [axes.js] to learn more about them.
2. Preset
The presets are defined in the `preset` object that can be found in [scatterPlot_menu.js].
2. Color
......
......@@ -468,7 +468,7 @@ python fuse.py -d lenSeqAverage -d seg3,seg5 sample_42.vidjil
The command `fuse.py -l` yields the list of available axes,
but currently only `lenSeqAverage` and `seq3,seq5` are supported.
Adding axes can be done trough in `get_values()` in `tools/fuse.py`.
Note that axes should also be added to `browser/js/axes.js` to be displayed in the client.
Note that axes should also be added to `browser/js/axis_conf.js` to be displayed in the client.
## `germlines` list \[optional\]\[work in progress, to be documented\]
......
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