Exemplo n.º 1
0
static void showifinlengthrange(const GtAlphabet *alphabet,
                                const GtUchar *start,
                                unsigned long gmatchlength,
                                unsigned long querystart,
                                unsigned long subjectpos,
                                void *info)
{
    Rangespecinfo *rangespecinfo = (Rangespecinfo *) info;

    if ((!rangespecinfo->minlength.defined ||
            gmatchlength >= rangespecinfo->minlength.valueunsignedlong) &&
            (!rangespecinfo->maxlength.defined ||
             gmatchlength <= rangespecinfo->maxlength.valueunsignedlong))
    {
        if (rangespecinfo->showquerypos)
        {
            printf("%lu ",querystart);
        }
        printf("%lu",gmatchlength);
        if (rangespecinfo->showsubjectpos)
        {
            printf(" %lu",subjectpos);
        }
        if (rangespecinfo->showsequence)
        {
            (void) putchar(' ');
            gt_alphabet_decode_seq_to_fp(alphabet,stdout,start + querystart,
                                         gmatchlength);
        }
        (void) putchar('\n');
    }
}
Exemplo n.º 2
0
static void mermatchoutput(const Tyrindex *tyrindex,
                           const Tyrcountinfo *tyrcountinfo,
                           const Tyrsearchinfo *tyrsearchinfo,
                           const GtUchar *result,
                           const GtUchar *query,
                           const GtUchar *qptr,
                           uint64_t unitnum,
                           bool forward)
{
  bool firstitem = true;
  unsigned long queryposition;

  queryposition = (unsigned long) (qptr-query);
  if (tyrsearchinfo->showmode & SHOWQSEQNUM)
  {
    printf(Formatuint64_t,PRINTuint64_tcast(unitnum));
    firstitem = false;
  }
  if (tyrsearchinfo->showmode & SHOWQPOS)
  {
    ADDTABULATOR;
    printf("%c%lu",forward ? '+' : '-',queryposition);
  }
  if (tyrsearchinfo->showmode & SHOWCOUNTS)
  {
    unsigned long mernumber = gt_tyrindex_ptr2number(tyrindex,result);
    ADDTABULATOR;
    printf("%lu",gt_tyrcountinfo_get(tyrcountinfo,mernumber));
  }
  if (tyrsearchinfo->showmode & SHOWSEQUENCE)
  {
    ADDTABULATOR;
    gt_alphabet_decode_seq_to_fp(tyrsearchinfo->dnaalpha,
                                 stdout,
                                 qptr,
                                 tyrsearchinfo->mersize);
  }
  if (tyrsearchinfo->showmode & (SHOWSEQUENCE | SHOWQPOS | SHOWCOUNTS))
  {
    (void) putchar('\n');
  }
}
Exemplo n.º 3
0
void gt_alphabet_printf_symbolstring(const GtAlphabet *alphabet,
                                     const GtUchar *w, unsigned long len)
{
  gt_alphabet_decode_seq_to_fp(alphabet, stdout, w, len);
}