Commit 5b0a0833 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.{h,cpp}: AlignBox, ostream &operator<<

parent b311fa68
......@@ -46,6 +46,18 @@ string AlignBox::getSequence(string sequence) {
}
ostream &operator<<(ostream &out, const AlignBox &box)
{
out << "[/" << box.del_left << " " ;
out << "@" << box.start << " " ;
out << box.ref_label << "(" << box.ref_nb << ") " ;
out << "@" << box.end << " " ;
out << box.del_right << "/]" ;
return out ;
}
Segmenter::~Segmenter() {}
......@@ -621,14 +633,9 @@ bool comp_pair (pair<int,int> i,pair<int,int> j)
* @param reverse_ref: if true, reverse the reference sequences (VkVk)
* @param reverse_both: if true, reverse both the read and the reference sequences (J segment)
* @param local: if true, Local alignment (D segment), otherwise LocalEndWithSomeDeletions and onlyBottomTriangle (V and J segments)
* @param box: the AligBox to fill
* @param segment_cost: the cost used by the dynamic programing
* @return score: the maximized score, together with the following values:
* @return tag: - the name of the sequence
* @return del: - the number of deletions at the end of the reference sequence (or at the start if 'reverse_both')
* @return del2: - the number of deletions at the start of the reference sequence (used with 'local')
* @return begin: - the start position of the aligned segment in the read
* @return length: - the length of the alignmed segment in the read
* @return best_best_i: ?
* @post box is filled
*/
int align_against_collection(string &read, Fasta &rep, bool reverse_ref, bool reverse_both, bool local,
......
......@@ -68,6 +68,10 @@ const char* const segmented_mesg[] = { "?",
/**
* An alignment box (AlignBox) gather all parameters for a recombined gene segment (V, D, J, other D...)
**/
class AlignBox
{
public:
......@@ -76,16 +80,19 @@ class AlignBox
int end;
int del_right;
AlignBox();
string getSequence(string sequence);
/* Identifier, label and sequence of the reference sequence (the best one) */
int ref_nb;
string ref_label;
string ref;
vector<pair<int, int> > score;
string getSequence(string sequence);
AlignBox();
/* Identifiers and scores of other possible reference sequence */
vector<pair<int, int> > score;
};
ostream &operator<<(ostream &out, const AlignBox &box);
/**
* Check whether there is an overlap between two boxes,
......
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