Commit 297b81e2 authored by Marc Duez's avatar Marc Duez

remove useless code (replaced by json c++11 lib)

parent d5af17bb
......@@ -978,33 +978,6 @@ void FineSegmenter::findCDR3(){
}
void FineSegmenter::toJsonList(JsonList *seg){
if (isSegmented()) {
seg->add("5", segmented_germline->rep_5.label(best_V));
seg->add("5start", 0);
seg->add("5end", Vend);
if (score_D.size()>0){
seg->add("4", segmented_germline->rep_4.label(best_D));
seg->add("4start", Dstart);
seg->add("4end", Dend);
}
seg->add("3", segmented_germline->rep_3.label(best_J));
seg->add("3start", Jstart);
if (CDR3start >= 0)
{
JsonList *json_cdr;
json_cdr=new JsonList();
json_cdr->add("start", CDR3start);
json_cdr->add("stop", CDR3end);
seg->add("cdr3", *json_cdr);
}
}
}
json FineSegmenter::toJson(){
json seg;
......@@ -1033,36 +1006,6 @@ json FineSegmenter::toJson(){
return seg;
}
void KmerSegmenter::toJsonList(JsonList *seg)
{
int sequenceSize = sequence.size();
if (evalue > NO_LIMIT_VALUE)
seg->add("_evalue", scientific_string_of_double(evalue));
if (evalue_left > NO_LIMIT_VALUE)
seg->add("_evalue_left", scientific_string_of_double(evalue_left));
if (evalue_right > NO_LIMIT_VALUE)
seg->add("_evalue_right", scientific_string_of_double(evalue_right));
JsonList *json_affectValues;
json_affectValues=new JsonList();
json_affectValues->add("start", 0);
json_affectValues->add("stop", sequenceSize);
json_affectValues->add("seq", getKmerAffectAnalyser()->toStringValues());
seg->add("affectValues", *json_affectValues);
JsonList *json_affectSigns;
json_affectSigns=new JsonList();
json_affectSigns->add("start", 0);
json_affectSigns->add("stop", sequenceSize);
json_affectSigns->add("seq", getKmerAffectAnalyser()->toStringSigns());
seg->add("affectSigns", *json_affectSigns);
delete json_affectValues;
delete json_affectSigns;
}
json KmerSegmenter::toJson() {
json seg;
int sequenceSize = sequence.size();
......
......@@ -10,7 +10,6 @@
#include "kmerstore.h"
#include "kmeraffect.h"
#include "affectanalyser.h"
#include "json.h"
#include "../lib/json.hpp"
#define EXTEND_D_ZONE 5
......@@ -196,7 +195,6 @@ class KmerSegmenter : public Segmenter
KmerAffectAnalyser *getKmerAffectAnalyser() const;
string getInfoLineWithAffects() const;
void toJsonList(JsonList *seg);
json toJson();
private:
......@@ -247,7 +245,6 @@ class FineSegmenter : public Segmenter
void FineSegmentD(Germline *germline);
void findCDR3();
void toJsonList(JsonList *seg);
json toJson();
};
......
#include <iostream>
#include <string>
#include "tools.h"
#include "json.h"
#include "windows.h"
#include "representative.h"
#include "sequenceSampler.h"
#include "segment.h"
#include "json.h"
WindowsStorage::WindowsStorage(map<string, string> &labels)
:windows_labels(labels),max_reads_per_window(~0),nb_bins(NB_BINS),max_value_bins(MAX_VALUE_BINS) {}
......@@ -217,38 +215,6 @@ ostream &WindowsStorage::printSortedWindows(ostream &os) {
return os;
}
JsonArray WindowsStorage::sortedWindowsToJsonArray(map <junction, JsonList> json_data_segment) {
JsonArray windowsArray;
int top = 1;
for (list<pair <junction, size_t> >::const_iterator it = sort_all_windows.begin();
it != sort_all_windows.end(); ++it)
{
JsonList windowsList;
JsonArray json_reads;
JsonArray json_seg;
json_reads.add(it->second);
if (json_data_segment.find(it->first) != json_data_segment.end()){
windowsList.concat(json_data_segment[it->first]);
}else{
windowsList.add("sequence", 0); //TODO need to compute representative sequence for this case
}
windowsList.add("id", it->first);
windowsList.add("reads", json_reads);
windowsList.add("top", top++);
//windowsList.add("id", this->getId(it->first));
//JsonList seg_stat = this->statusToJson(it->first);
//json_seg.add(seg_stat);
windowsList.add("germline", germline_by_window[it->first]->code);
windowsList.add("seg_stat", json_seg);
windowsArray.add(windowsList);
}
return windowsArray;
}
json WindowsStorage::sortedWindowsToJson(map <junction, json> json_data_segment) {
json windowsArray;
int top = 1;
......
......@@ -15,7 +15,6 @@
#include <utility>
#include <string>
#include "fasta.h"
#include "json.h"
#include "segment.h"
#include "germline.h"
#include "read_storage.h"
......@@ -211,8 +210,6 @@ class WindowsStorage {
* Print the windows from the most abundant to the least abundant
*/
ostream &printSortedWindows(ostream &os);
JsonArray sortedWindowsToJsonArray(map<junction, JsonList> json_data_segment);
json sortedWindowsToJson(map<junction, json> json_data_segment);
......
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