pflex 1.1__tar.gz → 1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {pflex-1.1 → pflex-1.2}/PKG-INFO +16 -16
  2. {pflex-1.1 → pflex-1.2}/README.md +14 -14
  3. {pflex-1.1 → pflex-1.2}/docs/getting-started.md +9 -9
  4. {pflex-1.1 → pflex-1.2}/docs/index.md +1 -1
  5. {pflex-1.1 → pflex-1.2}/docs/user-guide.md +25 -25
  6. {pflex-1.1 → pflex-1.2}/pyproject.toml +2 -2
  7. {pflex-1.1 → pflex-1.2}/src/pflex/__init__.py +12 -12
  8. {pflex-1.1 → pflex-1.2}/src/pflex/analysis.py +129 -129
  9. {pflex-1.1 → pflex-1.2}/src/pflex/examples/basic_usage.py +12 -10
  10. {pflex-1.1 → pflex-1.2}/src/pflex/plotting.py +64 -64
  11. {pflex-1.1 → pflex-1.2}/src/pflex/preprocessing.py +4 -4
  12. {pflex-1.1 → pflex-1.2}/.gitignore +0 -0
  13. {pflex-1.1 → pflex-1.2}/.python-version +0 -0
  14. {pflex-1.1 → pflex-1.2}/LICENSE +0 -0
  15. {pflex-1.1 → pflex-1.2}/docs/installation.md +0 -0
  16. {pflex-1.1 → pflex-1.2}/mkdocs.yml +0 -0
  17. {pflex-1.1 → pflex-1.2}/src/pflex/data/__init__.py +0 -0
  18. {pflex-1.1 → pflex-1.2}/src/pflex/data/example_input/__init__.py +0 -0
  19. {pflex-1.1 → pflex-1.2}/src/pflex/data/example_input/skin_cell_lines_corum_genes.parquet +0 -0
  20. {pflex-1.1 → pflex-1.2}/src/pflex/data/example_input/soft_tissue_cell_lines_corum_genes.parquet +0 -0
  21. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/CORUM.parquet +0 -0
  22. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/GOBP.parquet +0 -0
  23. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/PATHWAY.parquet +0 -0
  24. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/__init__.py +0 -0
  25. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/corum.csv +0 -0
  26. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/gobp.csv +0 -0
  27. {pflex-1.1 → pflex-1.2}/src/pflex/data/functional_standard/pathway.csv +0 -0
  28. {pflex-1.1 → pflex-1.2}/src/pflex/logging_config.py +0 -0
  29. {pflex-1.1 → pflex-1.2}/src/pflex/utils.py +0 -0
  30. {pflex-1.1 → pflex-1.2}/uv.lock +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pflex
3
- Version: 1.1
4
- Summary: pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological functional standards. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data.
3
+ Version: 1.2
4
+ Summary: pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological functional standards. The toolkit computes gene-level and module-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data.
5
5
  Author-email: Yasir Demirtas <tyasird@hotmail.com>
6
6
  License-File: LICENSE
7
7
  Classifier: License :: OSI Approved :: MIT License
@@ -41,15 +41,15 @@ Description-Content-Type: text/markdown
41
41
 
42
42
  **Abstract**
43
43
 
44
- Genetic networks derived from omics data are a powerful tool for systematic gene function prediction. Performance evaluation of such predictions is crucial to judge the data and computational pipeline to derive the networks, but functional diversity within protein complex or pathway standards often cause hidden evaluation biases. To visualize and mitigate such biases, we recently developed an R package FLEX. Here, we present the FLEX genetic network benchmarking tool as Python library with new and improved functionality. The pFLEX library improves the overall runtime 4.1 to 15.8-fold. It offers additional evaluation metrics that allow for an easy comparison of precision recall performance at the complex or pathway resolution between genetic networks. We demonstrate the utility of pFLEX for evaluating tissue-specific co-essentiality networks and data normalization strategies of the Cancer Dependency Map. This illustrates how different biological module-resolved precision recall metrics in pFLEX enable sensitive and fast evaluation of genetic networks.
44
+ Genetic networks derived from omics data are a powerful tool for systematic gene function prediction. Performance evaluation of such predictions is crucial to judge the data and computational pipeline for network construction, but unbalanced functional standards often cause hidden evaluation biases. To visualize and mitigate such biases, we previously developed the R package FLEX. Here, we present the pFLEX genetic network benchmarking tool as Python library with new and improved functionality. pFLEX improves overall runtime 4.1 to 15.8-fold. It offers additional evaluation metrics that allow for easy comparison of precision recall performance at the module or pathway resolution between genetic networks. We demonstrate the utility of pFLEX for evaluating tissue-specific co-essentiality networks and data normalization strategies of the Cancer Dependency Map, as well as for cell line-specific Perturb-Seq-derived networks. This illustrates the requirement for biological module-resolved precision recall metrics in pFLEX for sensitive and fast evaluation of genetic networks.
45
45
 
46
46
  ---
47
47
 
48
48
  ## Features
49
49
 
50
50
  - Precision-recall curve generation for ranked gene lists
51
- - Evaluation using CORUM complexes, GO terms, and pathways
52
- - Complex-level resolution analysis and visualization
51
+ - Evaluation using CORUM-derived modules, GO terms, and pathways
52
+ - Module-level resolution analysis and visualization
53
53
  - Easy integration into CRISPR screen workflows
54
54
  - Packaged DepMap example inputs filtered to CORUM genes
55
55
 
@@ -103,7 +103,7 @@ pFLEX expects each input dataset as a matrix with genes in rows and screens, sam
103
103
  | AATF | 0.042 | -0.088 | -0.016 |
104
104
  | BCL6 | -0.019 | 0.112 | -0.074 |
105
105
 
106
- CSV, Excel, Parquet, and `.p` files are supported; `.p` files are read as Parquet. Parquet is recommended for larger matrices.
106
+ CSV, Excel, and Parquet files are supported. Parquet is recommended for larger matrices.
107
107
 
108
108
  The packaged example inputs are real DepMap 25Q2 tissue subsets filtered to genes present in CORUM:
109
109
 
@@ -134,8 +134,8 @@ inputs = {
134
134
  ```python
135
135
  config = {
136
136
  "functional_standard": "CORUM",
137
- "min_genes_in_complex": 2,
138
- "min_genes_per_complex_analysis": 2,
137
+ "min_genes_in_module": 2,
138
+ "min_genes_per_module_analysis": 2,
139
139
  "output_folder": "output",
140
140
  "analysis_genes": "shared",
141
141
  "jaccard": True,
@@ -143,7 +143,7 @@ config = {
143
143
  "fill_na": True,
144
144
  },
145
145
  "corr_function": "numpy_without_mask",
146
- "per_complex": {
146
+ "per_module": {
147
147
  "n_jobs": 8,
148
148
  },
149
149
  "plotting": {
@@ -160,7 +160,7 @@ Common choices:
160
160
  - `sort`: `"high"` or `"low"` per input dataset
161
161
  - `preprocessing.fill_na`: fill missing values with gene means
162
162
  - `corr_function`: `"numpy"`, `"numpy_without_mask"`, `"numba"`, or `"pandas"`
163
- - `per_complex.n_jobs`: worker count for per-complex analysis
163
+ - `per_module.n_jobs`: worker count for per-module analysis
164
164
 
165
165
  ### Analysis Flow
166
166
 
@@ -172,16 +172,16 @@ terms, _ = flex.load_functional_standard()
172
172
  for name, dataset in data.items():
173
173
  corr = flex.perform_corr(dataset, config["corr_function"])
174
174
  flex.pra(name, corr, is_corr=True)
175
- flex.pra_percomplex(name, corr, is_corr=True)
176
- flex.complex_contributions(name)
175
+ flex.pra_per_module(name, corr, is_corr=True)
176
+ flex.module_contributions(name)
177
177
  flex.mpr_prepare(name)
178
178
 
179
179
  flex.plot_precision_recall_curve()
180
180
  flex.plot_auc_scores()
181
- flex.plot_significant_complexes()
182
- flex.plot_percomplex_scatter(n_top=10)
183
- flex.plot_percomplex_scatter_bysize(n_top=10)
184
- flex.plot_complex_contributions()
181
+ flex.plot_significant_modules()
182
+ flex.plot_per_module_scatter(n_top=10)
183
+ flex.plot_per_module_scatter_by_size(n_top=10)
184
+ flex.plot_module_contributions()
185
185
  flex.plot_mpr_summary()
186
186
  flex.save_results_to_csv()
187
187
  ```
@@ -10,15 +10,15 @@
10
10
 
11
11
  **Abstract**
12
12
 
13
- Genetic networks derived from omics data are a powerful tool for systematic gene function prediction. Performance evaluation of such predictions is crucial to judge the data and computational pipeline to derive the networks, but functional diversity within protein complex or pathway standards often cause hidden evaluation biases. To visualize and mitigate such biases, we recently developed an R package FLEX. Here, we present the FLEX genetic network benchmarking tool as Python library with new and improved functionality. The pFLEX library improves the overall runtime 4.1 to 15.8-fold. It offers additional evaluation metrics that allow for an easy comparison of precision recall performance at the complex or pathway resolution between genetic networks. We demonstrate the utility of pFLEX for evaluating tissue-specific co-essentiality networks and data normalization strategies of the Cancer Dependency Map. This illustrates how different biological module-resolved precision recall metrics in pFLEX enable sensitive and fast evaluation of genetic networks.
13
+ Genetic networks derived from omics data are a powerful tool for systematic gene function prediction. Performance evaluation of such predictions is crucial to judge the data and computational pipeline for network construction, but unbalanced functional standards often cause hidden evaluation biases. To visualize and mitigate such biases, we previously developed the R package FLEX. Here, we present the pFLEX genetic network benchmarking tool as Python library with new and improved functionality. pFLEX improves overall runtime 4.1 to 15.8-fold. It offers additional evaluation metrics that allow for easy comparison of precision recall performance at the module or pathway resolution between genetic networks. We demonstrate the utility of pFLEX for evaluating tissue-specific co-essentiality networks and data normalization strategies of the Cancer Dependency Map, as well as for cell line-specific Perturb-Seq-derived networks. This illustrates the requirement for biological module-resolved precision recall metrics in pFLEX for sensitive and fast evaluation of genetic networks.
14
14
 
15
15
  ---
16
16
 
17
17
  ## Features
18
18
 
19
19
  - Precision-recall curve generation for ranked gene lists
20
- - Evaluation using CORUM complexes, GO terms, and pathways
21
- - Complex-level resolution analysis and visualization
20
+ - Evaluation using CORUM-derived modules, GO terms, and pathways
21
+ - Module-level resolution analysis and visualization
22
22
  - Easy integration into CRISPR screen workflows
23
23
  - Packaged DepMap example inputs filtered to CORUM genes
24
24
 
@@ -72,7 +72,7 @@ pFLEX expects each input dataset as a matrix with genes in rows and screens, sam
72
72
  | AATF | 0.042 | -0.088 | -0.016 |
73
73
  | BCL6 | -0.019 | 0.112 | -0.074 |
74
74
 
75
- CSV, Excel, Parquet, and `.p` files are supported; `.p` files are read as Parquet. Parquet is recommended for larger matrices.
75
+ CSV, Excel, and Parquet files are supported. Parquet is recommended for larger matrices.
76
76
 
77
77
  The packaged example inputs are real DepMap 25Q2 tissue subsets filtered to genes present in CORUM:
78
78
 
@@ -103,8 +103,8 @@ inputs = {
103
103
  ```python
104
104
  config = {
105
105
  "functional_standard": "CORUM",
106
- "min_genes_in_complex": 2,
107
- "min_genes_per_complex_analysis": 2,
106
+ "min_genes_in_module": 2,
107
+ "min_genes_per_module_analysis": 2,
108
108
  "output_folder": "output",
109
109
  "analysis_genes": "shared",
110
110
  "jaccard": True,
@@ -112,7 +112,7 @@ config = {
112
112
  "fill_na": True,
113
113
  },
114
114
  "corr_function": "numpy_without_mask",
115
- "per_complex": {
115
+ "per_module": {
116
116
  "n_jobs": 8,
117
117
  },
118
118
  "plotting": {
@@ -129,7 +129,7 @@ Common choices:
129
129
  - `sort`: `"high"` or `"low"` per input dataset
130
130
  - `preprocessing.fill_na`: fill missing values with gene means
131
131
  - `corr_function`: `"numpy"`, `"numpy_without_mask"`, `"numba"`, or `"pandas"`
132
- - `per_complex.n_jobs`: worker count for per-complex analysis
132
+ - `per_module.n_jobs`: worker count for per-module analysis
133
133
 
134
134
  ### Analysis Flow
135
135
 
@@ -141,16 +141,16 @@ terms, _ = flex.load_functional_standard()
141
141
  for name, dataset in data.items():
142
142
  corr = flex.perform_corr(dataset, config["corr_function"])
143
143
  flex.pra(name, corr, is_corr=True)
144
- flex.pra_percomplex(name, corr, is_corr=True)
145
- flex.complex_contributions(name)
144
+ flex.pra_per_module(name, corr, is_corr=True)
145
+ flex.module_contributions(name)
146
146
  flex.mpr_prepare(name)
147
147
 
148
148
  flex.plot_precision_recall_curve()
149
149
  flex.plot_auc_scores()
150
- flex.plot_significant_complexes()
151
- flex.plot_percomplex_scatter(n_top=10)
152
- flex.plot_percomplex_scatter_bysize(n_top=10)
153
- flex.plot_complex_contributions()
150
+ flex.plot_significant_modules()
151
+ flex.plot_per_module_scatter(n_top=10)
152
+ flex.plot_per_module_scatter_by_size(n_top=10)
153
+ flex.plot_module_contributions()
154
154
  flex.plot_mpr_summary()
155
155
  flex.save_results_to_csv()
156
156
  ```
@@ -28,8 +28,8 @@ inputs = {
28
28
 
29
29
  config = {
30
30
  "functional_standard": "CORUM",
31
- "min_genes_in_complex": 2,
32
- "min_genes_per_complex_analysis": 2,
31
+ "min_genes_in_module": 2,
32
+ "min_genes_per_module_analysis": 2,
33
33
  "output_folder": "output",
34
34
  "analysis_genes": "shared",
35
35
  "jaccard": True,
@@ -37,7 +37,7 @@ config = {
37
37
  "fill_na": True,
38
38
  },
39
39
  "corr_function": "numpy_without_mask",
40
- "per_complex": {
40
+ "per_module": {
41
41
  "n_jobs": 8,
42
42
  },
43
43
  "plotting": {
@@ -53,16 +53,16 @@ terms, _ = flex.load_functional_standard()
53
53
  for name, dataset in data.items():
54
54
  corr = flex.perform_corr(dataset, config["corr_function"])
55
55
  flex.pra(name, corr, is_corr=True)
56
- flex.pra_percomplex(name, corr, is_corr=True)
57
- flex.complex_contributions(name)
56
+ flex.pra_per_module(name, corr, is_corr=True)
57
+ flex.module_contributions(name)
58
58
  flex.mpr_prepare(name)
59
59
 
60
60
  flex.plot_precision_recall_curve()
61
61
  flex.plot_auc_scores()
62
- flex.plot_significant_complexes()
63
- flex.plot_percomplex_scatter(n_top=10)
64
- flex.plot_percomplex_scatter_bysize(n_top=10)
65
- flex.plot_complex_contributions()
62
+ flex.plot_significant_modules()
63
+ flex.plot_per_module_scatter(n_top=10)
64
+ flex.plot_per_module_scatter_by_size(n_top=10)
65
+ flex.plot_module_contributions()
66
66
  flex.plot_mpr_summary()
67
67
  flex.save_results_to_csv()
68
68
  ```
@@ -1,6 +1,6 @@
1
1
  # pFLEX
2
2
 
3
- pFLEX is a Python toolkit for evaluating CRISPR screen and co-essentiality networks against biological functional standards such as CORUM protein complexes, Gene Ontology Biological Processes, and pathways.
3
+ pFLEX is a Python toolkit for evaluating CRISPR screen and co-essentiality networks against biological functional standards such as CORUM-derived modules, Gene Ontology Biological Processes, and pathways.
4
4
 
5
5
  Use pFLEX to:
6
6
 
@@ -56,8 +56,8 @@ Initialize pFLEX once at the start of a run:
56
56
  ```python
57
57
  config = {
58
58
  "functional_standard": "CORUM",
59
- "min_genes_in_complex": 2,
60
- "min_genes_per_complex_analysis": 2,
59
+ "min_genes_in_module": 2,
60
+ "min_genes_per_module_analysis": 2,
61
61
  "output_folder": "output",
62
62
  "analysis_genes": "shared",
63
63
  "jaccard": True,
@@ -65,7 +65,7 @@ config = {
65
65
  "fill_na": True,
66
66
  },
67
67
  "corr_function": "numpy_without_mask",
68
- "per_complex": {
68
+ "per_module": {
69
69
  "n_jobs": 8,
70
70
  },
71
71
  "plotting": {
@@ -83,14 +83,14 @@ flex.initialize(config)
83
83
  Configuration keys:
84
84
 
85
85
  - `functional_standard`: built-in values are `"CORUM"`, `"GOBP"`, and `"PATHWAY"`. You can also provide a custom `.csv` path with a `Genes` column containing semicolon-separated gene symbols.
86
- - `min_genes_in_complex`: minimum number of genes a functional-standard term must contain before dataset-specific filtering.
87
- - `min_genes_per_complex_analysis`: minimum term size for per-complex analysis.
86
+ - `min_genes_in_module`: minimum number of genes a functional-standard term must contain before dataset-specific filtering.
87
+ - `min_genes_per_module_analysis`: minimum term size for per-module analysis.
88
88
  - `output_folder`: folder where plots and exported CSV files are written.
89
89
  - `analysis_genes`: `"shared"` uses only genes common to all loaded datasets; `"dataset_specific"` evaluates each dataset using its own available genes.
90
90
  - `jaccard`: when `True`, removes terms with identical used-gene sets after filtering.
91
91
  - `preprocessing.fill_na`: when `True`, fills missing values with each gene row's mean.
92
92
  - `corr_function`: correlation backend. Use `"numpy_without_mask"` for the fastest run when the matrix has no missing values, `"numpy"` for masked NumPy correlation when missing values may be present, `"numba"` for a compiled missing-value-aware implementation, or `"pandas"` for pandas pairwise-complete correlation that most closely matches R-style missing-value handling. In practice, `"numpy_without_mask"` is fastest but does not handle missing values, `"numpy"` and `"numba"` handle missing values faster than pandas, and `"pandas"` is usually slowest.
93
- - `per_complex.n_jobs`: worker count for per-complex analysis.
93
+ - `per_module.n_jobs`: worker count for per-module analysis.
94
94
  - `plotting.save_plot`: when `True`, saves figures to `output_folder`.
95
95
  - `plotting.output_type`: figure extension, such as `"png"` or `"pdf"`.
96
96
  - `logging.visible_levels`: log levels to print during the run. Available values are `"STARTED"`, `"PROGRESS"`, `"DONE"`, `"INFO"`, `"WARNING"`, and `"ERROR"`. A quiet run can use `["DONE", "WARNING"]`; a more verbose run can use `["STARTED", "PROGRESS", "DONE", "INFO", "WARNING"]`.
@@ -114,7 +114,7 @@ terms, _ = flex.load_functional_standard()
114
114
 
115
115
  - loads the configured functional standard
116
116
  - creates an `all_genes` list for each term
117
- - applies `min_genes_in_complex`
117
+ - applies `min_genes_in_module`
118
118
  - stores the term table for later analysis
119
119
  - returns the loaded term DataFrame and a placeholder second value
120
120
 
@@ -124,8 +124,8 @@ terms, _ = flex.load_functional_standard()
124
124
  for name, dataset in data.items():
125
125
  corr = flex.perform_corr(dataset, config["corr_function"])
126
126
  flex.pra(name, corr, is_corr=True)
127
- flex.pra_percomplex(name, corr, is_corr=True)
128
- flex.complex_contributions(name)
127
+ flex.pra_per_module(name, corr, is_corr=True)
128
+ flex.module_contributions(name)
129
129
  flex.mpr_prepare(name)
130
130
  ```
131
131
 
@@ -140,13 +140,13 @@ for name, dataset in data.items():
140
140
  - returns the pairwise PRA table
141
141
  - stores PRA results, AUPRC, and corrected AUPRC in the run cache
142
142
 
143
- `pra_percomplex(name, matrix, is_corr=True)`:
143
+ `pra_per_module(name, matrix, is_corr=True)`:
144
144
 
145
145
  - evaluates precision-recall performance for each functional-standard term
146
146
  - returns a term-level result table
147
- - stores per-complex AUPRC values for plotting and export
147
+ - stores per-module AUPRC values for plotting and export
148
148
 
149
- `complex_contributions(name)`:
149
+ `module_contributions(name)`:
150
150
 
151
151
  - estimates which terms contribute most to true-positive gene pairs
152
152
  - returns a contribution table
@@ -164,10 +164,10 @@ for name, dataset in data.items():
164
164
  ```python
165
165
  flex.plot_precision_recall_curve()
166
166
  flex.plot_auc_scores()
167
- flex.plot_significant_complexes()
168
- flex.plot_percomplex_scatter(n_top=10)
169
- flex.plot_percomplex_scatter_bysize(n_top=10)
170
- flex.plot_complex_contributions()
167
+ flex.plot_significant_modules()
168
+ flex.plot_per_module_scatter(n_top=10)
169
+ flex.plot_per_module_scatter_by_size(n_top=10)
170
+ flex.plot_module_contributions()
171
171
  flex.plot_mpr_summary()
172
172
  flex.save_results_to_csv()
173
173
  ```
@@ -179,24 +179,24 @@ Global plots:
179
179
  - `plot_precision_recall_curve(line_width=2.0, hide_minor_ticks=True)` shows precision against the cumulative number of true-positive gene pairs. This is the main global performance curve; higher precision at the same true-positive count means better ranking.
180
180
  - `plot_auc_scores()` shows one bar per dataset using the global AUPRC value saved by `pra()`. Higher AUPRC means the ranked gene-pair network recovers functional-standard pairs earlier in the ranking.
181
181
 
182
- Per-complex plots:
182
+ Per-module plots:
183
183
 
184
- - `plot_significant_complexes()` counts how many functional-standard terms pass AUPRC thresholds `0.1`, `0.2`, `0.3`, `0.4`, and `0.5`. It returns the threshold-by-dataset count table, which helps compare how many terms are strongly recovered in each dataset.
185
- - `plot_percomplex_scatter(n_top=10, ...)` compares per-complex AUPRC values between pairs of datasets. Each point is one functional-standard term. Points near the diagonal perform similarly in both datasets; points far from the diagonal are terms that are stronger in one dataset.
186
- - `plot_percomplex_scatter_bysize(n_labels=10, n_top=10, ...)` plots each term's per-complex AUPRC against the number of genes used for that term. It helps distinguish compact high-performing terms from broader modules.
187
- - `plot_complex_contributions(min_pairs=10, min_precision_cutoff=0.5, num_complex_to_show=10, ...)` shows which terms contribute most to true-positive gene pairs across precision cutoffs. It requires `complex_contributions(name)` first and helps identify which biological terms drive the global precision-recall curve.
184
+ - `plot_significant_modules()` counts how many functional-standard terms pass AUPRC thresholds `0.1`, `0.2`, `0.3`, `0.4`, and `0.5`. It returns the threshold-by-dataset count table, which helps compare how many terms are strongly recovered in each dataset.
185
+ - `plot_per_module_scatter(n_top=10, ...)` compares per-module AUPRC values between pairs of datasets. Each point is one functional-standard term. Points near the diagonal perform similarly in both datasets; points far from the diagonal are terms that are stronger in one dataset.
186
+ - `plot_per_module_scatter_by_size(n_labels=10, n_top=10, ...)` plots each term's per-module AUPRC against the number of genes used for that term. It helps distinguish compact high-performing terms from broader modules.
187
+ - `plot_module_contributions(min_pairs=10, min_precision_cutoff=0.5, num_module_to_show=10, ...)` shows which terms contribute most to true-positive gene pairs across precision cutoffs. It requires `module_contributions(name)` first and helps identify which biological terms drive the global precision-recall curve.
188
188
 
189
189
  mPR preparation and plots:
190
190
 
191
- - `mpr_prepare(name, size_th=30, auprc_th=0.4, tp_th=1, percent_th=0.1, use_corrected=True)` prepares module-level PR data for one dataset. It filters terms for module-level analysis, stores true-positive curves, complex-coverage curves, filtered variants, and mPR AUC values.
191
+ - `mpr_prepare(name, size_th=30, auprc_th=0.4, tp_th=1, percent_th=0.1, use_corrected=True)` prepares module-level PR data for one dataset. It filters terms for module-level analysis, stores true-positive curves, module-coverage curves, filtered variants, and mPR AUC values.
192
192
  - `plot_mpr_tp_multi(dataset_names=None, colors=None, linewidth=1.8, show_filters=("all", "no_mtRibo_ETCI", "no_small_highAUPRC"))` shows true positives versus precision for one or more datasets after `mpr_prepare()`. This plot shows how many true-positive gene pairs are recovered as the precision cutoff changes.
193
- - `plot_mpr_complexes_multi(dataset_names=None, colors=None, linewidth=1.8, show_filters=("all", "no_mtRibo_ETCI", "no_small_highAUPRC"), show_markers="auto")` shows how many functional-standard terms are covered at each precision cutoff. This plot focuses on term coverage, not pair counts.
194
- - `plot_mpr_summary(dataset_names=None, colors=None, variants="unfiltered", save=True, linewidth=1.8, show_markers="auto")` creates the standard mPR true-positive, complex-coverage, and mPR AUC summary plots in one call.
193
+ - `plot_mpr_modules_multi(dataset_names=None, colors=None, linewidth=1.8, show_filters=("all", "no_mtRibo_ETCI", "no_small_highAUPRC"), show_markers="auto")` shows how many functional-standard terms are covered at each precision cutoff. This plot focuses on term coverage, not pair counts.
194
+ - `plot_mpr_summary(dataset_names=None, colors=None, variants="unfiltered", save=True, linewidth=1.8, show_markers="auto")` creates the standard mPR true-positive, module-coverage, and mPR AUC summary plots in one call.
195
195
  - Newer mPR functions also accept `variants`, with values `"unfiltered"`, `"without_mt_ribo_etci"`, `"without_small_high_auprc"`, or `"all"`.
196
196
 
197
197
  Export:
198
198
 
199
- - `save_results_to_csv()` exports cached tables such as global AUPRC values, per-complex results, contribution tables, and mPR summaries to `output_folder/csv`.
199
+ - `save_results_to_csv()` exports cached tables such as global AUPRC values, per-module results, contribution tables, and mPR summaries to `output_folder/csv`.
200
200
  - Plot files are saved directly under `output_folder` when `plotting.save_plot` or the function-level `save` argument is enabled.
201
201
 
202
202
  ## Temporary Files
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "pflex"
3
- version = "1.1"
4
- description = "pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological functional standards. The toolkit computes gene-level and complex-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data."
3
+ version = "1.2"
4
+ description = "pflex is a benchmarking toolkit for evaluating CRISPR screen results against biological functional standards. The toolkit computes gene-level and module-level performance metrics, helping researchers systematically assess the biological relevance and resolution of their CRISPR screening data."
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Yasir Demirtas", email = "tyasird@hotmail.com" }
@@ -1,12 +1,12 @@
1
1
  from .logging_config import log
2
2
  from .utils import dsave, dload
3
3
  from .preprocessing import example_input_path, get_example_data_path, load_datasets, get_common_genes, filter_matrix_by_genes, load_functional_standard, filter_duplicate_terms
4
- from .analysis import initialize, prepare_terms_for_dataset, pra, pra_percomplex, fast_corr, perform_corr, is_symmetric, binary, has_mirror_of_first_pair, convert_full_to_half_matrix, drop_mirror_pairs, quick_sort, complex_contributions, save_results_to_csv, update_matploblib_config, mpr_prepare
4
+ from .analysis import initialize, prepare_terms_for_dataset, pra, pra_per_module, fast_corr, perform_corr, is_symmetric, binary, has_mirror_of_first_pair, convert_full_to_half_matrix, drop_mirror_pairs, quick_sort, module_contributions, save_results_to_csv, update_matploblib_config, mpr_prepare
5
5
  from .plotting import (
6
- adjust_text_positions, plot_precision_recall_curve, plot_aggregated_pra, plot_iqr_pra, plot_all_runs_pra, plot_percomplex_scatter,
7
- plot_percomplex_scatter_bysize, plot_complex_contributions, plot_significant_complexes, plot_auc_scores,
8
- plot_mpr_tp, plot_mpr_complexes, plot_mpr_tp_multi, plot_mpr_complexes_multi, plot_mpr_complexes_auc_scores,
9
- plot_mpr_true_positive_curve, plot_mpr_complex_coverage_curve, plot_mpr_complex_auc_scores, plot_mpr_summary
6
+ adjust_text_positions, plot_precision_recall_curve, plot_aggregated_pra, plot_iqr_pra, plot_all_runs_pra, plot_per_module_scatter,
7
+ plot_per_module_scatter_by_size, plot_module_contributions, plot_significant_modules, plot_auc_scores,
8
+ plot_mpr_tp, plot_mpr_modules, plot_mpr_tp_multi, plot_mpr_modules_multi, plot_mpr_modules_auc_scores,
9
+ plot_mpr_true_positive_curve, plot_mpr_module_coverage_curve, plot_mpr_module_auc_scores, plot_mpr_summary
10
10
  )
11
11
 
12
12
  def main():
@@ -32,13 +32,13 @@ def main():
32
32
 
33
33
  __all__ = [ "log", "example_input_path", "get_example_data_path", "fast_corr",
34
34
  "initialize", "dsave", "dload", "load_datasets", "get_common_genes",
35
- "filter_matrix_by_genes", "load_functional_standard", "filter_duplicate_terms", "pra", "pra_percomplex",
35
+ "filter_matrix_by_genes", "load_functional_standard", "filter_duplicate_terms", "pra", "pra_per_module",
36
36
  "prepare_terms_for_dataset",
37
37
  "perform_corr", "is_symmetric", "binary", "has_mirror_of_first_pair", "convert_full_to_half_matrix",
38
- "drop_mirror_pairs", "quick_sort", "complex_contributions", "adjust_text_positions", "plot_precision_recall_curve",
39
- "plot_aggregated_pra", "plot_iqr_pra", "plot_all_runs_pra", "plot_percomplex_scatter", "plot_percomplex_scatter_bysize", "plot_complex_contributions",
40
- "plot_significant_complexes", "plot_auc_scores", "plot_mpr_complexes_auc_scores", "plot_mpr_complex_auc_scores", "save_results_to_csv", "update_matploblib_config",
41
- "mpr_prepare", "plot_mpr_tp", "plot_mpr_complexes",
42
- "plot_mpr_tp_multi", "plot_mpr_complexes_multi", "plot_mpr_true_positive_curve",
43
- "plot_mpr_complex_coverage_curve", "plot_mpr_summary", "main"
38
+ "drop_mirror_pairs", "quick_sort", "module_contributions", "adjust_text_positions", "plot_precision_recall_curve",
39
+ "plot_aggregated_pra", "plot_iqr_pra", "plot_all_runs_pra", "plot_per_module_scatter", "plot_per_module_scatter_by_size", "plot_module_contributions",
40
+ "plot_significant_modules", "plot_auc_scores", "plot_mpr_modules_auc_scores", "plot_mpr_module_auc_scores", "save_results_to_csv", "update_matploblib_config",
41
+ "mpr_prepare", "plot_mpr_tp", "plot_mpr_modules",
42
+ "plot_mpr_tp_multi", "plot_mpr_modules_multi", "plot_mpr_true_positive_curve",
43
+ "plot_mpr_module_coverage_curve", "plot_mpr_summary", "main"
44
44
  ]