bayehem/rsem/detonate-1.11/ref-eval/test_re_kc.cpp
BOOST_AUTO_TEST_CASE(example_from_oases_mouse_chr1_cc_0_reverse_complemented)
{
  const char *seq = "CTAAGTTGCTTTTTCNTGACACCCCCAACTTACACATAAATTTAGTTATGTTTCTCATTGCTTTGCCCCTCCCCCCCCCATAACCTAGGTATACGAGGACATACCGGAGACCCCTAACACACACCCAGACAAGTAACTGTTAT";
  size_t k = 76;
  size_t len = strlen(seq);
  const char *end = seq + len + 1 - k;
  size_t after_N = 0;
  for (size_t i = 0; i < len; ++i) {
    if (seq[i] == 'N') {
      after_N = i + 1;
      break;
    }
  }
  // Check, assuming that we're at the beginning (each time).
  for (size_t i = 0; i + k - 1 < len; ++i) {
    if (i <= after_N)
      BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, true), seq + after_N);
    else
      BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, true), seq + i);
  }
  // Check, assuming that we are not at the beginning (each time).
  for (size_t i = 0; i + k - 1 < len; ++i)
    BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, false), seq + i);
}
// There is only one N in this sequence, and it occurs within the first 76
// bases of the sequence. So (assuming we're at the beginning of the sequence),
// skip_Ns should skip past that N, and from then on it should return the
// current position. (If we are not at the beginning of the sequence, then that
// N could not exist inside the first 76 bases of the sequence, so skip_Ns will
// ignore it.)
There is only one N in this sequence, and it occurs within the first 76
bases of the sequence. So (assuming we're at the beginning of the sequence),
skip_Ns should skip past that N, and from then on it should return the
current position. (If we are not at the beginning of the sequence, then that
N could not exist inside the first 76 bases of the sequence, so skip_Ns will
ignore it.)
There is only one N in this sequence and it occurs within the first 76 bases of the sequence . So ( assuming we ' re at the beginning of the sequence ) skip_Ns should skip past that N and from then on it should return the current position . ( If we are not at the beginning of the sequence then that N could not exist inside the first 76 bases of the sequence so skip_Ns will ignore it . )
BOOST_AUTO_TEST_CASE(example_from_oases_mouse_chr1_cc_0_reverse_complemented)
{
  const char *seq = "CTAAGTTGCTTTTTCNTGACACCCCCAACTTACACATAAATTTAGTTATGTTTCTCATTGCTTTGCCCCTCCCCCCCCCATAACCTAGGTATACGAGGACATACCGGAGACCCCTAACACACACCCAGACAAGTAACTGTTAT";
  size_t k = 76;
  size_t len = strlen(seq);
  const char *end = seq + len + 1 - k;
  size_t after_N = 0;
  for (size_t i = 0; i < len; ++i) {
    if (seq[i] == 'N') {
      after_N = i + 1;
      break;
    }
  }
  for (size_t i = 0; i + k - 1 < len; ++i) {
    if (i <= after_N)
      BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, true), seq + after_N);
    else
      BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, true), seq + i);
  }
  for (size_t i = 0; i + k - 1 < len; ++i)
    BOOST_CHECK_EQUAL(skip_Ns(seq + i, end, k, false), seq + i);
}
BOOST_AUTO_TEST_CASE ( example_from_oases_mouse_chr1_cc_0_reverse_complemented ) { const char * seq = " " ; size_t k = 76 ; size_t len = strlen ( seq ) ; const char * end = seq + len + 1 - k ; size_t after_N = 0 ; for ( size_t i = 0 ; i < len ; ++ i ) { if ( seq [ i ] == ' ' ) { after_N = i + 1 ; break ; } } for ( size_t i = 0 ; i + k - 1 < len ; ++ i ) { if ( i <= after_N ) BOOST_CHECK_EQUAL ( skip_Ns ( seq + i , end , k , true ) , seq + after_N ) ; else BOOST_CHECK_EQUAL ( skip_Ns ( seq + i , end , k , true ) , seq + i ) ; } for ( size_t i = 0 ; i + k - 1 < len ; ++ i ) BOOST_CHECK_EQUAL ( skip_Ns ( seq + i , end , k , false ) , seq + i ) ; }
There is only one N in this sequence, and it occurs within the first 76
bases of the sequence.
There is only one N in this sequence and it occurs within the first 76 bases of the sequence .
// Check, assuming that we're at the beginning (each time). // Check, assuming that we are not at the beginning (each time).