| 145 | } |
| 146 | |
| 147 | void |
| 148 | storeContigs(const std::string& contigsPath) |
| 149 | { |
| 150 | if (opt::verbose) { |
| 151 | std::cerr << "Storing contigs to `" << contigsPath << "'...\n"; |
| 152 | } |
| 153 | std::ofstream fout(contigsPath.c_str()); |
| 154 | assert_good(fout, contigsPath); |
| 155 | |
| 156 | Graph::vertex_iterator vertexStart, vertexEnd; |
| 157 | boost::tie(vertexStart, vertexEnd) = vertices(g_contigGraph); |
| 158 | for (auto it = vertexStart; it != vertexEnd; ++it) { |
| 159 | auto node = *it; |
| 160 | if (!get(vertex_removed, g_contigGraph, node) && !node.sense()) { |
| 161 | FastaRecord rec; |
| 162 | |
| 163 | std::stringstream ss; |
| 164 | ss << get(vertex_name, g_contigGraph, node); |
| 165 | std::string name = ss.str(); |
| 166 | |
| 167 | rec.id = name.substr(0, name.size() - 1); |
| 168 | rec.comment = getContigComment(node); |
| 169 | rec.seq = getContigSequence(node); |
| 170 | |
| 171 | fout << rec; |
| 172 | } |
| 173 | } |
| 174 | assert_good(fout, contigsPath); |
| 175 | if (opt::verbose) { |
| 176 | std::cerr << "Contigs stored.\n"; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | unsigned |
| 181 | numVerticesRemoved(const Graph& graph) |
no test coverage detected