phc-ingestion 0.10.4__tar.gz → 0.10.6__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.
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/PKG-INFO +1 -1
- phc-ingestion-0.10.6/ingestion/nebula/constants.py +7 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nebula/manifest_assembler.py +53 -16
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/pyproject.toml +1 -1
- phc-ingestion-0.10.4/ingestion/nebula/constants.py +0 -1
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/PYPI.md +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/process.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/cnv.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/detect_genome_ref.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/hla.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/ihc.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/interpretation.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/json.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/metadata.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/specimen_details.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/structural.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/tests.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/tmb.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/tsv.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/caris/util/vcf.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/process.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/cnv.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/fnv.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/ga4gh.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/interpretation.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/foundation/util/vcf_etl.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/generic/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/generic/process.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/generic/utils.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nebula/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nebula/process.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/process.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/alteration_table.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/interpretation.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/manifest_helpers.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/nextgen_specific_genes.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/pre_filter_somatic_vcf.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/process_cnv.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/process_manifest.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/process_structural.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/process_vcf.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/types.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/resources/GRCh37_map.csv.gz +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/resources/GRCh38_map.csv.gz +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/coords_to_genes.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/ga4gh.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/gene_to_coords.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/lambda_client.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/open_maybe_gzipped.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/tar.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/shared_util/types.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/Variant.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/standardize.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/__init__.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/af_helpers.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/dp_helpers.py +0 -0
- {phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/read_write.py +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
NEBULA_TEST_TYPE = "WGS-30x"
|
|
2
|
+
DATASET_SYSTEM = "http://lifeomic.com/fhir/dataset"
|
|
3
|
+
NEBULA_KIT_ID_SYSTEM = "http://lifeomic.com/fhir/nebula-kit-id"
|
|
4
|
+
BODY_SITE_SYSTEM = "http://lifeomic.com/fhir/sequence-body-site"
|
|
5
|
+
NEBULA_BODY_SITE = "Buccal Swab"
|
|
6
|
+
INDICATION_SYSTEM = "http://lifeomic.com/fhir/sequence-indication"
|
|
7
|
+
NEBULA_INDICATION = "Genetic Health Screening"
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
from typing import Optional, TypedDict, Any
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
from ingestion.shared_util.lambda_client import LambdaClient
|
|
4
|
+
from ingestion.nebula.constants import (
|
|
5
|
+
DATASET_SYSTEM,
|
|
6
|
+
NEBULA_KIT_ID_SYSTEM,
|
|
7
|
+
BODY_SITE_SYSTEM,
|
|
8
|
+
INDICATION_SYSTEM,
|
|
9
|
+
NEBULA_BODY_SITE,
|
|
10
|
+
NEBULA_INDICATION,
|
|
11
|
+
)
|
|
12
|
+
import re
|
|
4
13
|
|
|
5
14
|
|
|
6
15
|
class HumanName(TypedDict):
|
|
@@ -57,8 +66,8 @@ class ManifestAssembler:
|
|
|
57
66
|
def __fetch_patient_by_kit_id(self) -> Optional[Patient]:
|
|
58
67
|
path = f"/{self.account_id}/dstu3/Patient"
|
|
59
68
|
params = {
|
|
60
|
-
"_tag": f"
|
|
61
|
-
"identifier": f"
|
|
69
|
+
"_tag": f"{DATASET_SYSTEM}|{self.project_id}",
|
|
70
|
+
"identifier": f"{NEBULA_KIT_ID_SYSTEM}|{self.kit_id}",
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
response = self.client.invoke(path, "get", None, params)
|
|
@@ -80,7 +89,7 @@ class ManifestAssembler:
|
|
|
80
89
|
|
|
81
90
|
try:
|
|
82
91
|
return self.client.invoke(path, "get")
|
|
83
|
-
except RuntimeError
|
|
92
|
+
except RuntimeError:
|
|
84
93
|
return None
|
|
85
94
|
|
|
86
95
|
def __extract_identifier_from_resource(self, resource: Resource | None) -> str:
|
|
@@ -91,7 +100,7 @@ class ManifestAssembler:
|
|
|
91
100
|
return identifiers[0].get("value", "") if identifiers else ""
|
|
92
101
|
|
|
93
102
|
def __extract_id_from_reference(self, reference: Reference) -> str:
|
|
94
|
-
if not reference
|
|
103
|
+
if not reference:
|
|
95
104
|
return ""
|
|
96
105
|
|
|
97
106
|
ref_string = reference.get("reference")
|
|
@@ -101,12 +110,39 @@ class ManifestAssembler:
|
|
|
101
110
|
parts = ref_string.split("/")
|
|
102
111
|
return parts[1] if len(parts) > 1 else parts[0]
|
|
103
112
|
|
|
113
|
+
def __extract_elation_mrn(self, patient: Patient) -> str:
|
|
114
|
+
if not patient:
|
|
115
|
+
return ""
|
|
116
|
+
|
|
117
|
+
identifier = next(
|
|
118
|
+
(
|
|
119
|
+
x
|
|
120
|
+
for x in patient.get("identifier", [])
|
|
121
|
+
# if matches LRN format for Elation
|
|
122
|
+
if re.search(
|
|
123
|
+
f"lrn:lo:(dev|us):{self.account_id}:ehr:{self.account_id}:{self.project_id}/Patient",
|
|
124
|
+
x.get("system", ""),
|
|
125
|
+
)
|
|
126
|
+
),
|
|
127
|
+
None,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if not identifier:
|
|
131
|
+
return ""
|
|
132
|
+
|
|
133
|
+
return identifier.get("value", "")
|
|
134
|
+
|
|
104
135
|
def __parse_human_name(self, human_name: list[HumanName] | None):
|
|
105
|
-
if not human_name
|
|
136
|
+
if not human_name:
|
|
137
|
+
return None
|
|
138
|
+
|
|
139
|
+
human_name = next((x for x in human_name if x.get("use") == "official"), None)
|
|
140
|
+
|
|
141
|
+
if not human_name:
|
|
106
142
|
return None
|
|
107
143
|
|
|
108
|
-
last_name = human_name
|
|
109
|
-
first_name = human_name
|
|
144
|
+
last_name = human_name.get("family", "")
|
|
145
|
+
first_name = human_name.get("given", [])[0]
|
|
110
146
|
|
|
111
147
|
return {
|
|
112
148
|
"lastName": last_name,
|
|
@@ -121,7 +157,7 @@ class ManifestAssembler:
|
|
|
121
157
|
raise RuntimeError(f"Patient with kit id {self.kit_id} not found")
|
|
122
158
|
patient_birth_date = patient.get("birthDate")
|
|
123
159
|
if not patient_birth_date:
|
|
124
|
-
raise RuntimeError(
|
|
160
|
+
raise RuntimeError("Patient birth date is a required to create a manifest")
|
|
125
161
|
|
|
126
162
|
organization: Organization | None = self.__fetch_resource_by_type_and_reference(
|
|
127
163
|
"Organization", patient.get("managingOrganization")
|
|
@@ -139,14 +175,15 @@ class ManifestAssembler:
|
|
|
139
175
|
return {
|
|
140
176
|
"name": "Nebula",
|
|
141
177
|
"indexedDate": datetime.now().strftime("%Y-%m-%d"),
|
|
142
|
-
"reference": "GRCh38",
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
178
|
+
"reference": "GRCh38",
|
|
179
|
+
"patientId": patient.get("id"),
|
|
180
|
+
"mrn": self.__extract_elation_mrn(patient),
|
|
181
|
+
"bodySite": NEBULA_BODY_SITE,
|
|
182
|
+
"bodySiteDisplay": NEBULA_BODY_SITE,
|
|
183
|
+
"bodySiteSystem": BODY_SITE_SYSTEM,
|
|
184
|
+
"indicationSystem": INDICATION_SYSTEM,
|
|
185
|
+
"indication": NEBULA_INDICATION,
|
|
186
|
+
"indicationDisplay": NEBULA_INDICATION,
|
|
150
187
|
"patientInfo": {
|
|
151
188
|
"lastName": patient_info.get("lastName"),
|
|
152
189
|
"dob": datetime.fromisoformat(patient_birth_date).strftime("%Y-%m-%d"),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
NEBULA_TEST_TYPE = "WGS-30x"
|
|
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
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/nextgen_specific_genes.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/nextgen/util/pre_filter_somatic_vcf.py
RENAMED
|
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
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/__init__.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/af_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/dp_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.4 → phc-ingestion-0.10.6}/ingestion/vcf_standardization/util/read_write.py
RENAMED
|
File without changes
|