From 39ead4112584e5894664d9bd5c0bd8772f3a7022 Mon Sep 17 00:00:00 2001 From: Ben Kaehler <5283007+BenKaehler@users.noreply.github.com> Date: Sun, 14 Jul 2024 10:50:30 +1000 Subject: [PATCH] Closes #92 --- q2_makarsa/_visualisation.py | 2 +- q2_makarsa/tests/data/spec.json | 70 ++++++++++++++++----------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/q2_makarsa/_visualisation.py b/q2_makarsa/_visualisation.py index 274582c..446f6f3 100644 --- a/q2_makarsa/_visualisation.py +++ b/q2_makarsa/_visualisation.py @@ -166,7 +166,7 @@ def add_mv_distances(network, idx, nodes, links): for a in nodes: for b in nodes: d = distances[rev_idx[a["index"]]][rev_idx[b["index"]]] - b[str(a["index"])] = d + b[str(a["index"])] = max(1, d) radius = max(radius, d) for link in links: link[str(a["index"])] = max( diff --git a/q2_makarsa/tests/data/spec.json b/q2_makarsa/tests/data/spec.json index 49da0d0..3d1eb09 100644 --- a/q2_makarsa/tests/data/spec.json +++ b/q2_makarsa/tests/data/spec.json @@ -191,7 +191,7 @@ { "index": 0, "Feature": "HKcs0", - "0": 0, + "0": 1, "1": 4, "2": 4, "3": 4, @@ -231,7 +231,7 @@ "index": 1, "Feature": "bPSEb", "0": 4, - "1": 0, + "1": 1, "2": 2, "3": 2, "4": 2, @@ -271,7 +271,7 @@ "Feature": "X3KD3L", "0": 4, "1": 2, - "2": 0, + "2": 1, "3": 4, "4": 3, "5": 3, @@ -311,7 +311,7 @@ "0": 4, "1": 2, "2": 4, - "3": 0, + "3": 1, "4": 2, "5": 3, "6": 3, @@ -351,7 +351,7 @@ "1": 2, "2": 3, "3": 2, - "4": 0, + "4": 1, "5": 3, "6": 2, "7": 2, @@ -391,7 +391,7 @@ "2": 3, "3": 3, "4": 3, - "5": 0, + "5": 1, "6": 3, "7": 4, "8": 3, @@ -431,7 +431,7 @@ "3": 3, "4": 2, "5": 3, - "6": 0, + "6": 1, "7": 3, "8": 4, "9": 2, @@ -471,7 +471,7 @@ "4": 2, "5": 4, "6": 3, - "7": 0, + "7": 1, "8": 5, "9": 2, "10": 1, @@ -511,7 +511,7 @@ "5": 3, "6": 4, "7": 5, - "8": 0, + "8": 1, "9": 4, "10": 6, "11": 4, @@ -551,7 +551,7 @@ "6": 2, "7": 2, "8": 4, - "9": 0, + "9": 1, "10": 3, "11": 2, "12": 1, @@ -591,7 +591,7 @@ "7": 1, "8": 6, "9": 3, - "10": 0, + "10": 1, "11": 5, "12": 4, "13": 6, @@ -631,7 +631,7 @@ "8": 4, "9": 2, "10": 5, - "11": 0, + "11": 1, "12": 3, "13": 5, "14": 2, @@ -671,7 +671,7 @@ "9": 1, "10": 4, "11": 3, - "12": 0, + "12": 1, "13": 4, "14": 2, "15": 1, @@ -711,7 +711,7 @@ "10": 6, "11": 5, "12": 4, - "13": 0, + "13": 1, "14": 4, "15": 3, "16": 4, @@ -751,7 +751,7 @@ "11": 2, "12": 2, "13": 4, - "14": 0, + "14": 1, "15": 2, "16": 2, "17": 3, @@ -791,7 +791,7 @@ "12": 1, "13": 3, "14": 2, - "15": 0, + "15": 1, "16": 2, "17": 2, "18": 3, @@ -831,7 +831,7 @@ "13": 4, "14": 2, "15": 2, - "16": 0, + "16": 1, "17": 3, "18": 5, "19": 6, @@ -871,7 +871,7 @@ "14": 3, "15": 2, "16": 3, - "17": 0, + "17": 1, "18": 3, "19": 4, "20": 3, @@ -911,7 +911,7 @@ "15": 3, "16": 5, "17": 3, - "18": 0, + "18": 1, "19": 2, "20": 5, "21": 5, @@ -951,7 +951,7 @@ "16": 6, "17": 4, "18": 2, - "19": 0, + "19": 1, "20": 6, "21": 6, "22": 5, @@ -991,7 +991,7 @@ "17": 3, "18": 5, "19": 6, - "20": 0, + "20": 1, "21": 1, "22": 1, "23": 2, @@ -1031,7 +1031,7 @@ "18": 5, "19": 6, "20": 1, - "21": 0, + "21": 1, "22": 2, "23": 2, "24": 2, @@ -1071,7 +1071,7 @@ "19": 5, "20": 1, "21": 2, - "22": 0, + "22": 1, "23": 1, "24": 2, "25": 2, @@ -1111,7 +1111,7 @@ "20": 2, "21": 2, "22": 1, - "23": 0, + "23": 1, "24": 2, "25": 2, "26": 1, @@ -1151,7 +1151,7 @@ "21": 2, "22": 2, "23": 2, - "24": 0, + "24": 1, "25": 2, "26": 1, "27": 2, @@ -1191,7 +1191,7 @@ "22": 2, "23": 2, "24": 2, - "25": 0, + "25": 1, "26": 1, "27": 1, "28": 1, @@ -1231,7 +1231,7 @@ "23": 1, "24": 1, "25": 1, - "26": 0, + "26": 1, "27": 1, "28": 1, "29": 2, @@ -1271,7 +1271,7 @@ "24": 2, "25": 1, "26": 1, - "27": 0, + "27": 1, "28": 1, "29": 1, "30": 3, @@ -1311,7 +1311,7 @@ "25": 1, "26": 1, "27": 1, - "28": 0, + "28": 1, "29": 2, "30": 3, "31": 4, @@ -1351,7 +1351,7 @@ "26": 2, "27": 1, "28": 2, - "29": 0, + "29": 1, "30": 4, "31": 2, "32": 2, @@ -1391,7 +1391,7 @@ "27": 3, "28": 3, "29": 4, - "30": 0, + "30": 1, "31": 6, "32": 3, "33": 3, @@ -1431,7 +1431,7 @@ "28": 4, "29": 2, "30": 6, - "31": 0, + "31": 1, "32": 4, "33": 5, "34": 6 @@ -1471,7 +1471,7 @@ "29": 2, "30": 3, "31": 4, - "32": 0, + "32": 1, "33": 1, "34": 2 }, @@ -1511,7 +1511,7 @@ "30": 3, "31": 5, "32": 1, - "33": 0, + "33": 1, "34": 3 }, { @@ -1551,7 +1551,7 @@ "31": 6, "32": 2, "33": 3, - "34": 0 + "34": 1 } ] },