|
11 | 11 |
|
12 | 12 | #include "gfakluge.hpp"
|
13 | 13 |
|
14 |
| -#define VERBOSE_DEBUG |
| 14 | +//#define VERBOSE_DEBUG |
15 | 15 | //#define debug_algorithms
|
16 | 16 | //#define debug_component_index
|
17 | 17 |
|
@@ -383,31 +383,31 @@ void XG::from_gfa(const std::string& gfa_filename, bool validate, std::string ba
|
383 | 383 | // set up our enumerators
|
384 | 384 | auto for_each_sequence = [&](const std::function<void(const std::string& seq, const nid_t& node_id)>& lambda) {
|
385 | 385 | gfa.for_each_sequence_line_in_file(filename, [&](gfak::sequence_elem s) {
|
386 |
| - nid_t node_id = std::stol(s.name); |
387 |
| - lambda(s.sequence, node_id); |
388 |
| - }); |
| 386 | + nid_t node_id = std::stol(s.name); |
| 387 | + lambda(s.sequence, node_id); |
| 388 | + }); |
389 | 389 | };
|
390 | 390 | auto for_each_edge = [&](const std::function<void(const nid_t& from_id, const bool& from_rev,
|
391 | 391 | const nid_t& to_id, const bool& to_rev)>& lambda) {
|
392 | 392 | gfa.for_each_edge_line_in_file(filename, [&](gfak::edge_elem e) {
|
393 |
| - if (e.source_name.empty()) return; |
394 |
| - nid_t from_id = std::stol(e.source_name); |
395 |
| - bool from_rev = !e.source_orientation_forward; |
396 |
| - nid_t to_id = std::stol(e.sink_name); |
397 |
| - bool to_rev = !e.sink_orientation_forward; |
398 |
| - lambda(from_id, from_rev, to_id, to_rev); |
399 |
| - }); |
| 393 | + if (e.source_name.empty()) return; |
| 394 | + nid_t from_id = std::stol(e.source_name); |
| 395 | + bool from_rev = !e.source_orientation_forward; |
| 396 | + nid_t to_id = std::stol(e.sink_name); |
| 397 | + bool to_rev = !e.sink_orientation_forward; |
| 398 | + lambda(from_id, from_rev, to_id, to_rev); |
| 399 | + }); |
400 | 400 | };
|
401 | 401 | auto for_each_path_element = [&](const std::function<void(const std::string& path_name,
|
402 | 402 | const nid_t& node_id, const bool& is_rev,
|
403 | 403 | const std::string& cigar)>& lambda) {
|
404 | 404 | gfa.for_each_path_element_in_file(filename, [&](const std::string& path_name_raw, const std::string& node_id_str,
|
405 | 405 | bool is_rev, const std::string& cigar) {
|
406 |
| - nid_t node_id = std::stol(node_id_str); |
407 |
| - std::string path_name = path_name_raw; |
408 |
| - path_name.erase(std::remove_if(path_name.begin(), path_name.end(), [](char c) { return std::isspace(c); }), path_name.end()); |
409 |
| - lambda(path_name, node_id, is_rev, cigar); |
410 |
| - }); |
| 406 | + nid_t node_id = std::stol(node_id_str); |
| 407 | + std::string path_name = path_name_raw; |
| 408 | + path_name.erase(std::remove_if(path_name.begin(), path_name.end(), [](char c) { return std::isspace(c); }), path_name.end()); |
| 409 | + lambda(path_name, node_id, is_rev, cigar); |
| 410 | + }); |
411 | 411 | };
|
412 | 412 | from_enumerators(for_each_sequence, for_each_edge, for_each_path_element, validate, basename);
|
413 | 413 | }
|
@@ -587,7 +587,7 @@ void XG::from_enumerators(const std::function<void(const std::function<void(cons
|
587 | 587 | edge_from_to_mm.append(as_integer(from_handle), as_integer(to_handle));
|
588 | 588 | edge_to_from_mm.append(as_integer(to_handle), as_integer(from_handle));
|
589 | 589 | });
|
590 |
| - handle_t max_handle = number_bool_packing::pack(max_id, true); |
| 590 | + handle_t max_handle = number_bool_packing::pack(r_iv.size(), true); |
591 | 591 | edge_from_to_mm.index(as_integer(max_handle));
|
592 | 592 | edge_to_from_mm.index(as_integer(max_handle));
|
593 | 593 |
|
|
0 commit comments