Changeset 3356


Ignore:
Timestamp:
Nov 22, 2014, 2:34:04 PM (8 years ago)
Author:
Peter
Message:

refs #794. make test/pileup.cc compile with htslib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/pileup.cc

    r3327 r3356  
    4949
    5050#ifdef YAT_HAVE_LIBBAM
     51char seq_nt16(size_t x)
     52{
     53#if YAT_HAVE_HTSLIB
     54  return seq_nt16_str[x];
     55#elif HAVE_BAM_NT16_REV_TABLE
     56  return bam_nt16_rev_table[x];
     57#else
     58  std::string table = "=ACMGRSVTWYHKDBN";
     59  return table[c];
     60#endif
     61}
     62
    5163void test1(test::Suite& suite, const std::string& fn)
    5264{
     
    102114        continue;
    103115      }
    104       str += bam_nt16_rev_table[iter->sequence()];
     116      str += seq_nt16(iter->sequence());
    105117    }
    106118
     
    169181      if (i->bam().pos()!=reads[1].pos())
    170182        continue;
    171       char nt = bam_nt16_rev_table[i->sequence()];
     183      char nt = seq_nt16(i->sequence());
    172184      if (nt != ref[plp.pos()-reads[0].pos()]) {
    173185        error << "'" << nt << "' not equal '"
     
    196208      ++count;
    197209      suite.err() << count << "\n";
    198       char nt = bam_nt16_rev_table[i->sequence()];
     210      char nt = seq_nt16(i->sequence());
    199211      if (nt != reads[1].sequence()[count-1])
    200212        error << "nt: " << nt << " not as expected. count: " << count << "\n";
     
    239251        continue;
    240252      ++count;
    241       char nt = bam_nt16_rev_table[i->sequence()];
     253      char nt = seq_nt16(i->sequence());
    242254      if (plp.pos() != reads[1].pos()+count-1)
    243255        error << "count: " << count << " with pos: " << plp.pos() << "\n";
     
    281293        continue;
    282294      ++count;
    283       char nt = bam_nt16_rev_table[i->sequence()];
     295      char nt = seq_nt16(i->sequence());
    284296      if (plp.skip_ref())
    285297        error << count << " unexpected skip_ref\n";
Note: See TracChangeset for help on using the changeset viewer.