Commit c0ae904b authored by flothoni's avatar flothoni

clone & model; minor refactoring + bikehedding

Rename variable
Delete useless function without any call
Link to #4347
parent f007d2de
Pipeline #151760 passed with stages
in 17 minutes and 1 second
......@@ -725,23 +725,6 @@ Clone.prototype = {
},
/**
* Return true if the clone share the same axes than the given distribution clone
* @return {Clone} dclone A distributon clone to compare with
* @return {Array} dvalues A list of values for
* @return {Boolean} True if share the same axes
*/
sameAsDistribClone: function(dclone, dvalues, t){
var axes = dclone.axes
var values = this.getDistributionsValues(axes, t, round=true)
if (dvalues.equals(values)){
return true
}
return false
},
/**
* 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
......@@ -755,8 +738,8 @@ Clone.prototype = {
var axes = this.axes
var dvalues = this.getDistributionsValues(axes, 0, round=true)
for (var timepoint = 0; timepoint < nb_sample; timepoint++) {
if (this.m.distribs[axes][timepoint][dvalues] != undefined){
this.lst_compatible_clones[timepoint] = this.m.distribs[axes][timepoint][dvalues]
if (this.m.distribs_compatible_clones[axes][timepoint][dvalues] != undefined){
this.lst_compatible_clones[timepoint] = this.m.distribs_compatible_clones[axes][timepoint][dvalues]
} else {
this.lst_compatible_clones[timepoint] = []
}
......
......@@ -3130,19 +3130,19 @@ changeAlleleNotation: function(alleleNotation) {
var same_distribs;
var current_distrib;
this.distribs = {}
this.distribs_compatible_clones = {}
for (var pos_axes = 0; pos_axes < raw_distribs_axes.length; pos_axes++) {
var axes = raw_distribs_axes[pos_axes]
this.distribs[axes] = []
this.distribs_compatible_clones[axes] = []
for (var sample = 0; sample < this.samples.number; sample++) {
this.distribs[axes][sample] = {}
this.distribs_compatible_clones[axes][sample] = {}
for (var c_pos = 0; c_pos < this.clones.length; c_pos++) {
values = this.clones[c_pos].getDistributionsValues(axes, sample)
if (typeof this.distribs[axes][sample][values] != typeof []){ // equivalent python defaultdict
this.distribs[axes][sample][values] = []
if (typeof this.distribs_compatible_clones[axes][sample][values] != typeof []){ // equivalent python defaultdict
this.distribs_compatible_clones[axes][sample][values] = []
}
this.distribs[axes][sample][values].push(this.clones[c_pos].index)
this.distribs_compatible_clones[axes][sample][values].push(this.clones[c_pos].index)
}
}
......@@ -3169,22 +3169,6 @@ changeAlleleNotation: function(alleleNotation) {
},
/**
* Return the clone corresponding to an axes list and to axes values
* !!!! pas utilisé pour le moment !!!
* @param {Array} axes List of axes to search
* @param {Array} values List of values to get
* @return {Clone} [description]
*/
getCloneWithDistribValues: function(axes, values){
for (var c = 0; c < this.clones.length; c++) {
var clone = this.clones[c]
if (clone.sameAsDistribClone()){
return clone
}
}
return
},
/**
* Create clones from a list of information concatenated directly from distributions
......
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