Commit 45bcbe45 authored by Tatiana Rocher's avatar Tatiana Rocher
Browse files

separate .align of .vidjil in 2 lines

parent 224a5c2f
......@@ -203,6 +203,22 @@ string KmerAffectAnalyser::toString() const{
return kmer;
}
string KmerAffectAnalyser::toStringValues() const{
string kmer;
for (size_t i = 0; i < affectations.size(); i++) {
kmer += affectations[i].toStringValues();
}
return kmer;
}
string KmerAffectAnalyser::toStringSigns() const{
string kmer;
for (size_t i = 0; i < affectations.size(); i++) {
kmer += affectations[i].toStringSigns();
}
return kmer;
}
/* CountKmerAffectAnalyser */
......
......@@ -176,6 +176,11 @@ class KmerAffectAnalyser: public AffectAnalyser {
int last(const KmerAffect &affect) const ;
string toString() const;
string toStringValues() const;
string toStringSigns() const;
};
/**
......
......@@ -61,6 +61,18 @@ string toString(const affect_t &a) {
result += string(1,affect_char(a));
return result;
}
string toStringValues(const affect_t &a){
return string(1,affect_char(a));
}
string toStringSigns(const affect_t &a){
if((a == AFFECT_UNKNOWN) || (a == AFFECT_AMBIGUOUS))
return " ";
else
return (affect_strand(a)==1 ? "+" : "-");
}
ostream &operator<<(ostream &os, const affect_t &a) {
os << toString(a);
return os;
......@@ -148,6 +160,15 @@ string KmerAffect::toString() const {
return ::toString(affect);
}
string KmerAffect::toStringValues() const {
return ::toStringValues(affect);
}
string KmerAffect::toStringSigns() const {
return ::toStringSigns(affect);
}
bool operator==(const KmerAffect &a1, const KmerAffect &a2) {
return a1.affect == a2.affect;
}
......
......@@ -42,6 +42,9 @@ bool operator<=(const affect_t &a1, const affect_t &a2);
bool operator>=(const affect_t &a1, const affect_t &a2);
bool operator!=(const affect_t &a1, const affect_t &a2);
string toString(const affect_t &a);
string toStringValues(const affect_t &a);
string toStringSigns(const affect_t &a);
ostream &operator<<(ostream &os, const affect_t &a);
......@@ -133,6 +136,8 @@ public:
bool isUnknown() const;
string toString() const;
string toStringValues()const;
string toStringSigns() const;
};
......
......@@ -902,15 +902,24 @@ JsonList FineSegmenter::toJsonList(Germline *germline){
seg.add("cdr3", *json_cdr);
}
JsonList *json_affect;
json_affect=new JsonList();
json_affect->add("start", 0);
json_affect->add("stop", sequence.size()); /// longueur sequence
json_affect->add("seq", kseg->getKmerAffectAnalyser()->toString());
seg.add("affect", *json_affect);
int sequenceSize = sequence.size();
JsonList *json_affectValues;
json_affectValues=new JsonList();
json_affectValues->add("start", 0);
json_affectValues->add("stop", sequenceSize);
json_affectValues->add("seqValues", kseg->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("seqSigns", kseg->getKmerAffectAnalyser()->toStringSigns());
seg.add("affectSigns", *json_affectSigns);
result.add("seg", seg);
}
return result;
......
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