Skip to content

Commit 17da0d6

Browse files
author
sarah.mubeen
committed
add mapping nodes
1 parent 984979a commit 17da0d6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/diffupy/process_input.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,17 @@ def _remove_non_significant_entities(df: pd.DataFrame, p_value: float) -> pd.Dat
237237
return df.set_index(NODE)[LABEL].to_dict()
238238

239239

240+
"""Map nodes from input to network"""
241+
242+
243+
def map_nodes(input_node_dict: Dict[str, int], network: nx.Graph) -> List:
244+
"""Map nodes from input dataset to nodes in network to get a set of labelled and unlabelled nodes."""
245+
# List of nodes in network
246+
network_nodes = list(network.nodes)
247+
248+
return [input_node_dict[node] if node in input_node_dict else None for node in network_nodes]
249+
250+
240251
"""Generate input vector from dataset labels"""
241252

242253

0 commit comments

Comments
 (0)