phc-ingestion 0.10.5__tar.gz → 0.10.7__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.5 → phc-ingestion-0.10.7}/PKG-INFO +1 -1
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nebula/manifest_assembler.py +40 -20
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/pyproject.toml +1 -1
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/PYPI.md +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/process.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/cnv.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/detect_genome_ref.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/hla.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/ihc.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/interpretation.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/json.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/metadata.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/specimen_details.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/structural.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/tests.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/tmb.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/tsv.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/caris/util/vcf.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/process.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/cnv.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/fnv.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/ga4gh.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/interpretation.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/foundation/util/vcf_etl.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/generic/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/generic/process.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/generic/utils.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nebula/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nebula/constants.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nebula/process.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/process.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/alteration_table.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/interpretation.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/manifest_helpers.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/nextgen_specific_genes.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/pre_filter_somatic_vcf.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/process_cnv.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/process_manifest.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/process_structural.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/process_vcf.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/types.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/resources/GRCh37_map.csv.gz +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/resources/GRCh38_map.csv.gz +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/coords_to_genes.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/ga4gh.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/gene_to_coords.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/lambda_client.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/open_maybe_gzipped.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/tar.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/shared_util/types.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/Variant.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/standardize.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/__init__.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/af_helpers.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/dp_helpers.py +0 -0
- {phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/read_write.py +0 -0
|
@@ -9,6 +9,7 @@ from ingestion.nebula.constants import (
|
|
|
9
9
|
NEBULA_BODY_SITE,
|
|
10
10
|
NEBULA_INDICATION,
|
|
11
11
|
)
|
|
12
|
+
import re
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class HumanName(TypedDict):
|
|
@@ -71,9 +72,16 @@ class ManifestAssembler:
|
|
|
71
72
|
|
|
72
73
|
response = self.client.invoke(path, "get", None, params)
|
|
73
74
|
entries = response.get("entry", [])
|
|
74
|
-
patient = entries[0]["resource"] if len(entries) > 0 else None
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
if len(entries) == 0:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if len(entries) > 1:
|
|
80
|
+
raise RuntimeError(
|
|
81
|
+
f"Found {len(entries)} patients with kit id {self.kit_id}. Expected 1."
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return entries[0]["resource"]
|
|
77
85
|
|
|
78
86
|
def __fetch_resource_by_type_and_reference(
|
|
79
87
|
self,
|
|
@@ -91,30 +99,42 @@ class ManifestAssembler:
|
|
|
91
99
|
except RuntimeError:
|
|
92
100
|
return None
|
|
93
101
|
|
|
94
|
-
def __extract_identifier_from_resource(self, resource: Resource
|
|
95
|
-
if not resource:
|
|
96
|
-
return ""
|
|
97
|
-
|
|
102
|
+
def __extract_identifier_from_resource(self, resource: Resource) -> str:
|
|
98
103
|
identifiers = resource.get("identifier", [])
|
|
99
104
|
return identifiers[0].get("value", "") if identifiers else ""
|
|
100
105
|
|
|
101
106
|
def __extract_id_from_reference(self, reference: Reference) -> str:
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
ref_string = reference.get("reference", "")
|
|
108
|
+
parts = ref_string.split("/")
|
|
109
|
+
return parts[1] if len(parts) > 1 else parts[0]
|
|
104
110
|
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
def __extract_elation_mrn(self, patient: Patient) -> str:
|
|
112
|
+
identifier = next(
|
|
113
|
+
(
|
|
114
|
+
x
|
|
115
|
+
for x in patient.get("identifier", [])
|
|
116
|
+
# if matches LRN format for Elation
|
|
117
|
+
if re.search(
|
|
118
|
+
f"lrn:lo:(dev|us):{self.account_id}:ehr:{self.account_id}:{self.project_id}/Patient",
|
|
119
|
+
x.get("system", ""),
|
|
120
|
+
)
|
|
121
|
+
),
|
|
122
|
+
None,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
if not identifier:
|
|
107
126
|
return ""
|
|
108
127
|
|
|
109
|
-
|
|
110
|
-
return parts[1] if len(parts) > 1 else parts[0]
|
|
128
|
+
return identifier.get("value", "")
|
|
111
129
|
|
|
112
130
|
def __parse_human_name(self, human_name: list[HumanName] | None):
|
|
113
|
-
if not human_name
|
|
114
|
-
return
|
|
131
|
+
if not human_name:
|
|
132
|
+
return {}
|
|
133
|
+
|
|
134
|
+
human_name = next((x for x in human_name if x.get("use") == "official"), human_name[0])
|
|
115
135
|
|
|
116
|
-
last_name = human_name
|
|
117
|
-
first_name = human_name
|
|
136
|
+
last_name = human_name.get("family", "")
|
|
137
|
+
first_name = human_name.get("given", [])[0]
|
|
118
138
|
|
|
119
139
|
return {
|
|
120
140
|
"lastName": last_name,
|
|
@@ -149,7 +169,7 @@ class ManifestAssembler:
|
|
|
149
169
|
"indexedDate": datetime.now().strftime("%Y-%m-%d"),
|
|
150
170
|
"reference": "GRCh38",
|
|
151
171
|
"patientId": patient.get("id"),
|
|
152
|
-
"mrn":
|
|
172
|
+
"mrn": self.__extract_elation_mrn(patient),
|
|
153
173
|
"bodySite": NEBULA_BODY_SITE,
|
|
154
174
|
"bodySiteDisplay": NEBULA_BODY_SITE,
|
|
155
175
|
"bodySiteSystem": BODY_SITE_SYSTEM,
|
|
@@ -157,10 +177,10 @@ class ManifestAssembler:
|
|
|
157
177
|
"indication": NEBULA_INDICATION,
|
|
158
178
|
"indicationDisplay": NEBULA_INDICATION,
|
|
159
179
|
"patientInfo": {
|
|
160
|
-
"lastName": patient_info.get("lastName"),
|
|
180
|
+
"lastName": patient_info.get("lastName", ""),
|
|
161
181
|
"dob": datetime.fromisoformat(patient_birth_date).strftime("%Y-%m-%d"),
|
|
162
|
-
"firstName": patient_info.get("firstName"),
|
|
163
|
-
"gender": patient
|
|
182
|
+
"firstName": patient_info.get("firstName", ""),
|
|
183
|
+
"gender": patient.get("gender", ""),
|
|
164
184
|
},
|
|
165
185
|
**(
|
|
166
186
|
{
|
|
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
|
{phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/nextgen/util/nextgen_specific_genes.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/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.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/__init__.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/af_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/dp_helpers.py
RENAMED
|
File without changes
|
{phc-ingestion-0.10.5 → phc-ingestion-0.10.7}/ingestion/vcf_standardization/util/read_write.py
RENAMED
|
File without changes
|