nci-cidc-schemas 0.27.5__py2.py3-none-any.whl → 0.27.7__py2.py3-none-any.whl
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 nci-cidc-schemas might be problematic. Click here for more details.
- cidc_schemas/__init__.py +1 -1
- cidc_schemas/schemas/sample.json +21 -7
- cidc_schemas/schemas/templates/analyses/wes_analysis_template.json +9 -9
- cidc_schemas/template.py +36 -1
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info}/METADATA +3 -2
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info}/RECORD +10 -10
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info}/WHEEL +1 -1
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info}/entry_points.txt +0 -0
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info/licenses}/LICENSE +0 -0
- {nci_cidc_schemas-0.27.5.dist-info → nci_cidc_schemas-0.27.7.dist-info}/top_level.txt +0 -0
cidc_schemas/__init__.py
CHANGED
cidc_schemas/schemas/sample.json
CHANGED
|
@@ -168,16 +168,30 @@
|
|
|
168
168
|
"description": "Indicates the specimen source of the sample shipped. Example: Na Heparin blood draw aliquots (2 of three), FFPE block #52",
|
|
169
169
|
"type": "string",
|
|
170
170
|
"enum": [
|
|
171
|
-
"
|
|
172
|
-
"
|
|
171
|
+
"Fine Needle Aspiration",
|
|
172
|
+
"Phlebotomy",
|
|
173
|
+
"Bone Marrow Aspiration",
|
|
174
|
+
"Bone Marrow Core Biopsy",
|
|
173
175
|
"Core Biopsy",
|
|
174
|
-
"Punch Biopsy",
|
|
175
176
|
"Endoscopic Biopsy",
|
|
176
|
-
"
|
|
177
|
-
"
|
|
177
|
+
"Surgical Excision",
|
|
178
|
+
"Fine Needle Aspiration",
|
|
178
179
|
"Lumbar Puncture",
|
|
179
|
-
"
|
|
180
|
-
"
|
|
180
|
+
"FFPE Block Punch Biopsy",
|
|
181
|
+
"Skin Biopsy",
|
|
182
|
+
"Apheresis",
|
|
183
|
+
"Bone Biopsy",
|
|
184
|
+
"Bronchoalveolar Lavage",
|
|
185
|
+
"Buccal Swab",
|
|
186
|
+
"Leukapheresis",
|
|
187
|
+
"Mid Stream Urine Collection",
|
|
188
|
+
"Peritoneal Lavage",
|
|
189
|
+
"Peritoneal Paracentesis",
|
|
190
|
+
"Pleural Thoracentesis",
|
|
191
|
+
"Saliva Collection",
|
|
192
|
+
"Stool Collection",
|
|
193
|
+
"Surgical Incision",
|
|
194
|
+
"Urine Voiding",
|
|
181
195
|
"Not Reported",
|
|
182
196
|
"Other"
|
|
183
197
|
]
|
|
@@ -293,63 +293,63 @@
|
|
|
293
293
|
"type_ref": "sample.json#properties/cimac_id",
|
|
294
294
|
"process_as": [
|
|
295
295
|
{
|
|
296
|
-
"parse_through": "lambda
|
|
296
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/align/{run_id}/{normal_id}.sorted.dedup.bam'",
|
|
297
297
|
"merge_pointer": "/normal/alignment/align_sorted_dedup",
|
|
298
298
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/sorted.dedup.bam",
|
|
299
299
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
300
300
|
"is_artifact": 1
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
|
-
"parse_through": "lambda
|
|
303
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/align/{run_id}/{normal_id}.sorted.dedup.bam.bai'",
|
|
304
304
|
"merge_pointer": "/normal/alignment/align_sorted_dedup_index",
|
|
305
305
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/sorted.dedup.bam.bai",
|
|
306
306
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
307
307
|
"is_artifact": 1
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
|
-
"parse_through": "lambda
|
|
310
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/align/{run_id}/{normal_id}_recalibrated.bam'",
|
|
311
311
|
"merge_pointer": "/normal/alignment/align_recalibrated",
|
|
312
312
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/recalibrated.bam",
|
|
313
313
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
314
314
|
"is_artifact": 1
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
|
-
"parse_through": "lambda
|
|
317
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/align/{run_id}/{normal_id}_recalibrated.bam.bai'",
|
|
318
318
|
"merge_pointer": "/normal/alignment/align_recalibrated_index",
|
|
319
319
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/recalibrated.bam.bai",
|
|
320
320
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
321
321
|
"is_artifact": 1
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
|
-
"parse_through": "lambda
|
|
324
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/germline/{run_id}/{normal_id}_haplotyper.output.vcf'",
|
|
325
325
|
"merge_pointer": "/normal/germline/haplotyper_output",
|
|
326
326
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/haplotyper_output.vcf",
|
|
327
327
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
328
328
|
"is_artifact": 1
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
|
-
"parse_through": "lambda
|
|
331
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/germline/{run_id}/{normal_id}_haplotyper.targets.vcf.gz'",
|
|
332
332
|
"merge_pointer": "/normal/germline/haplotyper_targets",
|
|
333
333
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/haplotyper_targets.vcf.gz",
|
|
334
334
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
335
335
|
"is_artifact": 1
|
|
336
336
|
},
|
|
337
337
|
{
|
|
338
|
-
"parse_through": "lambda
|
|
338
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/hlahd/{run_id}/result/{normal_id}_final.result.txt'",
|
|
339
339
|
"merge_pointer": "/normal/hla/hla_final_result",
|
|
340
340
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/hla_final_result.txt",
|
|
341
341
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
342
342
|
"is_artifact": 1
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
|
-
"parse_through": "lambda
|
|
345
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/optitype/{run_id}/{normal_id}_result.tsv'",
|
|
346
346
|
"merge_pointer": "/normal/hla/optitype_result",
|
|
347
347
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/optitype_result.tsv",
|
|
348
348
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
|
349
349
|
"is_artifact": 1
|
|
350
350
|
},
|
|
351
351
|
{
|
|
352
|
-
"parse_through": "lambda
|
|
352
|
+
"parse_through": "lambda normal_id, run_id: f'{folder or \"\"}analysis/xhla/{run_id}/report-{normal_id}-hla.json'",
|
|
353
353
|
"merge_pointer": "/normal/hla/xhla_report_hla",
|
|
354
354
|
"gcs_uri_format": "{protocol identifier}/wes/{run id}/analysis/normal/{normal cimac id}/xhla_report_hla.json",
|
|
355
355
|
"type_ref": "assays/components/local_file.json#properties/file_path",
|
cidc_schemas/template.py
CHANGED
|
@@ -750,7 +750,7 @@ class _FieldDef(NamedTuple):
|
|
|
750
750
|
|
|
751
751
|
if self.parse_through:
|
|
752
752
|
try:
|
|
753
|
-
raw_val =
|
|
753
|
+
raw_val = self._eval_lambda_expression(raw_val, format_context)
|
|
754
754
|
|
|
755
755
|
# catching everything, because of eval
|
|
756
756
|
except Exception as e:
|
|
@@ -786,6 +786,41 @@ class _FieldDef(NamedTuple):
|
|
|
786
786
|
else:
|
|
787
787
|
return [AtomicChange(self.merge_pointer, val)], files
|
|
788
788
|
|
|
789
|
+
def _eval_lambda_expression(self, raw_val: str, format_context: dict):
|
|
790
|
+
"""
|
|
791
|
+
Evaluates a lambda expression stored in `self.parse_through`, optionally
|
|
792
|
+
passing an additional parameter if the lambda function has two parameters.
|
|
793
|
+
|
|
794
|
+
Args:
|
|
795
|
+
raw_val (str): Initial value to process.
|
|
796
|
+
format_context (dict): Dictionary providing format context.
|
|
797
|
+
|
|
798
|
+
Returns:
|
|
799
|
+
Processed value after applying the lambda function.
|
|
800
|
+
"""
|
|
801
|
+
parse_lambda = self.parse_through
|
|
802
|
+
# Check for multiple lambda parameters
|
|
803
|
+
if (
|
|
804
|
+
parse_lambda.startswith("lambda ")
|
|
805
|
+
and ":" in parse_lambda
|
|
806
|
+
and "," in parse_lambda
|
|
807
|
+
):
|
|
808
|
+
# Extract the parameter section (between "lambda " and ":")
|
|
809
|
+
colon_index = parse_lambda.find(":")
|
|
810
|
+
param_section = parse_lambda[7:colon_index].strip()
|
|
811
|
+
params = [param.strip() for param in param_section.split(",")]
|
|
812
|
+
|
|
813
|
+
# Handles up to two parameters at this time
|
|
814
|
+
if len(params) == 2:
|
|
815
|
+
# Convert underscores to spaces to match column header formatting
|
|
816
|
+
param_name = params[1].replace("_", " ")
|
|
817
|
+
extra_val = format_context.get(param_name)
|
|
818
|
+
# Evaluate the lambda function with two parameters
|
|
819
|
+
return eval(parse_lambda, format_context, {})(raw_val, extra_val)
|
|
820
|
+
|
|
821
|
+
# Evaluate the lambda function with one parameter
|
|
822
|
+
return eval(parse_lambda, format_context, {})(raw_val)
|
|
823
|
+
|
|
789
824
|
## TODO easy - split val coerce / files calc to handle exceptions separately
|
|
790
825
|
## TODO hard - files (artifact and multi) should be just coerce?
|
|
791
826
|
def _calc_val_and_files(self, raw_val, format_context: dict, encrypt_fn: Callable):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: nci_cidc_schemas
|
|
3
|
-
Version: 0.27.
|
|
3
|
+
Version: 0.27.7
|
|
4
4
|
Summary: The CIDC data model and tools for working with it.
|
|
5
5
|
Home-page: https://github.com/NCI-CIDC/cidc-schemas
|
|
6
6
|
Author: NCI
|
|
@@ -37,6 +37,7 @@ Dynamic: description-content-type
|
|
|
37
37
|
Dynamic: home-page
|
|
38
38
|
Dynamic: keywords
|
|
39
39
|
Dynamic: license
|
|
40
|
+
Dynamic: license-file
|
|
40
41
|
Dynamic: requires-dist
|
|
41
42
|
Dynamic: requires-python
|
|
42
43
|
Dynamic: summary
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
cidc_schemas/__init__.py,sha256=
|
|
1
|
+
cidc_schemas/__init__.py,sha256=mvfYCHhm5U-KWTKUo-eKgnaUr-hEKtBAG7AzeTc-MKU,136
|
|
2
2
|
cidc_schemas/cli.py,sha256=gWiktRlraNH8Q0zNUae9dohKjPwBmcY0BJwdcQ_fIic,4099
|
|
3
3
|
cidc_schemas/constants.py,sha256=RULs7pGuBAVq1teXymrfbVsK23ZowJvLuZlv0KcjL-Y,698
|
|
4
4
|
cidc_schemas/json_validation.py,sha256=nHkSfTmBN7EeTrZVdbb8h6A64lWrJe5z0AIHiIy-YB0,22552
|
|
5
5
|
cidc_schemas/migrations.py,sha256=Amg_T4cFgMzySD7yNnT_PWpqP7hwlTWGeHlI_RSXuRI,14766
|
|
6
|
-
cidc_schemas/template.py,sha256=
|
|
6
|
+
cidc_schemas/template.py,sha256=uvQNbkvusMq9D_1cnUMxT7j7Rf-iqq7o5nuZUhCaXY0,51428
|
|
7
7
|
cidc_schemas/template_reader.py,sha256=xXtLRKu1y4FrPj8RgyGOmB2hlsCDXcuvMBWami2_jV8,13119
|
|
8
8
|
cidc_schemas/template_writer.py,sha256=faOhvSDTp4nuPhOtVQR_J7YNnFzx-vh7oyNpFdee1mY,18236
|
|
9
9
|
cidc_schemas/unprism.py,sha256=TOD3CSGkgNnTtT-OeCCE3Ihlam84lr8XGOmtdSy2lL8,13545
|
|
@@ -20,7 +20,7 @@ cidc_schemas/schemas/aliquot.json,sha256=F24s6xGTeJl-VT6s6wvV8YtMA4O-0BsUCwtD2OE
|
|
|
20
20
|
cidc_schemas/schemas/clinical_data.json,sha256=ubt2dqTLCbDuxuOXrBObT_xLHVSArMBx4oASFOAYEas,1474
|
|
21
21
|
cidc_schemas/schemas/clinical_trial.json,sha256=aUjYgdtlRWDfULk0-apralt4-KrtjriUqt3qNTdL2Rc,4442
|
|
22
22
|
cidc_schemas/schemas/participant.json,sha256=X72GQSdLqhZl_Vg8OHPqRotblIluNSmiw8N5UeM-di8,2843
|
|
23
|
-
cidc_schemas/schemas/sample.json,sha256=
|
|
23
|
+
cidc_schemas/schemas/sample.json,sha256=8SFYwnvc3MzLblLEXMiBxn5wrwZNsPAyYjsoU-v75jo,21341
|
|
24
24
|
cidc_schemas/schemas/shipping_core.json,sha256=OGdcdoFJXoKacD_FoSukX6SXJvcgFXTnWPko9VqOD5o,4234
|
|
25
25
|
cidc_schemas/schemas/artifacts/artifact_bam.json,sha256=nPy3qx07--arLyb9VgfdVK6OJoMPhr6rnp-3AF6o82Q,1653
|
|
26
26
|
cidc_schemas/schemas/artifacts/artifact_bam_bai.json,sha256=S1LxCZVyN3v-Hxhs7TEDbGcV-y7LVdAoLzGblT9IhEk,1671
|
|
@@ -123,7 +123,7 @@ cidc_schemas/schemas/templates/analyses/atacseq_analysis_template.json,sha256=7v
|
|
|
123
123
|
cidc_schemas/schemas/templates/analyses/cytof_analysis_template.json,sha256=d6qOGbYXXx1c8rb-saM4D_tMuK8n4ydbyW9_xaW6xhk,6381
|
|
124
124
|
cidc_schemas/schemas/templates/analyses/rna_level1_analysis_template.json,sha256=vMHXSQNZz8sFxwiBUnRXb5o08GxgbKZjMu8ZPjNn4TI,15944
|
|
125
125
|
cidc_schemas/schemas/templates/analyses/tcr_analysis_template.json,sha256=ai5KUp6q5GGTxDybOHBaseOnvQCVqIRh4SurETz5Vx0,3054
|
|
126
|
-
cidc_schemas/schemas/templates/analyses/wes_analysis_template.json,sha256=
|
|
126
|
+
cidc_schemas/schemas/templates/analyses/wes_analysis_template.json,sha256=kvnbC6nYrwqfGKfvHwZs1d4rePW_BOLzV6oRvrMkiD4,35297
|
|
127
127
|
cidc_schemas/schemas/templates/analyses/wes_tumor_only_analysis_template.json,sha256=hhWA6mBPVBIM9QFg0C7CkimD9fcFXXtFSSkvo0lvnro,16264
|
|
128
128
|
cidc_schemas/schemas/templates/assays/atacseq_fastq_template.json,sha256=7WygawkxnhFu5xBAuIhSOBD8TwCqDgINjC-HIYeCf4Q,3928
|
|
129
129
|
cidc_schemas/schemas/templates/assays/clinical_data_template.json,sha256=1luQXzyqbAKKiNVwVQFeZ4dwzVpnTeGAropzd_mYmx4,2193
|
|
@@ -154,9 +154,9 @@ cidc_schemas/schemas/templates/manifests/tissue_slide_template.json,sha256=jwyXO
|
|
|
154
154
|
cidc_schemas/schemas/templates/manifests/tumor_normal_pairing_template.json,sha256=lVJrGb28n-vyfjGBzhrzjn1lMKw1b4HXXmWtwA603v0,2797
|
|
155
155
|
cidc_schemas/schemas/templates/manifests/tumor_tissue_dna_template.json,sha256=eoX_YIl1HfQXiL7Q6ybIuOLs85Nbn7EylJ8dzXKiMZw,18674
|
|
156
156
|
cidc_schemas/schemas/templates/manifests/tumor_tissue_rna_template.json,sha256=HK2Q2VQcDhP8FZDZapk04Qx2-Tji9dCMH1UpkVhU3Vs,17819
|
|
157
|
-
nci_cidc_schemas-0.27.
|
|
158
|
-
nci_cidc_schemas-0.27.
|
|
159
|
-
nci_cidc_schemas-0.27.
|
|
160
|
-
nci_cidc_schemas-0.27.
|
|
161
|
-
nci_cidc_schemas-0.27.
|
|
162
|
-
nci_cidc_schemas-0.27.
|
|
157
|
+
nci_cidc_schemas-0.27.7.dist-info/licenses/LICENSE,sha256=zK77-w4rYCZBHAYJEGkcFuPXwKIsP7jMPZ2iQOXjzko,1072
|
|
158
|
+
nci_cidc_schemas-0.27.7.dist-info/METADATA,sha256=8TAQGFz61x4X7-SSENzJWG2I1xx2-XDGj-RmDT7wHkw,4553
|
|
159
|
+
nci_cidc_schemas-0.27.7.dist-info/WHEEL,sha256=hLAVbN_1g7qXnG_3sY9erV0tsmek_RdDpqqJkhwSgEY,109
|
|
160
|
+
nci_cidc_schemas-0.27.7.dist-info/entry_points.txt,sha256=kSyTzXeJQrJp_2ZX0GS_NnbJR8ceQKLBSgER46PM0hs,55
|
|
161
|
+
nci_cidc_schemas-0.27.7.dist-info/top_level.txt,sha256=Wwb5Cu7QrnbmSJxI2d00e3-Mir36t0jTRnSulmfhi30,13
|
|
162
|
+
nci_cidc_schemas-0.27.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|