Changeset 3355


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

refs #794. implement BamRead::end() and BamRead::sequence() correctly (not using our ref impl) when having htslib.

Location:
trunk/yat/omic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamRead.cc

    r3351 r3355  
    141141
    142142
     143#ifndef YAT_HAVE_HTSLIB
    143144  uint32_t BamRead::calend(const bam1_core_t *c, const uint32_t *cigar) const
    144145  {
     
    169170    return end;
    170171  }
     172#endif
    171173
    172174
     
    277279  {
    278280    assert(bam_);
     281#if YAT_HAVE_HTSLIB
     282    return bam_endpos(bam_);
     283#else
    279284    return this->calend(&core(), bam1_cigar(bam_));
     285#endif
    280286  }
    281287
     
    334340  {
    335341    std::string result(sequence_length(), ' ');
    336 #if HAVE_BAM_NT16_REV_TABLE
     342#if YAT_HAVE_HTSLIB
     343    for (size_t i=0; i<result.size(); ++i)
     344      result[i] = seq_nt16_str[sequence(i)];
     345#elif HAVE_BAM_NT16_REV_TABLE
    337346    for (size_t i=0; i<result.size(); ++i)
    338347      result[i] = bam_nt16_rev_table[sequence(i)];
  • trunk/yat/omic/BamRead.h

    r3351 r3355  
    309309    friend class OutBamFile;
    310310    friend class BamReadIterator;
     311#ifndef YAT_HAVE_HTSLIB
    311312    uint32_t calend(const bam1_core_t *c, const uint32_t *cigar) const;
     313#endif
    312314    // access data length, current length of data
    313315    int& data_size(void);
Note: See TracChangeset for help on using the changeset viewer.