Skip to content

Commit

Permalink
bugfix metadata reader
Browse files Browse the repository at this point in the history
Add missing conditional to only load metadata for samples present in the tree
  • Loading branch information
jmcbroome authored Apr 20, 2022
1 parent c7117a6 commit ed39d11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/matUtils/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ std::unordered_map<std::string,std::unordered_map<std::string,std::string>> read
first = false;
} else {
for (size_t i=1; i < words.size(); i++) {
metamap[keys[i]][words[0]] = words[i];
if (samples_to_use.find(words[0]) != samples_to_use.end()) {
metamap[keys[i]][words[0]] = words[i];
}
}
}
}
Expand Down Expand Up @@ -529,4 +531,4 @@ std::pair<std::vector<std::string>, size_t> get_closest_samples(MAT::Tree* T, st
dist_to_orig_parent += parent_branch_length;
}
return closest_samples;
}
}

0 comments on commit ed39d11

Please sign in to comment.