Mercurial > repos > bimib > cobraxy
comparison COBRAxy/flux_to_map.py @ 323:3f8336f8072d draft
Uploaded
| author | francesco_lapi |
|---|---|
| date | Wed, 18 Jun 2025 13:42:31 +0000 |
| parents | a9d6e916ea6e |
| children | df90f40a156c |
comparison
equal
deleted
inserted
replaced
| 322:f62b8625f6f1 | 323:3f8336f8072d |
|---|---|
| 731 rest = [item for k, v in class_pat.items() if k != single_cluster for item in v] | 731 rest = [item for k, v in class_pat.items() if k != single_cluster for item in v] |
| 732 | 732 |
| 733 comparisonDict, max_z_score = compareDatasetPair(class_pat.get(single_cluster), rest, ids) | 733 comparisonDict, max_z_score = compareDatasetPair(class_pat.get(single_cluster), rest, ids) |
| 734 enrichment_results.append((single_cluster, "rest", comparisonDict, max_z_score)) | 734 enrichment_results.append((single_cluster, "rest", comparisonDict, max_z_score)) |
| 735 | 735 |
| 736 #elif ARGS.comparison == "onevsmany": | |
| 737 # controlItems = class_pat.get(ARGS.control) | |
| 738 # for otherDataset in class_pat.keys(): | |
| 739 # if otherDataset == ARGS.control: | |
| 740 # continue | |
| 741 # comparisonDict, max_z_score = compareDatasetPair(controlItems, class_pat.get(otherDataset), ids) | |
| 742 # enrichment_results.append((ARGS.control, otherDataset, comparisonDict, max_z_score)) | |
| 736 elif ARGS.comparison == "onevsmany": | 743 elif ARGS.comparison == "onevsmany": |
| 737 controlItems = class_pat.get(ARGS.control) | 744 controlItems = class_pat.get(ARGS.control) |
| 738 for otherDataset in class_pat.keys(): | 745 for otherDataset in class_pat.keys(): |
| 739 if otherDataset == ARGS.control: | 746 if otherDataset == ARGS.control: |
| 740 continue | 747 continue |
| 741 comparisonDict, max_z_score = compareDatasetPair(controlItems, class_pat.get(otherDataset), ids) | 748 comparisonDict, max_z_score = compareDatasetPair(class_pat.get(otherDataset),controlItems, ids) |
| 742 enrichment_results.append((ARGS.control, otherDataset, comparisonDict, max_z_score)) | 749 enrichment_results.append(( otherDataset,ARGS.control, comparisonDict, max_z_score)) |
| 750 | |
| 743 return enrichment_results | 751 return enrichment_results |
| 744 | 752 |
| 745 def createOutputMaps(dataset1Name :str, dataset2Name :str, core_map :ET.ElementTree) -> None: | 753 def createOutputMaps(dataset1Name :str, dataset2Name :str, core_map :ET.ElementTree) -> None: |
| 746 svgFilePath = buildOutputPath(dataset1Name, dataset2Name, details="SVG Map", ext=utils.FileFormat.SVG) | 754 svgFilePath = buildOutputPath(dataset1Name, dataset2Name, details="SVG Map", ext=utils.FileFormat.SVG) |
| 747 utils.writeSvg(svgFilePath, core_map) | 755 utils.writeSvg(svgFilePath, core_map) |
