diff --git a/backend/src/enrichment_graph.py b/backend/src/enrichment_graph.py index 64898f34..552e127c 100644 --- a/backend/src/enrichment_graph.py +++ b/backend/src/enrichment_graph.py @@ -35,7 +35,6 @@ def get_functional_graph(list_enrichment, species_id): df2 = nodesterm.rename(columns={"id": "external_id"}) merged = pd.merge(df2[["external_id", "fdr_rate", "p_value"]], nodes, on="external_id") - print(df2[df2.duplicated(subset=["external_id"], keep=False)].sort_values(by="external_id")["external_id"].to_list()) # Add the two columns to df2 nodes = merged.drop_duplicates() @@ -66,7 +65,7 @@ def get_functional_graph(list_enrichment, species_id): nodes_sub = graph.create_nodes_subgraph(nk_graph, nodes) stopwatch.round("Enrichment") - + if len(nodes.index) == 0: sigmajs_data = {"nodes": [], "edges": []} else: diff --git a/backend/src/main.py b/backend/src/main.py index 1d7e1e78..d400e6b2 100644 --- a/backend/src/main.py +++ b/backend/src/main.py @@ -109,7 +109,6 @@ def proteins_subgraph_api(): # TODO: make better (Vincent) nodes = pd.DataFrame(proteins).rename(columns={"ENSEMBL": "external_id"}).drop_duplicates(subset="external_id") - edges = pd.DataFrame({"source": source, "target": target, "score": score}) edges = edges.drop_duplicates(subset=["source", "target"]) diff --git a/backend/src/queries.py b/backend/src/queries.py index 56e0b51e..2d7712a4 100644 --- a/backend/src/queries.py +++ b/backend/src/queries.py @@ -126,7 +126,9 @@ def get_number_of_proteins(driver: neo4j.Driver, species_id: int) -> int: return int(num_proteins) -def _convert_to_connection_info_score(result: neo4j.Result, _int: bool, protein:bool) -> (list[str], list[str], list[str], list[int]): +def _convert_to_connection_info_score( + result: neo4j.Result, _int: bool, protein: bool +) -> (list[str], list[str], list[str], list[int]): nodes, source, target, score = list(), list(), list(), list() for row in result: