Changeset 3221
- Timestamp:
- May 6, 2014, 7:39:36 AM (9 years ago)
- Location:
- branches/0.12-stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.12-stable/NEWS
r3215 r3221 6 6 7 7 version 0.12 (released NOT YET) 8 - BamRead::cigar(const std::vector<uint32_t>&) is deprecated 8 9 - Aligner(double, double) is now explicit (see r3207) 9 10 - GetlineIterator(istream&, char) is now explicit (see r3148) -
branches/0.12-stable/test/bam.cc
r3201 r3221 24 24 #include "yat/omic/BamRead.h" 25 25 #endif 26 27 #include "yat/utility/Aligner.h" 26 28 27 29 #include <cassert> … … 71 73 suite.out() << bam.cigar_str() << "\n"; 72 74 OutBamFile os("cigar_test.bam", hdr); 73 std::vector<uint32_t>cig;75 utility::Aligner::Cigar cig; 74 76 75 77 bam.cigar(cig); … … 78 80 os.write(bam); 79 81 80 cig.resize(1); 81 cig[0] = bam_cigar_gen(bam.sequence_length(), BAM_CMATCH); 82 cig.push_back(BAM_CMATCH, bam.sequence_length()); 82 83 bam.cigar(cig); 83 84 suite.out() << bam.cigar_str() << "\n"; … … 85 86 os.write(bam); 86 87 87 cig. resize(3);88 cig [0] = bam_cigar_gen(50, BAM_CMATCH);89 cig [1] = bam_cigar_gen(2, BAM_CDEL);90 cig [2] = bam_cigar_gen(50, BAM_CMATCH);88 cig.clear(); 89 cig.push_back(BAM_CMATCH, 50); 90 cig.push_back(BAM_CDEL, 2); 91 cig.push_back(BAM_CMATCH, 50); 91 92 bam.cigar(cig); 92 93 suite.out() << bam.cigar_str() << "\n"; … … 132 133 133 134 // just for consistency 134 std::vector<uint32_t>cig;135 utility::Aligner::Cigar cig; 135 136 bam.cigar(cig); 136 137 bam.core().flag &= ~BAM_FUNMAP; -
branches/0.12-stable/yat/omic/BamRead.cc
r3210 r3221 149 149 150 150 void BamRead::cigar(const std::vector<uint32_t>& c) 151 { 152 // use the new function cigar(1) to implement this old deprecated variant 153 utility::Aligner::Cigar cig; 154 for (size_t i=0; i<c.size(); ++i) 155 cig.push_back(bam_cigar_op(c[i]), bam_cigar_oplen(c[i])); 156 cigar(cig); 157 } 158 159 160 void BamRead::cigar(const utility::Aligner::Cigar& c) 151 161 { 152 162 int offset = 4*c.size() - 4*core().n_cigar; … … 161 171 162 172 // copy new cigar 163 if (c.size())164 // each cigar element is 4 bytes165 memcpy(bam1_cigar(bam_), &c[0], 4*c.size()); 173 for (size_t i=0; i<c.size(); ++i) 174 bam1_cigar(bam_)[i] = c[i]; 175 166 176 bam_->data_len += offset; 167 177 core().n_cigar = c.size(); -
branches/0.12-stable/yat/omic/BamRead.h
r3212 r3221 27 27 #include YAT_SAM_HEADER 28 28 29 #include "yat/utility/Aligner.h" 29 30 // This file has to be included to keep compatibility with yat 0.11 30 #include <yat/utility/Cigar.h> 31 #include "yat/utility/Cigar.h" 32 #include "yat/utility/deprecate.h" 31 33 32 34 #include <functional> … … 171 173 172 174 \param c new cigar 175 176 \deprecated Provided for backward compatibility with 0.11 177 API. Use cigar(const utility::Aligner::Cigar&) instead. 173 178 */ 174 void cigar(const std::vector<uint32_t>& c); 179 void cigar(const std::vector<uint32_t>& c) YAT_DEPRECATE; 180 181 /** 182 \brief set CIGAR 183 184 \param cigar new cigar 185 186 \since new in yat 0.12 187 */ 188 void cigar(const utility::Aligner::Cigar& cigar); 175 189 176 190 /** -
branches/0.12-stable/yat/utility/deprecate.h
r2124 r3221 1 1 #ifndef _theplu_yat_utility_deprecate_ 2 #define _theplu_yat_utility_deprecate_ 2 #define _theplu_yat_utility_deprecate_ 3 3 4 4 // $Id$
Note: See TracChangeset
for help on using the changeset viewer.