pheval 0.5.3__tar.gz → 0.5.5__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.
Potentially problematic release.
This version of pheval might be problematic. Click here for more details.
- {pheval-0.5.3 → pheval-0.5.5}/PKG-INFO +1 -1
- {pheval-0.5.3 → pheval-0.5.5}/pyproject.toml +1 -1
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/rank_stats.py +13 -37
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/post_processing.py +4 -12
- {pheval-0.5.3 → pheval-0.5.5}/LICENSE +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/README.md +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark_db_manager.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark_output_type.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/binary_classification_curves.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/binary_classification_stats.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/generate_plots.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/generate_rank_comparisons.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/run_data_parser.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli_pheval.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli_pheval_utils.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/config_parser.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/implementations/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/infra/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/infra/exomiserdb.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/phenopacket_truth_set.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/validate_result_format.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/create_noisy_phenopackets.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/create_spiked_vcf.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/custom_exceptions.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/prepare_corpus.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/update_phenopacket.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/CADA_results.txt +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/DeepPVP_results.txt +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/OVA_results.txt +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/Phen2Gene_results.json +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/Phenolyzer_results.txt +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/lirical_results.tsv +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/svanna_results.tsv +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/hgnc_complete_set.txt +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/run_metadata.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/runners/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/runners/runner.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/__init__.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/docs_gen.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/docs_gen.sh +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/exomiser.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/file_utils.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/logger.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/phenopacket_utils.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/semsim_utils.py +0 -0
- {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/utils.py +0 -0
|
@@ -124,24 +124,11 @@ class Ranks:
|
|
|
124
124
|
return np.mean(precision_at_k)
|
|
125
125
|
|
|
126
126
|
@classmethod
|
|
127
|
-
def mean_average_precision_at_k(cls, df: pl.LazyFrame, k: int) ->
|
|
128
|
-
"""
|
|
129
|
-
Compute Mean Average Precision at K (MAP@K) by averaging AP@K scores.
|
|
130
|
-
Args:
|
|
131
|
-
df (pl.LazyFrame): The dataframe calculate MAP@K for each query.
|
|
132
|
-
k (int): The upper rank limit.
|
|
133
|
-
Returns:
|
|
134
|
-
pl.LazyFrame: The dataframe with MAP@K for each query.
|
|
135
|
-
"""
|
|
127
|
+
def mean_average_precision_at_k(cls, df: pl.LazyFrame, k: int) -> float:
|
|
136
128
|
ap_at_k_df = cls._average_precision_at_k(df, k)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
.fill_null(0.0)
|
|
142
|
-
.collect()
|
|
143
|
-
.item()
|
|
144
|
-
)
|
|
129
|
+
ap_sum = ap_at_k_df.select(pl.col(f"ap@{k}").sum()).collect().item()
|
|
130
|
+
num_samples = df.select(Ranks.NUMBER_OF_SAMPLES).collect().item()
|
|
131
|
+
return ap_sum / num_samples
|
|
145
132
|
|
|
146
133
|
@classmethod
|
|
147
134
|
def _calculate_ndcg_at_k(cls, ranks: List[int], k: int) -> float:
|
|
@@ -165,29 +152,18 @@ class Ranks:
|
|
|
165
152
|
)
|
|
166
153
|
|
|
167
154
|
@classmethod
|
|
168
|
-
def mean_normalised_discounted_cumulative_gain(cls, df: pl.LazyFrame, k: int) ->
|
|
169
|
-
"""
|
|
170
|
-
Compute mean normalised discounted cumulative gain.
|
|
171
|
-
Args:
|
|
172
|
-
df (pl.LazyFrame): The dataframe to calculate mean normalised cumulative gain.
|
|
173
|
-
k (int): The upper rank limit.
|
|
174
|
-
Returns:
|
|
175
|
-
pl.LazyFrame: The dataframe with mean normalised cumulative gain.
|
|
176
|
-
"""
|
|
155
|
+
def mean_normalised_discounted_cumulative_gain(cls, df: pl.LazyFrame, k: int) -> float:
|
|
177
156
|
filtered_df = cls._filter_results(df, k)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.
|
|
182
|
-
lambda row: cls._calculate_ndcg_at_k(row["ranks"], k), return_dtype=pl.Float64
|
|
183
|
-
)
|
|
184
|
-
.alias(f"NDCG@{k}")
|
|
157
|
+
ndcg_df = filtered_df.with_columns(
|
|
158
|
+
pl.struct("ranks")
|
|
159
|
+
.map_elements(
|
|
160
|
+
lambda row: cls._calculate_ndcg_at_k(row["ranks"], k), return_dtype=pl.Float64
|
|
185
161
|
)
|
|
186
|
-
.
|
|
187
|
-
.fill_null(0.0)
|
|
188
|
-
.collect()
|
|
189
|
-
.item()
|
|
162
|
+
.alias(f"NDCG@{k}")
|
|
190
163
|
)
|
|
164
|
+
ndcg_sum = ndcg_df.select(pl.col(f"NDCG@{k}").sum()).collect().item()
|
|
165
|
+
num_samples = df.select(Ranks.NUMBER_OF_SAMPLES).collect().item()
|
|
166
|
+
return ndcg_sum / num_samples
|
|
191
167
|
|
|
192
168
|
|
|
193
169
|
def compute_rank_stats(run_identifier: str, result_scan: pl.LazyFrame) -> pl.LazyFrame:
|
|
@@ -151,6 +151,10 @@ def create_empty_pheval_result(
|
|
|
151
151
|
"""
|
|
152
152
|
if result_type in executed_results:
|
|
153
153
|
return
|
|
154
|
+
logger.info(
|
|
155
|
+
f"Writing classified results for {len(all_files(phenopacket_dir))} "
|
|
156
|
+
f"phenopackets to {output_dir}"
|
|
157
|
+
)
|
|
154
158
|
executed_results.add(result_type)
|
|
155
159
|
phenopacket_truth_set = PhenopacketTruthSet(phenopacket_dir)
|
|
156
160
|
classify_method, write_method = _get_result_type(result_type, phenopacket_truth_set)
|
|
@@ -180,10 +184,6 @@ def generate_gene_result(
|
|
|
180
184
|
phenopacket_dir (Path): Path to the Phenopacket directory
|
|
181
185
|
"""
|
|
182
186
|
output_file = output_dir.joinpath(f"pheval_gene_results/{result_path.stem}-gene_result.parquet")
|
|
183
|
-
logger.info(
|
|
184
|
-
f"Writing classified results for {len(all_files(phenopacket_dir))} "
|
|
185
|
-
f"phenopackets to {output_dir.joinpath('pheval_gene_results')}"
|
|
186
|
-
)
|
|
187
187
|
create_empty_pheval_result(
|
|
188
188
|
phenopacket_dir, output_dir.joinpath("pheval_gene_results"), ResultType.GENE
|
|
189
189
|
)
|
|
@@ -214,10 +214,6 @@ def generate_variant_result(
|
|
|
214
214
|
output_file = output_dir.joinpath(
|
|
215
215
|
f"pheval_variant_results/{result_path.stem}-variant_result.parquet"
|
|
216
216
|
)
|
|
217
|
-
logger.info(
|
|
218
|
-
f"Writing classified results for {len(all_files(phenopacket_dir))} "
|
|
219
|
-
f"phenopackets to {output_dir.joinpath('pheval_variant_results')}"
|
|
220
|
-
)
|
|
221
217
|
create_empty_pheval_result(
|
|
222
218
|
phenopacket_dir, output_dir.joinpath("pheval_variant_results"), ResultType.VARIANT
|
|
223
219
|
)
|
|
@@ -250,10 +246,6 @@ def generate_disease_result(
|
|
|
250
246
|
output_file = output_dir.joinpath(
|
|
251
247
|
f"pheval_disease_results/{result_path.stem}-disease_result.parquet"
|
|
252
248
|
)
|
|
253
|
-
logger.info(
|
|
254
|
-
f"Writing classified results for {len(all_files(phenopacket_dir))} "
|
|
255
|
-
f"phenopackets to {output_dir.joinpath('pheval_disease_results')}"
|
|
256
|
-
)
|
|
257
249
|
create_empty_pheval_result(
|
|
258
250
|
phenopacket_dir, output_dir.joinpath("pheval_disease_results"), ResultType.DISEASE
|
|
259
251
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|