changeset 248:419c6bfad590 draft

Uploaded
author luca_milaz
date Sun, 04 Aug 2024 13:29:55 +0000
parents 6c3e7c338b93
children a2adb47e630d
files marea_2/flux_to_map.py
diffstat 1 files changed, 23 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/flux_to_map.py	Sun Aug 04 12:56:43 2024 +0000
+++ b/marea_2/flux_to_map.py	Sun Aug 04 13:29:55 2024 +0000
@@ -814,18 +814,34 @@
     return { id : list(map(utils.Float("Dataset values, not an argument"), values)) for id, values in dataset.items() }, IDs
 
 def computeEnrichmentMedoids(metabMap :ET.ElementTree, class_pat :Dict[str, List[List[float]]], ids :List[str]) -> None:
-
+    #class_pat 462 * cellule
     utils.logWarning(
-        str(len(class_pat['1'])),
+        ids,
         ARGS.out_log)
+    medians = {}
+    means = {}
+    for key, value in class_pat.items():
+        values = np.array(class_pat[key])
+        median = np.median(values, axis=1)
+        mean = np.mean(values, axis=1)
+        medians[key] = median
+        means[key] = means
+
+    max_flux_medians = max(medians.values(), key=abs)
+    max_flux_means = max(means.values(), key=abs)
+
+    for key, value in medians.items():
+        medians[key] = medians[key] / max_flux_medians
     
+    for key, value in means.items():
+        means[key] = means[key] / max_flux_means
+
+
+
+
     pass
-    #for key, value in class_pat.items():
 
-    #max_flux = max(class_pat.values(), key=abs)
-
-        
-
+    
 ############################ MAIN #############################################
 def main() -> None:
     """