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.

Files changed (52) hide show
  1. {pheval-0.5.3 → pheval-0.5.5}/PKG-INFO +1 -1
  2. {pheval-0.5.3 → pheval-0.5.5}/pyproject.toml +1 -1
  3. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/rank_stats.py +13 -37
  4. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/post_processing.py +4 -12
  5. {pheval-0.5.3 → pheval-0.5.5}/LICENSE +0 -0
  6. {pheval-0.5.3 → pheval-0.5.5}/README.md +0 -0
  7. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/__init__.py +0 -0
  8. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/__init__.py +0 -0
  9. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark.py +0 -0
  10. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark_db_manager.py +0 -0
  11. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/benchmark_output_type.py +0 -0
  12. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/binary_classification_curves.py +0 -0
  13. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/binary_classification_stats.py +0 -0
  14. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/generate_plots.py +0 -0
  15. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/generate_rank_comparisons.py +0 -0
  16. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/analyse/run_data_parser.py +0 -0
  17. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli.py +0 -0
  18. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli_pheval.py +0 -0
  19. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/cli_pheval_utils.py +0 -0
  20. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/config_parser.py +0 -0
  21. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/implementations/__init__.py +0 -0
  22. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/infra/__init__.py +0 -0
  23. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/infra/exomiserdb.py +0 -0
  24. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/__init__.py +0 -0
  25. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/phenopacket_truth_set.py +0 -0
  26. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/post_processing/validate_result_format.py +0 -0
  27. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/__init__.py +0 -0
  28. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/create_noisy_phenopackets.py +0 -0
  29. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/create_spiked_vcf.py +0 -0
  30. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/custom_exceptions.py +0 -0
  31. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/prepare_corpus.py +0 -0
  32. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/prepare/update_phenopacket.py +0 -0
  33. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/CADA_results.txt +0 -0
  34. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/DeepPVP_results.txt +0 -0
  35. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/OVA_results.txt +0 -0
  36. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/Phen2Gene_results.json +0 -0
  37. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/Phenolyzer_results.txt +0 -0
  38. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/lirical_results.tsv +0 -0
  39. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/alternate_ouputs/svanna_results.tsv +0 -0
  40. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/resources/hgnc_complete_set.txt +0 -0
  41. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/run_metadata.py +0 -0
  42. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/runners/__init__.py +0 -0
  43. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/runners/runner.py +0 -0
  44. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/__init__.py +0 -0
  45. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/docs_gen.py +0 -0
  46. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/docs_gen.sh +0 -0
  47. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/exomiser.py +0 -0
  48. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/file_utils.py +0 -0
  49. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/logger.py +0 -0
  50. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/phenopacket_utils.py +0 -0
  51. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/semsim_utils.py +0 -0
  52. {pheval-0.5.3 → pheval-0.5.5}/src/pheval/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pheval
3
- Version: 0.5.3
3
+ Version: 0.5.5
4
4
  Summary:
5
5
  Author: Yasemin Bridges
6
6
  Author-email: y.bridges@qmul.ac.uk
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pheval"
3
- version = "0.5.3"
3
+ version = "0.5.5"
4
4
  description = ""
5
5
  authors = ["Yasemin Bridges <y.bridges@qmul.ac.uk>",
6
6
  "Julius Jacobsen <j.jacobsen@qmul.ac.uk>",
@@ -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) -> pl.LazyFrame:
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
- return (
138
- ap_at_k_df.select(
139
- pl.col(f"ap@{k}").sum() / df.select(Ranks.NUMBER_OF_SAMPLES).collect()
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) -> pl.Float64:
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
- return (
179
- filtered_df.with_columns(
180
- pl.struct("ranks")
181
- .map_elements(
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
- .select(pl.col(f"NDCG@{k}").sum() / df.select(Ranks.NUMBER_OF_SAMPLES).collect())
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