Changeset 3334


Ignore:
Timestamp:
Oct 23, 2014, 3:26:35 PM (7 years ago)
Author:
Peter
Message:

Avoid stopping at position one passed a pile, instead fast forward to
next locus with coverage.

refs #806

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/Pileup.h

    r3333 r3334  
    5757
    5858      /**
    59          Create an Entry with read \a b
     59         Create an Entry with read \a b. Entry is initialized to point
     60         to first aligned base (b.pos()).
    6061       */
    6162      Entry(const BamRead& b);
     
    144145
    145146    /**
    146        Create a Pileup that will use reads in range [first, last)
     147       Create a Pileup that will use reads in range [first, last). The
     148       range must be sorted as defined by BamLessPos.
     149
     150       Iterator is a \readable_iterator.
    147151     */
    148152    Pileup(Iterator first, Iterator last);
     
    169173
    170174    /**
    171        \brief step to next position with coverage
     175       \brief step to next position.
     176
     177       If any Entry has a insertion at current position, increment
     178       each Entry that has an insertion. Otherwise increment to next
     179       position and update each Entry accordingly.
    172180     */
    173181    void increment(void);
     
    238246  void Pileup<Iterator>::increment(void)
    239247  {
    240     if (data_.empty()) {
    241       if (bam_==bam_end_)
    242         return;
    243       tid_ = bam_->core().tid;
    244       pos_ = bam_->core().pos;
    245     }
    246     else {
    247 
     248    if (!data_.empty()) {
    248249      // in insertion
    249250      if (skip_ref()) {
     
    281282    }
    282283
     284
     285    // fast forward to next covered locus
     286    if (data_.empty()) {
     287      if (bam_==bam_end_)
     288        return;
     289      tid_ = bam_->core().tid;
     290      pos_ = bam_->core().pos;
     291    }
     292
    283293    // read data
    284294    while (bam_!=bam_end_ && bam_->core().tid==tid_ && bam_->pos()<=pos_) {
Note: See TracChangeset for help on using the changeset viewer.