Changeset 3026


Ignore:
Timestamp:
Apr 6, 2013, 9:31:02 AM (9 years ago)
Author:
Peter
Message:

add function to modify a base quality (BamRead?). refs #746

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/bam.cc

    r2987 r3026  
    129129                << " expected " << 8 << "\n";
    130130  }
     131  uint8_t q = bam.qual(24);
     132  if (q != 72) {
     133    suite.add(false);
     134    suite.err() << "error: quality: " << static_cast<int>(q)
     135                << " expected " << 72 << "\n";
     136  }
     137  uint8_t new_q = 60;
     138  bam.qual(24, new_q);
     139  q = bam.qual(24);
     140  if (q != new_q) {
     141    suite.add(false);
     142    suite.err() << "error: quality: " << static_cast<int>(q)
     143                << " expected " << new_q << "\n";
     144  }
    131145  test_cigar(suite, bam, in.header());
    132146}
  • trunk/yat/omic/BamRead.cc

    r2993 r3026  
    166166
    167167
     168  void BamRead::qual(size_t i, uint8_t q)
     169  { *(bam1_qual(bam_)+i)=q; }
     170
     171
    168172  std::string BamRead::sequence(void) const
    169173  {
  • trunk/yat/omic/BamRead.h

    r2993 r3026  
    172172
    173173    /**
     174       \brief set quality of a base
     175
     176       \param i base to modify
     177       \param q new quality
     178
     179       \since New in yat 0.11
     180     */
     181    void qual(size_t i, uint8_t q);
     182
     183    /**
    174184       \return query name
    175185
     
    228238
    229239       \see bam_nt16_table
     240
     241       \since New in yat 0.11
    230242     */
    231243    void sequence(size_t i, uint8_t x);
Note: See TracChangeset for help on using the changeset viewer.