pheval 0.4.2__tar.gz → 0.4.4__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 (56) hide show
  1. {pheval-0.4.2 → pheval-0.4.4}/PKG-INFO +2 -2
  2. {pheval-0.4.2 → pheval-0.4.4}/pyproject.toml +1 -1
  3. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/benchmark_db_manager.py +1 -0
  4. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/disease_prioritisation_analysis.py +18 -7
  5. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/gene_prioritisation_analysis.py +18 -7
  6. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/generate_plots.py +17 -2
  7. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/variant_prioritisation_analysis.py +18 -9
  8. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/prepare_corpus.py +6 -2
  9. {pheval-0.4.2 → pheval-0.4.4}/LICENSE +0 -0
  10. {pheval-0.4.2 → pheval-0.4.4}/README.md +0 -0
  11. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/__init__.py +0 -0
  12. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/__init__.py +0 -0
  13. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/analysis.py +0 -0
  14. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/assess_prioritisation_base.py +0 -0
  15. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/benchmark_generator.py +0 -0
  16. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/benchmarking_data.py +0 -0
  17. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/binary_classification_stats.py +0 -0
  18. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/generate_summary_outputs.py +0 -0
  19. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/parse_benchmark_summary.py +0 -0
  20. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/parse_corpus.py +0 -0
  21. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/prioritisation_result_types.py +0 -0
  22. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/rank_stats.py +0 -0
  23. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/analyse/run_data_parser.py +0 -0
  24. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/cli.py +0 -0
  25. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/cli_pheval.py +0 -0
  26. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/cli_pheval_utils.py +0 -0
  27. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/config_parser.py +0 -0
  28. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/implementations/__init__.py +0 -0
  29. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/infra/__init__.py +0 -0
  30. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/infra/exomiserdb.py +0 -0
  31. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/post_processing/__init__.py +0 -0
  32. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/post_processing/post_processing.py +0 -0
  33. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/__init__.py +0 -0
  34. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/create_noisy_phenopackets.py +0 -0
  35. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/create_spiked_vcf.py +0 -0
  36. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/custom_exceptions.py +0 -0
  37. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/prepare/update_phenopacket.py +0 -0
  38. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/CADA_results.txt +0 -0
  39. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/DeepPVP_results.txt +0 -0
  40. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/OVA_results.txt +0 -0
  41. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/Phen2Gene_results.json +0 -0
  42. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/Phenolyzer_results.txt +0 -0
  43. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/lirical_results.tsv +0 -0
  44. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/alternate_ouputs/svanna_results.tsv +0 -0
  45. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/resources/hgnc_complete_set.txt +0 -0
  46. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/run_metadata.py +0 -0
  47. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/runners/__init__.py +0 -0
  48. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/runners/runner.py +0 -0
  49. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/__init__.py +0 -0
  50. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/docs_gen.py +0 -0
  51. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/docs_gen.sh +0 -0
  52. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/exomiser.py +0 -0
  53. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/file_utils.py +0 -0
  54. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/phenopacket_utils.py +0 -0
  55. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/semsim_utils.py +0 -0
  56. {pheval-0.4.2 → pheval-0.4.4}/src/pheval/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: pheval
3
- Version: 0.4.2
3
+ Version: 0.4.4
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.4.2"
3
+ version = "0.4.4"
4
4
  description = ""
5
5
  authors = ["Yasemin Bridges <y.bridges@qmul.ac.uk>",
6
6
  "Julius Jacobsen <j.jacobsen@qmul.ac.uk>",
@@ -75,6 +75,7 @@ class BenchmarkDBManager:
75
75
  `False` otherwise.
76
76
  """
77
77
  list_pattern = re.compile(r"^\[\s*(?:[^\[\],\s]+(?:\s*,\s*[^\[\],\s]+)*)?\s*]$")
78
+ entity = entity.replace("nan", "None").replace("NaN", "None")
78
79
  if list_pattern.match(str(entity)):
79
80
  list_representation = ast.literal_eval(entity)
80
81
  if isinstance(list_representation, list):
@@ -38,11 +38,16 @@ class AssessDiseasePrioritisation(AssessPrioritisationBase):
38
38
  for _i, row in df.iterrows():
39
39
  result = (
40
40
  self.conn.execute(
41
- f"SELECT * FROM '{standardised_disease_result_path}' "
42
- f"WHERE contains_entity_function(CAST(COALESCE(disease_identifier, '') AS VARCHAR),"
43
- f" '{row['disease_identifier']}') "
44
- f"OR contains_entity_function(CAST(COALESCE(disease_name, '') AS VARCHAR), "
45
- f"'{row['disease_name']}')"
41
+ (
42
+ f"SELECT * FROM '{standardised_disease_result_path}' "
43
+ f"WHERE contains_entity_function(CAST(COALESCE(disease_identifier, '') AS VARCHAR),"
44
+ f" '{row['disease_identifier']}') "
45
+ f"OR contains_entity_function(CAST(COALESCE(disease_name, '') AS VARCHAR), "
46
+ f"'{row['disease_name']}')"
47
+ )
48
+ if standardised_disease_result_path.exists()
49
+ and standardised_disease_result_path.stat().st_size > 0
50
+ else "SELECT NULL WHERE FALSE"
46
51
  )
47
52
  .fetchdf()
48
53
  .to_dict(orient="records")
@@ -56,9 +61,15 @@ class AssessDiseasePrioritisation(AssessPrioritisationBase):
56
61
  f'UPDATE {self.table_name} SET "{self.column}" = ? WHERE identifier = ?',
57
62
  (disease_match, primary_key),
58
63
  )
64
+ elif len(result) == 0:
65
+ relevant_ranks.append(0)
59
66
  binary_classification_stats.add_classification(
60
- self.db_connection.parse_table_into_dataclass(
61
- str(standardised_disease_result_path), RankedPhEvalDiseaseResult
67
+ (
68
+ self.db_connection.parse_table_into_dataclass(
69
+ str(standardised_disease_result_path), RankedPhEvalDiseaseResult
70
+ )
71
+ if standardised_disease_result_path.exists()
72
+ else []
62
73
  ),
63
74
  relevant_ranks,
64
75
  )
@@ -36,11 +36,16 @@ class AssessGenePrioritisation(AssessPrioritisationBase):
36
36
  for _i, row in df.iterrows():
37
37
  result = (
38
38
  self.conn.execute(
39
- f"SELECT * FROM '{standardised_gene_result_path}' "
40
- f"WHERE contains_entity_function(CAST(COALESCE(gene_identifier, '') AS VARCHAR),"
41
- f" '{row['gene_identifier']}') "
42
- f"OR contains_entity_function(CAST(COALESCE(gene_symbol, '') AS VARCHAR), "
43
- f"'{row['gene_symbol']}')"
39
+ (
40
+ f"SELECT * FROM '{standardised_gene_result_path}' "
41
+ f"WHERE contains_entity_function(CAST(COALESCE(gene_identifier, '') AS VARCHAR), "
42
+ f"'{row['gene_identifier']}') "
43
+ f"OR contains_entity_function(CAST(COALESCE(gene_symbol, '') AS VARCHAR), "
44
+ f"'{row['gene_symbol']}')"
45
+ )
46
+ if standardised_gene_result_path.exists()
47
+ and standardised_gene_result_path.stat().st_size > 0
48
+ else "SELECT NULL WHERE FALSE"
44
49
  )
45
50
  .fetchdf()
46
51
  .to_dict(orient="records")
@@ -53,9 +58,15 @@ class AssessGenePrioritisation(AssessPrioritisationBase):
53
58
  f'UPDATE {self.table_name} SET "{self.column}" = ? WHERE identifier = ?',
54
59
  (gene_match, primary_key),
55
60
  )
61
+ if not result:
62
+ relevant_ranks.append(0)
56
63
  binary_classification_stats.add_classification(
57
- self.db_connection.parse_table_into_dataclass(
58
- str(standardised_gene_result_path), RankedPhEvalGeneResult
64
+ (
65
+ self.db_connection.parse_table_into_dataclass(
66
+ str(standardised_gene_result_path), RankedPhEvalGeneResult
67
+ )
68
+ if standardised_gene_result_path.exists()
69
+ else []
59
70
  ),
60
71
  relevant_ranks,
61
72
  )
@@ -2,6 +2,7 @@ from pathlib import Path
2
2
  from typing import List
3
3
 
4
4
  import matplotlib
5
+ import numpy as np
5
6
  import pandas as pd
6
7
  import seaborn as sns
7
8
  from matplotlib import pyplot as plt
@@ -368,9 +369,16 @@ class PlotGenerator:
368
369
  """
369
370
  plt.clf()
370
371
  for i, benchmark_result in enumerate(benchmarking_results):
372
+ y_score = np.array(benchmark_result.binary_classification_stats.scores)
373
+ y_score = np.nan_to_num(
374
+ y_score,
375
+ nan=0.0,
376
+ posinf=max(y_score[np.isfinite(y_score)]),
377
+ neginf=min(y_score[np.isfinite(y_score)]),
378
+ )
371
379
  fpr, tpr, thresh = roc_curve(
372
380
  benchmark_result.binary_classification_stats.labels,
373
- benchmark_result.binary_classification_stats.scores,
381
+ y_score,
374
382
  pos_label=1,
375
383
  )
376
384
  roc_auc = auc(fpr, tpr)
@@ -411,9 +419,16 @@ class PlotGenerator:
411
419
  plt.clf()
412
420
  plt.figure()
413
421
  for i, benchmark_result in enumerate(benchmarking_results):
422
+ y_score = np.array(benchmark_result.binary_classification_stats.scores)
423
+ y_score = np.nan_to_num(
424
+ y_score,
425
+ nan=0.0,
426
+ posinf=max(y_score[np.isfinite(y_score)]),
427
+ neginf=min(y_score[np.isfinite(y_score)]),
428
+ )
414
429
  precision, recall, thresh = precision_recall_curve(
415
430
  benchmark_result.binary_classification_stats.labels,
416
- benchmark_result.binary_classification_stats.scores,
431
+ y_score,
417
432
  )
418
433
  precision_recall_auc = auc(recall, precision)
419
434
  plt.plot(
@@ -44,12 +44,16 @@ class AssessVariantPrioritisation(AssessPrioritisationBase):
44
44
  )
45
45
  result = (
46
46
  self.conn.execute(
47
- f"SELECT * FROM '{standardised_variant_result_path}' "
48
- f"WHERE "
49
- f"chromosome == '{causative_variant.chrom}' AND "
50
- f"start == {causative_variant.pos} AND "
51
- f"ref == '{causative_variant.ref}' AND "
52
- f"alt == '{causative_variant.alt}'"
47
+ (
48
+ f"SELECT * FROM '{standardised_variant_result_path}' "
49
+ f"WHERE "
50
+ f"chromosome == '{causative_variant.chrom}' AND "
51
+ f"start == {causative_variant.pos} AND "
52
+ f"ref == '{causative_variant.ref}' AND "
53
+ f"alt == '{causative_variant.alt}'"
54
+ )
55
+ if standardised_variant_result_path.exists()
56
+ else "SELECT NULL WHERE FALSE"
53
57
  )
54
58
  .fetchdf()
55
59
  .to_dict(orient="records")
@@ -66,10 +70,15 @@ class AssessVariantPrioritisation(AssessPrioritisationBase):
66
70
  f'UPDATE {self.table_name} SET "{self.column}" = ? WHERE identifier = ?',
67
71
  (variant_match, primary_key),
68
72
  )
69
-
73
+ elif len(result) == 0:
74
+ relevant_ranks.append(0)
70
75
  binary_classification_stats.add_classification(
71
- self.db_connection.parse_table_into_dataclass(
72
- str(standardised_variant_result_path), RankedPhEvalVariantResult
76
+ (
77
+ self.db_connection.parse_table_into_dataclass(
78
+ str(standardised_variant_result_path), RankedPhEvalVariantResult
79
+ )
80
+ if standardised_variant_result_path.exists()
81
+ else []
73
82
  ),
74
83
  relevant_ranks,
75
84
  )
@@ -90,6 +90,10 @@ def prepare_corpus(
90
90
  )
91
91
  else:
92
92
  # if not updating phenopacket gene identifiers then copy phenopacket as is to output directory
93
- shutil.copy(
94
- phenopacket_path, output_dir.joinpath(f"phenopackets/{phenopacket_path.name}")
93
+ (
94
+ shutil.copy(
95
+ phenopacket_path, output_dir.joinpath(f"phenopackets/{phenopacket_path.name}")
96
+ )
97
+ if phenopacket_path != output_dir.joinpath(f"phenopackets/{phenopacket_path.name}")
98
+ else None
95
99
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes