Exemplo n.º 1
0
 ITERATE ( TRanges, it, m_Ranges ) {
     if ( it != m_Ranges.begin() ) {
         out << ',';
     }
     TRange range = it->second.GetTotalRange();
     out << it->first.AsString();
     if ( range != TRange::GetWhole() ) {
         out << "(" << range.GetFrom() << "-" << range.GetTo() << ")";
     }
 }
Exemplo n.º 2
0
/// Update the extent of a sequence that figures into its self
/// score, based upon the sequence ranges of a pairwise alignment
/// @param seq1 The current sequence range [in/out]
/// @param align1 The range of the current alignment on sequence 1
/// @param seq1_length Length of sequence 1
/// @param align2 The range of the current alignment on sequence 2
/// @param seq2_length Length of sequence 2
///
static void
x_UpdateRanges(TRange& seq1,
               TRange align1,
               int seq1_length,
               TRange align2,
               int seq2_length)
{
    // extend the alignment bounds to the left and right
    // until one sequence runs out.

    TOffset first = min(seq1.GetFrom(), align1.GetFrom() - align2.GetFrom());
    first = max(first, 0);

    TOffset second = max(seq1.GetTo(), 
                      align1.GetTo() + (seq2_length - 1 - align2.GetTo()));
    second = min(second, seq1_length - 1);

    seq1.Set(first, second);
}