Changeset 3477 for trunk/yat/omic/BamHeader.cc
- Timestamp:
- Mar 9, 2016, 9:26:38 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/omic/BamHeader.cc
r3423 r3477 81 81 const std::string& id, 82 82 const std::string& key) const 83 { 84 update_group(table, type); 85 strMap2::const_iterator line_table = table.find(id); 86 if (line_table == table.end()) { 87 std::string msg = "@" + type + ": unknown ID: '" + id + "'"; 88 throw utility::runtime_error(msg); 89 } 90 strMap::const_iterator it = line_table->second.find(key); 91 if (it == line_table->second.end()) { 92 std::string msg = "@" + type + ": unknown KEY: '" + key + "'"; 93 throw utility::runtime_error(msg); 94 } 95 return it->second; 96 } 97 98 99 void BamHeader::update_group(strMap2& table, const std::string& type) const 83 100 { 84 101 assert(type.size()==2); … … 101 118 } 102 119 } 103 strMap2::const_iterator line_table = table.find(id);104 if (line_table == table.end()) {105 std::string msg = "@" + type + ": unknown ID: '" + id + "'";106 throw utility::runtime_error(msg);107 }108 strMap::const_iterator it = line_table->second.find(key);109 if (it == line_table->second.end()) {110 std::string msg = "@" + type + ": unknown KEY: '" + key + "'";111 throw utility::runtime_error(msg);112 }113 return it->second;114 120 } 115 121 … … 156 162 { 157 163 return group(read_group_, "RG", id, key); 164 } 165 166 167 const std::map<std::string, std::string>& 168 BamHeader::read_group(const std::string& id) const 169 { 170 update_group(read_group_, "RG"); 171 strMap2::const_iterator line_table = read_group_.find(id); 172 if (line_table == read_group_.end()) { 173 std::string msg = "@RG: unknown ID: '" + id + "'"; 174 throw utility::runtime_error(msg); 175 } 176 return line_table->second; 177 } 178 179 180 BamHeader::read_group_iterator BamHeader::read_group_begin(void) const 181 { 182 update_group(read_group_, "RG"); 183 BamHeader::strMap2::const_iterator it(read_group_.begin()); 184 return utility::pair_first_iterator(it); 185 } 186 187 188 BamHeader::read_group_iterator BamHeader::read_group_end(void) const 189 { 190 update_group(read_group_, "RG"); 191 BamHeader::strMap2::const_iterator it(read_group_.end()); 192 return utility::pair_first_iterator(it); 158 193 } 159 194
Note: See TracChangeset
for help on using the changeset viewer.