diff --git a/src/matUtils/select.cpp b/src/matUtils/select.cpp index 10b46a5b..9e217172 100644 --- a/src/matUtils/select.cpp +++ b/src/matUtils/select.cpp @@ -360,7 +360,9 @@ std::unordered_map> 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]; + } } } } @@ -529,4 +531,4 @@ std::pair, size_t> get_closest_samples(MAT::Tree* T, st dist_to_orig_parent += parent_branch_length; } return closest_samples; -} \ No newline at end of file +}