diff COBRAxy/marea.py @ 151:8e3cbf68cdc4 draft

Uploaded
author luca_milaz
date Wed, 06 Nov 2024 21:02:00 +0000
parents 3fca9b568faf
children
line wrap: on
line diff
--- a/COBRAxy/marea.py	Wed Nov 06 21:00:17 2024 +0000
+++ b/COBRAxy/marea.py	Wed Nov 06 21:02:00 2024 +0000
@@ -768,13 +768,12 @@
     
     return tmp, max_z_score
 
-def computeEnrichment(metabMap: ET.ElementTree, class_pat: Dict[str, List[List[float]]], ids: List[str], *, fromRAS=True) -> List[Tuple[str, str, dict, float]]:
+def computeEnrichment(class_pat: Dict[str, List[List[float]]], ids: List[str], *, fromRAS=True) -> 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.
         fromRAS : whether the data to enrich consists of RAS scores.
@@ -784,9 +783,6 @@
         
     Raises:
         sys.exit : if there are less than 2 classes for comparison
-    
-    Side effects:
-        metabMap : mutates based on calculated enrichment
     """
     class_pat = {k.strip(): v for k, v in class_pat.items()}
     if (not class_pat) or (len(class_pat.keys()) < 2):
@@ -893,7 +889,7 @@
     
     if ARGS.using_RAS:
         ids, class_pat = getClassesAndIdsFromDatasets(ARGS.input_datas, ARGS.input_data, ARGS.input_class, ARGS.names)
-        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, ras_enrichment=True)
@@ -901,7 +897,7 @@
     
     if ARGS.using_RPS:
         ids, class_pat = getClassesAndIdsFromDatasets(ARGS.input_datas_rps, ARGS.input_data_rps, ARGS.input_class_rps, ARGS.names_rps)
-        enrichment_results = computeEnrichment(core_map, class_pat, ids, fromRAS=False)
+        enrichment_results = computeEnrichment(class_pat, ids, fromRAS=False)
         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, ras_enrichment=False)