Commit dd55f196 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'doc/4020-documenter-les-distributions' into 'dev'

Resolve "Documenter les distributions"

Closes #4020

See merge request !554
parents 5bf132c9 935e075b
Pipeline #106833 passed with stages
in 11 minutes and 36 seconds
......@@ -50,10 +50,20 @@ function Clone(data, model, index, attributes) {
this.split = false
this.seg = {};
this.segEdited = false
// Link to another clone that include this one in his cluster (after merge)
this.mergedId = undefined
this.attributes = attributes
var key = Object.keys(data)
//// Attributes specific for distribution clones
// list of compatible real clones that share the same values for available axis
this.lst_compatible_clones = undefined
// Number of reads and clones, currently.
// Updated at real clone manipualtion, (change filter values, top, ...)
this.current_clones = undefined
this.current_reads = undefined
for (var i=0; i<key.length; i++ ){
this[key[i]]=data[key[i]]
}
......@@ -735,7 +745,8 @@ Clone.prototype = {
},
/**
* Define a list of compatible real clones
* Define a list of compatible real clones that share the same values for available axis
* The list is sample dependant and differ for each sample
* This list is called at the creation of the clone
*/
defineCompatibleClones: function(){
......@@ -763,7 +774,9 @@ Clone.prototype = {
/**
* Compute the current size of a distrib clone. SUbstract active clone that share same distribution values
* Compute the current size of a distrib clone. Substract active clone that share same distribution values
* This allow to get the current number of reads or clones that are represented by a distribution clone
* Use the list of compatible clones, define for each sample/timepoint to look at if they are filtered or not at the moment
* Will be call at each change top, filter or search action
* @return {[type]} [description]
*/
......
......@@ -72,14 +72,18 @@ as well with the locus selection.
- Other objects: `Report`, `Shortcut`
Extends functionalities but requires elements from the full `index.html`.
### Clone attributes
Clone use [boolean mask](https://en.wikipedia.org/wiki/Mask_(computing)) in order to specify attributes.
These attributes allow specific behavior inside the client.
C_SIZE_CONSTANT
C_SIZE_DISTRIB
C_SIZE_OTHER
Each clone has one (and only one) of these attributes.
Each clone has one (and only one) attributes linked to his type/size.
Either its raw size is constant (`_CONSTANT`), either it is computed from other clones (`_DISTRIB`, `_OTHER`).
Note that, that in each case, the displayed size can be different from the raw size
due to normalizations.
......@@ -103,6 +107,38 @@ Each clone that has values on the current axes will be displayed in the 'scatter
Each clone that has a sequence will be displayed in the bottom 'segmenter' panel.
### Creation of common clones
Three types of clone are now created combining some of the attributes
In the following example, `data` is an map specifying values for a clone (locus, segments, number of reads, ...).
* `Constant` clone: actual individual clones,
described into an item of the `clones` list in the `.vidjil` file
```javascript
// Constant
new Clone(data, model, index, C_SIZE_CONSTANT | C_CLUSTERIZABLE | C_INTERACTABLE | C_IN_SCATTERPLOT);
```
* `Other`, or smaller clones: corresponding to the sum of each clones of a given locus, with size dynamically computed to take into account the current filter and viewable constant clones.
```javascript
// Other
new Clone(data, model, index, C_SIZE_OTHER);
```
* `Distribution` clones correspond to `distributions` lists of the `.vidjil` file.
See "distributions" in `vidjil-format.md`.
They are aggregate information on clones that won't be shown individually in the client,
and are useful to display views such a "simulated Genescan".
They are generated by `model.loadAllDistribClones()`, that agregates such data for each sample.
```javascript
// Distributions
new Clone(data, model, index, C_SIZE_DISTRIB | C_INTERACTABLE | C_IN_SCATTERPLOT );
```
## Integrating the client
......
......@@ -385,6 +385,19 @@ Distributions can be on several axes, like both V/J (here seg3/seg5).
}
```
Distributions from a `.vidjil` files can be computed by `tools/fuse.py`,
giving the desired list of distributions
through the `-d` option. For the above example, run:
```bash
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.
## `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