Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group fix #317

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/map/include/sequenceIds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class SequenceIdManager {
}

if (groupKey.empty() && !prefixDelim.empty()) {
// Use prefix before delimiter as group key
size_t pos = seqName.find(prefixDelim);
// Use prefix before last delimiter as group key
size_t pos = seqName.rfind(prefixDelim);
if (pos != std::string::npos) {
groupKey = seqName.substr(0, pos);
}
Expand All @@ -128,7 +128,13 @@ class SequenceIdManager {
}
metadata[originalIndex].groupId = groupMap[groupKey];
}

/*
// Debug output to verify grouping
for (size_t i = 0; i < metadata.size(); ++i) {
std::cerr << "[DEBUG group assignment] seq " << metadata[i].name
<< " → group " << metadata[i].groupId << std::endl;
}
*/
if (totalSeqs == 0) {
std::cerr << "[SequenceIdManager::buildRefGroups] ERROR: No sequences indexed!" << std::endl;
exit(1);
Expand Down