Пример #1
0
bool gt_Enumcodeatposition_filledqgramcodestopatmax(
                                        GtCodetype *code,
                                        const Enumcodeatposition *ecp,
                                        unsigned int prefixindex,
                                        unsigned long pos,
                                        GtCodetype stopcode)
{
  GtCodetype tmpcode;
  unsigned int idx;
  GtUchar cc;

  gt_assert(prefixindex > 0 && prefixindex < ecp->prefixlength);
  tmpcode = ecp->filltable[prefixindex];
  if (tmpcode > stopcode)
  {
    return false;
  }
  for (idx=0; idx<prefixindex; idx++)
  {
    gt_assert((unsigned long) (pos + idx) < ecp->totallength);
    cc = gt_encseq_get_encoded_char_nospecial(ecp->encseq,
                                              pos + idx,
                                              ecp->readmode);
    gt_assert(ISNOTSPECIAL(cc));
    tmpcode += ecp->multimappower[idx][cc];
    if (tmpcode > stopcode)
    {
      return false;
    }
  }
  *code = tmpcode;
  return true;
}
Пример #2
0
static void checkifsequenceisthere(const GtEncseq *encseq,
                                   unsigned long witnessposition,
                                   unsigned long gmatchlength,
                                   const GtUchar *qptr)
{
    unsigned long i;
    GtUchar cc;

    for (i=0; i<gmatchlength; i++)
    {
        cc = gt_encseq_get_encoded_char_nospecial(encseq,
                witnessposition+i,
                GT_READMODE_FORWARD);
        if (qptr[i] != cc)
        {
            fprintf(stderr,"sequence of length %lu at witnesspos %lu"
                    " query[%lu] = %u != %u = subject[%lu]\n",
                    gmatchlength,
                    witnessposition,
                    i,
                    (unsigned int) qptr[i],
                    (unsigned int) cc,
                    witnessposition+(unsigned long) i);
            exit(GT_EXIT_PROGRAMMING_ERROR);
        }
    }
}
Пример #3
0
GtCodetype gt_Enumcodeatposition_filledqgramcode(const Enumcodeatposition *ecp,
                                                 unsigned int prefixindex,
                                                 unsigned long pos)
{
  GtCodetype code;
  unsigned int idx;
  GtUchar cc;

  gt_assert(prefixindex > 0 && prefixindex < ecp->prefixlength);
  code = ecp->filltable[prefixindex];
  for (idx=0; idx<prefixindex; idx++)
  {
    gt_assert((unsigned long) (pos + idx) < ecp->totallength);
    cc = gt_encseq_get_encoded_char_nospecial(ecp->encseq,
                                              pos + idx,
                                              ecp->readmode);
    gt_assert(ISNOTSPECIAL(cc));
    code += ecp->multimappower[idx][cc];
  }
  return code;
}