phc-ingestion 0.8.26__tar.gz → 0.8.27__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 (59) hide show
  1. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/PKG-INFO +1 -1
  2. phc-ingestion-0.8.27/ingestion/nextgen/util/nextgen_specific_genes.py +28 -0
  3. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/process_structural.py +21 -9
  4. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/pyproject.toml +1 -1
  5. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/PYPI.md +0 -0
  6. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/__init__.py +0 -0
  7. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/__init__.py +0 -0
  8. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/process.py +0 -0
  9. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/__init__.py +0 -0
  10. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/cnv.py +0 -0
  11. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/detect_genome_ref.py +0 -0
  12. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/ga4gh.py +0 -0
  13. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/hla.py +0 -0
  14. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/ihc.py +0 -0
  15. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/interpretation.py +0 -0
  16. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/json.py +0 -0
  17. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/metadata.py +0 -0
  18. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/specimen_details.py +0 -0
  19. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/structural.py +0 -0
  20. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/tar.py +0 -0
  21. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/tests.py +0 -0
  22. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/tmb.py +0 -0
  23. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/tsv.py +0 -0
  24. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/caris/util/vcf.py +0 -0
  25. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/__init__.py +0 -0
  26. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/process.py +0 -0
  27. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/__init__.py +0 -0
  28. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/cnv.py +0 -0
  29. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/fnv.py +0 -0
  30. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/ga4gh.py +0 -0
  31. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/interpretation.py +0 -0
  32. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/foundation/util/vcf_etl.py +0 -0
  33. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/generic/__init__.py +0 -0
  34. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/generic/process.py +0 -0
  35. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/generic/utils.py +0 -0
  36. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/__init__.py +0 -0
  37. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/process.py +0 -0
  38. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/alteration_table.py +0 -0
  39. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/interpretation.py +0 -0
  40. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/manifest_helpers.py +0 -0
  41. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/pre_filter_somatic_vcf.py +0 -0
  42. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/process_cnv.py +0 -0
  43. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/process_manifest.py +0 -0
  44. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/process_vcf.py +0 -0
  45. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/nextgen/util/types.py +0 -0
  46. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/resources/GRCh37_map.csv.gz +0 -0
  47. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/resources/GRCh38_map.csv.gz +0 -0
  48. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/shared_util/__init__.py +0 -0
  49. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/shared_util/coords_to_genes.py +0 -0
  50. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/shared_util/gene_to_coords.py +0 -0
  51. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/shared_util/open_maybe_gzipped.py +0 -0
  52. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/shared_util/types.py +0 -0
  53. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/Variant.py +0 -0
  54. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/__init__.py +0 -0
  55. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/standardize.py +0 -0
  56. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/util/__init__.py +0 -0
  57. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/util/af_helpers.py +0 -0
  58. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/util/dp_helpers.py +0 -0
  59. {phc-ingestion-0.8.26 → phc-ingestion-0.8.27}/ingestion/vcf_standardization/util/read_write.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phc-ingestion
3
- Version: 0.8.26
3
+ Version: 0.8.27
4
4
  Summary: Functions for LifeOmic PHC genomic ingestions
5
5
  License: MIT
6
6
  Author-email: LifeOmic Development <development@lifeomic.com>
@@ -0,0 +1,28 @@
1
+ from typing import TypedDict
2
+
3
+
4
+ class GeneWithLocation(TypedDict):
5
+ gene: str
6
+ chr: str
7
+ start: int
8
+ end: int
9
+
10
+
11
+ nextgen_specific_genes: list[GeneWithLocation] = [
12
+ {"gene": "IGK", "chr": "chr2", "start": 88852034, "end": 90258119},
13
+ {"gene": "NSD2", "chr": "chr4", "start": 1792518, "end": 1940193},
14
+ {"gene": "CCND3", "chr": "chr6", "start": 41920534, "end": 42562008},
15
+ {"gene": "MYC", "chr": "chr8", "start": 125309416, "end": 129673293},
16
+ {"gene": "CCND1", "chr": "chr11", "start": 69090733, "end": 69656860},
17
+ {"gene": "IGH", "chr": "chr14", "start": 105578834, "end": 109902208},
18
+ {"gene": "MAF", "chr": "chr16", "start": 78428398, "end": 79615096},
19
+ {"gene": "MAFB", "chr": "chr20", "start": 39039005, "end": 40688948},
20
+ {"gene": "IGL", "chr": "chr22", "start": 22012552, "end": 22965858},
21
+ ]
22
+
23
+
24
+ def maybe_get_matching_gene_for_location(chr: str, position: int) -> str | None:
25
+ for gene in nextgen_specific_genes:
26
+ if gene["chr"] == chr and gene["start"] <= position <= gene["end"]:
27
+ return gene["gene"]
28
+ return None
@@ -5,6 +5,7 @@ from typing import TypedDict
5
5
  from ingestion.shared_util.coords_to_genes import coords_to_genes
6
6
  from ingestion.nextgen.util.alteration_table import extract_variant_table
7
7
  from ingestion.nextgen.util.interpretation import map_interpretation
8
+ from ingestion.nextgen.util.nextgen_specific_genes import maybe_get_matching_gene_for_location
8
9
  from ingestion.shared_util.open_maybe_gzipped import open_maybe_gzipped
9
10
 
10
11
 
@@ -42,6 +43,23 @@ def is_del_dup_or_ins(variant: list[str]) -> bool:
42
43
  return any([x in variant[2] for x in ["MantaDEL", "MantaDUP", "MantaINS"]])
43
44
 
44
45
 
46
+ def get_gene_from_coords(
47
+ chromosome: str, start_position: str, end_position: str, log: Logger
48
+ ) -> str:
49
+ """
50
+ A number of genes of interest with specific start and end positions have been provided.
51
+ If a variant falls within the start and end positions of one of those genes of interest, that gene will be used.
52
+ Otherwise, we fall back to the standard gene lookup.
53
+ """
54
+ center_position = int((int(start_position) + int(end_position)) / 2)
55
+
56
+ gene = maybe_get_matching_gene_for_location(chromosome, center_position)
57
+ if gene:
58
+ return gene
59
+
60
+ return coords_to_genes("GRCh38", chromosome, center_position, log)
61
+
62
+
45
63
  def process_structural(
46
64
  sv_in_file: str, xml_in_file, root_path: str, prefix: str, log: Logger
47
65
  ) -> str | None:
@@ -74,9 +92,7 @@ def process_structural(
74
92
  effect = "insertion"
75
93
 
76
94
  # Get genes from coordinates using center point of start and end positions
77
- gene1 = coords_to_genes(
78
- "GRCh38", chromosome1, int((int(start_position1) + int(end_position1)) / 2), log
79
- )
95
+ gene1 = get_gene_from_coords(chromosome1, start_position1, end_position1, log)
80
96
  gene2 = "N/A"
81
97
 
82
98
  else:
@@ -89,12 +105,8 @@ def process_structural(
89
105
  effect = "translocation"
90
106
 
91
107
  # Get genes from coordinates using center point of start and end positions
92
- gene1 = coords_to_genes(
93
- "GRCh38", chromosome1, int((int(start_position1) + int(end_position1)) / 2), log
94
- )
95
- gene2 = coords_to_genes(
96
- "GRCh38", chromosome2, int((int(start_position2) + int(end_position2)) / 2), log
97
- )
108
+ gene1 = get_gene_from_coords(chromosome1, start_position1, end_position1, log)
109
+ gene2 = get_gene_from_coords(chromosome2, start_position2, end_position2, log)
98
110
 
99
111
  # Scrape interpretation
100
112
  interpretation = "unknown"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "phc-ingestion"
3
- version = "0.8.26"
3
+ version = "0.8.27"
4
4
  description = "Functions for LifeOmic PHC genomic ingestions"
5
5
  authors = [
6
6
  { name = "LifeOmic Development", email = "development@lifeomic.com" },
File without changes