# HG changeset patch # User luca_milaz # Date 1722778195 0 # Node ID 419c6bfad59053125bd2cce114424ccb3adc3ad6 # Parent 6c3e7c338b932e4da97af785121ee10c17b24d6d Uploaded diff -r 6c3e7c338b93 -r 419c6bfad590 marea_2/flux_to_map.py --- 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: """