Changeset 3175


Ignore:
Timestamp:
Mar 15, 2014, 9:15:51 AM (8 years ago)
Author:
Peter
Message:

new class BamPair?. refs #784

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/bam_pair_analyse.cc

    r3114 r3175  
    7373  Counter counter;
    7474  bam_pair_analyse(iter, end, counter);
    75   suite.out() << counter.n_ << "\n";
    76   suite.add(counter.n_==395);
     75  if (!suite.add(counter.n_==395))
     76    suite.err() << "n: " << counter.n_ << "; expected 395\n";
    7777  is.close();
    7878}
  • trunk/yat/omic/BamPairIterator.h

    r3174 r3175  
    2525#include <iostream>
    2626
     27#include "BamPair.h"
    2728#include "BamRead.h"
    2829
     
    5960  class BamPairIterator
    6061    : public boost::iterator_facade<
    61     BamPairIterator<Base>, const std::pair<BamRead, BamRead>,
    62     std::input_iterator_tag
     62    BamPairIterator<Base>, const BamPair, std::input_iterator_tag
    6363    >
    6464  {
     
    8181    Base iter_;
    8282    Base end_;
    83     std::pair<BamRead, BamRead> x_;
     83    BamPair x_;
    8484    boost::shared_ptr<std::map<std::string, BamRead> > siam_reads_;
    8585    typedef std::pair<int32_t, int32_t> Position;
     
    8787    friend class boost::iterator_core_access;
    8888
    89     const std::pair<BamRead, BamRead>& dereference(void) const;
     89    const BamPair& dereference(void) const;
    9090    bool equal(const BamPairIterator& other) const;
    9191    void increment(void);
     
    143143
    144144  template<typename Base>
    145   const std::pair<BamRead, BamRead>&
     145  const BamPair&
    146146  BamPairIterator<Base>::dereference(void) const
    147147  {
     
    189189        for (; lower!=reads_->end() && lower->first == position; ++lower)
    190190          if (same_query_name(lower->second, *iter_)) {
    191             x_.first = lower->second;
    192             x_.second = *iter_;
     191            x_.first() = lower->second;
     192            x_.second() = *iter_;
    193193            return;
    194194          }
     
    199199          mate = siam_reads_->lower_bound(iter_->name());
    200200        if (mate!=siam_reads_->end() && same_query_name(mate->second, *iter_)) {
    201           x_.first = mate->second;
    202           x_.second = *iter_;
     201          x_.first() = mate->second;
     202          x_.second() = *iter_;
    203203          return;
    204204        }
  • trunk/yat/omic/Makefile.am

    r3173 r3175  
    2121yat_libyat_la_SOURCES += yat/omic/BamFile.cc
    2222yat_libyat_la_SOURCES += yat/omic/BamHeader.cc
     23yat_libyat_la_SOURCES += yat/omic/BamPair.cc
    2324yat_libyat_la_SOURCES += yat/omic/BamRead.cc
    2425yat_libyat_la_SOURCES += yat/omic/BamReadFilter.cc
     
    3637nobase_include_HEADERS += $(srcdir)/yat/omic/BamFile.h
    3738nobase_include_HEADERS += $(srcdir)/yat/omic/BamHeader.h
     39nobase_include_HEADERS += $(srcdir)/yat/omic/BamPair.h
    3840nobase_include_HEADERS += $(srcdir)/yat/omic/BamPairIterator.h
    3941nobase_include_HEADERS += $(srcdir)/yat/omic/BamRead.h
  • trunk/yat/omic/algorithm.h

    r3173 r3175  
    6363    BamPairIterator<Iterator> end(last, last);
    6464    for (; iter!=end; ++iter)
    65       visitor(iter->first, iter->second);
     65      visitor(iter->first(), iter->second());
    6666  }
    6767
Note: See TracChangeset for help on using the changeset viewer.