Commit 8f4a3f8b authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.{h,cpp}: extract AlignBox.Cover{First,Last}Pos

parent 6cc56e3d
......@@ -81,18 +81,28 @@ string AlignBox::getSequence(string sequence) {
return sequence.substr(start, end-start+1);
}
bool AlignBox::CoverFirstPos()
{
return (start <= 0);
}
bool AlignBox::CoverLastPos()
{
return (end >= seq_length - 1);
}
void AlignBox::addToOutput(CloneOutput *clone, int alternative_genes) {
json j;
j["name"] = ref_label;
if (key != "3" || end < seq_length - 1) // end information for J
if (key != "3" || !CoverLastPos()) // end information for J
{
j["stop"] = end + 1;
j["delRight"] = del_right;
}
if (key != "5" || start > 0) // start information for V
if (key != "5" || !CoverFirstPos()) // start information for V
{
j["start"] = start + 1;
j["delLeft"] = del_left;
......
......@@ -132,6 +132,12 @@ class AlignBox
*/
int getLength();
/**
* Return whether the box cover the first/last position od the reference sequence
*/
bool CoverFirstPos();
bool CoverLastPos();
/**
* Returns the position in the reference string corresponding to the position in the read
* Preliminary implementation, only works for the start of V and J 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