Mercurial > repos > bimib > cobraxy
diff COBRAxy/flux_to_map.py @ 151:8e3cbf68cdc4 draft
Uploaded
author | luca_milaz |
---|---|
date | Wed, 06 Nov 2024 21:02:00 +0000 |
parents | 5683406a8cfd |
children | 929104dceba8 |
line wrap: on
line diff
--- a/COBRAxy/flux_to_map.py Wed Nov 06 21:00:17 2024 +0000 +++ b/COBRAxy/flux_to_map.py Wed Nov 06 21:02:00 2024 +0000 @@ -733,13 +733,12 @@ return tmp, max_z_score -def computeEnrichment(metabMap :ET.ElementTree, class_pat :Dict[str, List[List[float]]], ids :List[str]) -> List[Tuple[str, str, dict, float]]: +def computeEnrichment(class_pat :Dict[str, List[List[float]]], ids :List[str]) -> List[Tuple[str, str, dict, float]]: """ Compares clustered data based on a given comparison mode and applies enrichment-based styling on the provided metabolic map. Args: - metabMap : SVG map to modify. class_pat : the clustered data. ids : ids for data association. @@ -749,10 +748,7 @@ Raises: sys.exit : if there are less than 2 classes for comparison - - Side effects: - metabMap : mut - ids : mut + """ class_pat = { k.strip() : v for k, v in class_pat.items() } #TODO: simplfy this stuff vvv and stop using sys.exit (raise the correct utils error) @@ -765,8 +761,6 @@ for i, j in it.combinations(class_pat.keys(), 2): comparisonDict, max_z_score = compareDatasetPair(class_pat.get(i), class_pat.get(j), ids) enrichment_results.append((i, j, comparisonDict, max_z_score)) - - elif ARGS.comparison == "onevsrest": for single_cluster in class_pat.keys(): @@ -1030,7 +1024,7 @@ computeEnrichmentMeanMedian(core_map, class_pat, ids, ARGS.color_map) - enrichment_results = computeEnrichment(core_map, class_pat, ids) + enrichment_results = computeEnrichment(class_pat, ids) for i, j, comparisonDict, max_z_score in enrichment_results: map_copy = copy.deepcopy(core_map) temp_thingsInCommon(comparisonDict, map_copy, max_z_score, i, j)