Changeset 3222


Ignore:
Timestamp:
May 7, 2014, 5:37:33 AM (9 years ago)
Author:
Peter
Message:

prefer tp declare functions alphabetically. Implement BamRead::flag(void) which fixes #792

Location:
branches/0.12-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.12-stable/test/bam.cc

    r3221 r3222  
    5656  suite.out() << "size: " << size << " " << bam.aux_size() << "\n";
    5757  suite.add(bam.aux_size() == size+4);
     58  bam.aux();
    5859  bam.aux("ZZ");
    5960  char c1 = bam_aux2A(bam.aux("ZZ"));
     
    7071  BamRead bam(b);
    7172
     73  bam.cigar();
     74  bam.cigar(0);
     75  bam.cigar_op(0);
     76  bam.cigar_oplen(0);
     77
    7278  suite.out() << "test cigar:\n";
    7379  suite.out() << bam.cigar_str() << "\n";
     
    227233  BamRead bam;
    228234  in.read(bam);
     235  // test that functions are implemented
     236  bam.end();
     237  bam.flag();
     238  bam.mpos();
     239  bam.mtid();
     240  bam.pos();
     241  bam.tid();
     242  bam.swap(bam);
    229243  std::string str = "AGCTTTGTTATTATTTGAGGGTGTGGTTCAGTTGTAAACAGTGTATG"
    230244    "TTTTAGAATTTGTGTTATTGTGATGGCGATGACCAAGTACAACATATTTCCCA";
  • branches/0.12-stable/yat/omic/BamRead.cc

    r3221 r3222  
    187187  { return bam_->core; }
    188188
     189
     190  uint16_t BamRead::flag(void) const
     191  {
     192    return bam_->core.flag;
     193  }
    189194
    190195  const char* BamRead::name(void) const
  • branches/0.12-stable/yat/omic/BamRead.h

    r3221 r3222  
    189189
    190190    /**
     191       \brief rightmost coordinate
     192
     193       Coordinate is 0-based, i.e., the end is one passed the last
     194       matching position.
     195
     196       \see bam_calend
     197     */
     198    int32_t end(void) const;
     199
     200    /**
     201       \brief bitwise flag
     202
     203       \see Preprocessor defines BAM_F*
     204
     205       \since implemented since yat 0.12
     206     */
     207    uint16_t flag(void) const;
     208
     209    /**
     210       \brief leftmost position for mate
     211     */
     212    int32_t mpos(void) const;
     213
     214    /**
     215       \brief Chromosome ID for mate
     216     */
     217    int32_t mtid(void) const;
     218
     219    /**
     220       \return query name
     221
     222       Length of array is described by core().l_qname
     223     */
     224    const char* name(void) const;
     225
     226    /**
     227       \brief modify name
     228
     229       \since New in yat 0.11
     230    */
     231    void name(const std::string& n);
     232
     233    /**
     234       \brief 0-based laftmost coordinate
     235     */
     236    int32_t pos(void) const;
     237
     238    /**
    191239       \return Quality of base \a i
    192240     */
     
    204252
    205253    /**
    206        \return query name
    207 
    208        Length of array is described by core().l_qname
    209      */
    210     const char* name(void) const;
    211 
    212     /**
    213        \brief modify name
    214 
    215        \since New in yat 0.11
    216     */
    217     void name(const std::string& n);
     254       Each character in returned sequence is either A, C, G, T, or N.
     255
     256       \return sequence
     257     */
     258    std::string sequence(void) const;
     259
     260    /**
     261       4-bit integer describing base \a index
     262
     263       \see bam_nt16_rev_table
     264     */
     265    uint8_t sequence(size_t index) const;
     266
     267    /**
     268       \brief modify a base in sequence
     269
     270       Set i-th base in sequence to \a x, where seq is a 4-bit integer.
     271
     272       \see bam_nt16_table
     273
     274       \since New in yat 0.11
     275     */
     276    void sequence(size_t i, uint8_t x);
     277
     278    /**
     279       \brief set sequence and quality
     280
     281       \since New in yat 0.11
     282     */
     283    void sequence(const std::string& seq, const std::vector<uint8_t>& qual);
     284
     285    /**
     286       \see core().l_qseq
     287     */
     288    uint32_t sequence_length(void) const;
     289
     290    /**
     291       Exchanging this read with \a other.
     292
     293       \see swap(BamRead&, BamRead&)
     294     */
     295    void swap(BamRead& other);
    218296
    219297    /**
     
    221299     */
    222300    int32_t tid(void) const;
    223 
    224     /**
    225        \brief 0-based laftmost coordinate
    226      */
    227     int32_t pos(void) const;
    228 
    229     /**
    230        \brief rightmost coordinate
    231 
    232        Coordinate is 0-based, i.e., the end is one passed the last
    233        matching position.
    234 
    235        \see bam_calend
    236      */
    237     int32_t end(void) const;
    238 
    239     /**
    240        \brief Chromosome ID for mate
    241      */
    242     int32_t mtid(void) const;
    243 
    244     /**
    245        \brief leftmost position for mate
    246      */
    247     int32_t mpos(void) const;
    248 
    249     /**
    250        Each character in returned sequence is either A, C, G, T, or N.
    251 
    252        \return sequence
    253      */
    254     std::string sequence(void) const;
    255 
    256     /**
    257        4-bit integer describing base \a index
    258 
    259        \see bam_nt16_rev_table
    260      */
    261     uint8_t sequence(size_t index) const;
    262 
    263     /**
    264        \brief modify a base in sequence
    265 
    266        Set i-th base in sequence to \a x, where seq is a 4-bit integer.
    267 
    268        \see bam_nt16_table
    269 
    270        \since New in yat 0.11
    271      */
    272     void sequence(size_t i, uint8_t x);
    273 
    274     /**
    275        \brief set sequence and quality
    276 
    277        \since New in yat 0.11
    278      */
    279     void sequence(const std::string& seq, const std::vector<uint8_t>& qual);
    280 
    281     /**
    282        \see core().l_qseq
    283      */
    284     uint32_t sequence_length(void) const;
    285 
    286     /**
    287        \brief bitwise flag
    288 
    289        \see Preprocessor defines BAM_F*
    290      */
    291     uint16_t flag(void) const;
    292 
    293     /**
    294        Exchanging this read with \a other.
    295 
    296        \see swap(BamRead&, BamRead&)
    297      */
    298     void swap(BamRead& other);
    299301
    300302  private:
Note: See TracChangeset for help on using the changeset viewer.