From 75f13a9d4511ea7a31d4b66251816e05dc75dfd3 Mon Sep 17 00:00:00 2001 From: John Elizarraras <13990267+iblacksand@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:34:35 -0500 Subject: [PATCH] fix(lib): fix error caused by seeds not found in network (#26) Filters out seeds not found in network. The R package does this filter so this was not initially implemented in the library. --- webgestalt_lib/src/methods/nta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webgestalt_lib/src/methods/nta.rs b/webgestalt_lib/src/methods/nta.rs index 13983c7..f7d2f9a 100644 --- a/webgestalt_lib/src/methods/nta.rs +++ b/webgestalt_lib/src/methods/nta.rs @@ -141,7 +141,7 @@ pub fn process_nta(config: NTAConfig) -> Vec<(String, f64)> { let node_indices: Vec = config .seeds .iter() - .map(|seed| *node_map.get(seed).unwrap()) + .filter_map(|seed| node_map.get(seed).cloned()) .collect(); let walk_res = random_walk_probability( &graph,