Changeset 3028
- Timestamp:
- Apr 21, 2013, 2:37:31 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/bam.cc
r3026 r3028 51 51 #ifdef HAVE_LIBBAM 52 52 using namespace omic; 53 54 void test_aux(test::Suite& suite, const BamRead& b) 55 { 56 suite.out() << "test aux\n"; 57 BamRead bam(b); 58 59 char c = 'h'; 60 int size = bam.aux_size(); 61 bam.aux_append("ZZ", 'A', 1, (uint8_t*)(&c)); 62 suite.out() << "size: " << size << " " << bam.aux_size() << "\n"; 63 suite.add(bam.aux_size() == size+4); 64 bam.aux("ZZ"); 65 char c1 = bam_aux2A(bam.aux("ZZ")); 66 suite.out() << c << "==" << c1 << "\n"; 67 suite.add(c==c1); 68 bam.aux_del("ZZ"); 69 if (!suite.add(bam.aux_size() == size)) 70 suite.err() << "error: incorrect size: " << bam.aux_size() << "\n"; 71 } 72 53 73 54 74 void test_cigar(test::Suite& suite, const BamRead& b, const BamHeader& hdr) … … 144 164 } 145 165 test_cigar(suite, bam, in.header()); 166 test_aux(suite, bam); 146 167 } 147 168 #endif -
trunk/yat/omic/BamRead.cc
r3026 r3028 1 2 1 // $Id$ 3 2 … … 70 69 const uint8_t* BamRead::aux(void) const 71 70 { 71 assert(bam_); 72 72 return bam1_aux(bam_); 73 } 74 75 76 const uint8_t* BamRead::aux(const char tag[2]) const 77 { 78 assert(bam_); 79 return bam_aux_get(bam_, tag); 80 } 81 82 83 void BamRead::aux_append(const char tag[2], char type,int len,uint8_t* data) 84 { 85 assert(bam_); 86 bam_aux_append(bam_, tag, type, len, data); 87 } 88 89 90 void BamRead::aux_del(const char tag[2]) 91 { 92 assert(bam_); 93 bam_aux_del(bam_, bam_aux_get(bam_, tag)); 94 } 95 96 97 int BamRead::aux_size(void) const 98 { 99 assert(bam_); 100 return bam_->l_aux; 73 101 } 74 102 -
trunk/yat/omic/BamRead.h
r3026 r3028 118 118 119 119 /** 120 \since New in yat 0.11 121 */ 122 const uint8_t* aux(const char tag[2]) const; 123 124 /** 125 \since New in yat 0.11 126 */ 127 void aux(const char tag[2], char type, int len, uint8_t* data); 128 129 /** 130 \since New in yat 0.11 131 */ 132 void aux_append(const char tag[2], char type, int len, uint8_t* data); 133 134 /** 135 \since New in yat 0.11 136 */ 137 void aux_del(const char tag[2]); 138 139 /** 140 \since New in yat 0.11 141 */ 142 int aux_size(void) const; 143 144 /** 120 145 \brief access core data struct 121 146
Note: See TracChangeset
for help on using the changeset viewer.