From 33e2fc213eb492a0db38a30ecc1b3b4e3146e769 Mon Sep 17 00:00:00 2001 From: Xian Date: Thu, 12 Sep 2024 11:32:33 +0200 Subject: [PATCH] Don't try to add lengths for a distanceless index --- bdsg/src/snarl_distance_index.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/bdsg/src/snarl_distance_index.cpp b/bdsg/src/snarl_distance_index.cpp index 22cff21d..4ee1f89d 100644 --- a/bdsg/src/snarl_distance_index.cpp +++ b/bdsg/src/snarl_distance_index.cpp @@ -5404,7 +5404,8 @@ size_t SnarlDistanceIndex::ChainRecordWriter::add_node(nid_t node_id, size_t nod #ifdef debug_distance_indexing cerr << "Adding new node to chain, with previous child at offset " << previous_child_offset << endl; #endif - if (SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == DISTANCED_TRIVIAL_SNARL + if ((SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == DISTANCED_TRIVIAL_SNARL || + SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == TRIVIAL_SNARL) && (TrivialSnarlRecord(previous_child_offset, records).get_node_count() == MAX_TRIVIAL_SNARL_NODE_COUNT || new_record || reverse_loop == 0)) { //If the last thing was a trivial snarl and it is full, then finish it off @@ -5415,6 +5416,7 @@ size_t SnarlDistanceIndex::ChainRecordWriter::add_node(nid_t node_id, size_t nod } if (previous_child_offset == 0 + || SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == SNARL || SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == DISTANCED_SNARL || SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == OVERSIZED_SNARL || SnarlDistanceIndex::get_record_type((*records)->at(previous_child_offset)) == DISTANCED_SIMPLE_SNARL @@ -6040,8 +6042,10 @@ void SnarlDistanceIndex::get_snarl_tree_records(const vector