Commit 83128cad authored by Marc Duez's avatar Marc Duez

json output : remove gene list

parent f9dba681
......@@ -727,25 +727,17 @@ JsonList FineSegmenter::toJsonList(Germline *germline){
result.add("name", code_short);
JsonList seg;
// TODO: what is going on if some list is smaller than JSON_REMEMBER_BEST ?
JsonArray jsonV;
for (int i=0; i<JSON_REMEMBER_BEST; i++) jsonV.add( germline->rep_5.label(score_V[i].second) ) ;
seg.add("5", jsonV);
seg.add("5", germline->rep_5.label(best_V));
seg.add("5start", 0);
seg.add("5end", Vend);
if (score_D.size()>0){
JsonArray jsonD;
for (int i=0; i<JSON_REMEMBER_BEST; i++) jsonD.add( germline->rep_4.label(score_D[i].second) ) ;
result.add("4", jsonD);
seg.add("4", germline->rep_4.label(best_D));
result.add("4start", Dstart);
result.add("4end", Dend);
}
JsonArray jsonJ;
for (int i=0; i<JSON_REMEMBER_BEST; i++) jsonJ.add( germline->rep_3.label(score_J[i].second) ) ;
seg.add("3", jsonJ);
seg.add("3", germline->rep_3.label(best_J));
seg.add("3start", Jstart);
result.add("seg", seg);
......
......@@ -956,10 +956,6 @@ int main (int argc, char **argv)
// || ((clone_nb_reads >= min_reads_clone)
// && (clone_nb_reads * 100.0 / nb_segmented >= ratio_reads_clone)))
windowsStorage->sort();
list<pair <junction, int> > sort_clones = windowsStorage->getSortedList();
cout << " ==> " << sort_clones.size() << " clones" << endl ;
if (sort_clones.size() == 0)
{
cout << " ! No clones with current parameters." << endl;
......
......@@ -72,10 +72,10 @@ Axis.prototype = {
var clone = self.m.clone(cloneID)
if (typeof clone.seg != "undefined"
&& typeof clone.seg[type2] != "undefined"
&& typeof gene_list[clone.seg[type2][0].split("*")[0]] != "undefined")
&& typeof gene_list[clone.seg[type2].split("*")[0]] != "undefined")
{
var allele = clone.seg[type2][0]
var gene = clone.seg[type2][0].split("*")[0]
var allele = clone.seg[type2]
var gene = clone.seg[type2].split("*")[0]
var pos = ((gene_list[gene].rank+0.5)/(total_gene+1))
if (displayAllele){
......
......@@ -136,9 +136,9 @@ Clone.prototype = {
withAllele = typeof withAllele !== 'undefined' ? withAllele : true;
if (typeof (this.seg) != 'undefined' && typeof (this.seg["5"]) != 'undefined') {
if (withAllele) {
return this.seg["5"][0]
return this.seg["5"]
}else{
return this.seg["5"][0].split('*')[0];
return this.seg["5"].split('*')[0];
}
}
return "undefined V";
......@@ -148,9 +148,9 @@ Clone.prototype = {
withAllele = typeof withAllele !== 'undefined' ? withAllele : true;
if (typeof (this.seg) != 'undefined' && typeof (this.seg["4"]) != 'undefined') {
if (withAllele) {
return this.seg["4"][0]
return this.seg["4"]
}else{
return this.seg["4"][0].split('*')[0];
return this.seg["4"].split('*')[0];
}
}
return "undefined D";
......@@ -160,9 +160,9 @@ Clone.prototype = {
withAllele = typeof withAllele !== 'undefined' ? withAllele : true;
if (typeof (this.seg) != 'undefined' && typeof (this.seg["3"]) != 'undefined') {
if (withAllele) {
return this.seg["3"][0]
return this.seg["3"]
}else{
return this.seg["3"][0].split('*')[0];
return this.seg["3"].split('*')[0];
}
}
return "undefined J";
......@@ -172,9 +172,9 @@ Clone.prototype = {
withAllele = typeof withAllele !== 'undefined' ? withAllele : true;
if (typeof (this.seg) != 'undefined' && typeof (this.seg[type]) != 'undefined') {
if (withAllele) {
return this.seg[type][0];
return this.seg[type];
}else{
return this.seg[type][0].split('*')[0];
return this.seg[type].split('*')[0];
}
}
return "undefined";
......
......@@ -59,7 +59,7 @@ Germline.prototype = {
if (typeof this.m.clone(i).seg != "undefined" &&
typeof this.m.clone(i).seg[type2] != "undefined"
){
var gene=this.m.clone(i).seg[type2][0];
var gene=this.m.clone(i).seg[type2];
if (this.m.system != "multi" || this.m.clone(i).getSystem() == system){
if ( typeof this.allele[gene] != "undefined"){
g[gene] = this.allele[gene]
......
......@@ -66,7 +66,7 @@ Model.prototype = {
reset: function () {
this.analysis = {
clones: [],
cluster: [],
clusters: [],
date: []
};
this.t = 0;
......@@ -233,8 +233,9 @@ Model.prototype = {
//copy .data file in model
for (var key in data){
self[key] = data[key]
if (key != "clusters") self[key] = data[key]
}
this.data_clusters = data.clusters;
//filter clones
self.clones = [];
......
......@@ -173,15 +173,15 @@ In the .analysis file, this section is intended to describe some specific clones
// positions are related to the 'sequence'
// names of V/D/J genes should match the ones in files referenced in germline/germline.data
{
"5": [],
"5": "IGHV5*01",
"5start": 0,
"5end": 0,
"4": [],
"4": "IGHD1*01",
"4start": 0,
"4end": 0,
"3": [],
"3": "IGHJ3*02",
"3start": 0,
"3end": 0,
}
......
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