vpc-ccg / svict

Structural Variation and fusion detection using targeted sequencing data from circulating cell free DNA
BSD 3-Clause "New" or "Revised" License
25 stars 6 forks source link

`if ( s1 <= s2 && e2 <= e2 )` is it typo or intended? #21

Closed Crispy13 closed 5 months ago

Crispy13 commented 5 months ago

annotation.cc:43

uint32_t overlap_l( const uint32_t &s1, const uint32_t &e1, const uint32_t &s2, const uint32_t &e2)
{
    uint32_t l = 0;
    if ( s1 <= s2 && e2 <= e2 ) // <<<--- this sentence
    { l = e2 - s2 + 1;  }
    else if ( s2 <= s1 && e1 <= e2 )
    {   l = e1 - s1 + 1;    }
    else if ( s1 <= s2 && s2 <= e1)
    {   l = e1 - s2 + 1;    }
    else if ( s2 <= s1 && s1 <= e2)
    {   l = e2 - s1 + 1;    }
    return l;
}

The first if condition seems equal to just s1 <= s2 because e2 <= e2 is always true.

fhach commented 5 months ago

I think it is a typo and it should be e2<=e1. I just fixed.

Crispy13 commented 5 months ago

Thanks for response.

Will there be a new release?