From 2f3c0f32c58d682ccb791d0c37a03844ca7bd2d1 Mon Sep 17 00:00:00 2001 From: Damion Dooley Date: Wed, 15 Mar 2023 15:06:05 -0700 Subject: [PATCH 1/3] NML export field renaming Dropped extra fields: PH_CANCOGEN_AUTHORS, PH_INSTRUMENT_CGN; Fix to scientific name being converted to "Human" --- web/templates/canada_covid19/export.js | 5 ++++- web/templates/monkeypox/schema.json | 2 +- web/templates/monkeypox/schema.yaml | 2 +- web/templates/monkeypox/schema_core.yaml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/templates/canada_covid19/export.js b/web/templates/canada_covid19/export.js index 70e05304..dd348781 100644 --- a/web/templates/canada_covid19/export.js +++ b/web/templates/canada_covid19/export.js @@ -587,6 +587,8 @@ export default { } // A complicated rule about what is stored in 'Specimen Source' + // Note that common name field will override scientific name in + // export to PH_SPECIMEN_SOURCE if (headerName === 'PH_SPECIMEN_SOURCE') { let cellValue = ''; for (const fieldName of [ @@ -602,7 +604,8 @@ export default { continue; } if ( - fieldName === 'host (scientific name)' || + // error, obsolete: scientific name shouldn't be converted to "Human" + // fieldName === 'host (scientific name)' || fieldName === 'host (common name)' ) { if (value === 'Homo sapiens' || value === 'Human') diff --git a/web/templates/monkeypox/schema.json b/web/templates/monkeypox/schema.json index 876a434f..f4799c9c 100644 --- a/web/templates/monkeypox/schema.json +++ b/web/templates/monkeypox/schema.json @@ -12543,7 +12543,7 @@ "annotations": { "version": { "tag": "version", - "value": "3.3.2" + "value": "3.3.3" } }, "description": "International specification for Monkeypox clinical virus biosample data gathering", diff --git a/web/templates/monkeypox/schema.yaml b/web/templates/monkeypox/schema.yaml index c826a933..e771bef3 100644 --- a/web/templates/monkeypox/schema.yaml +++ b/web/templates/monkeypox/schema.yaml @@ -783,7 +783,7 @@ classes: is_a: dh_interface see_also: templates/monkeypox/SOP_Monkeypox_international.pdf annotations: - version: 3.3.2 + version: 3.3.3 slots: - specimen collector sample ID - case ID diff --git a/web/templates/monkeypox/schema_core.yaml b/web/templates/monkeypox/schema_core.yaml index b36a2316..2e414bc5 100644 --- a/web/templates/monkeypox/schema_core.yaml +++ b/web/templates/monkeypox/schema_core.yaml @@ -25,7 +25,7 @@ classes: is_a: dh_interface see_also: templates/monkeypox/SOP_Monkeypox_international.pdf annotations: - version: 3.3.2 + version: 3.3.3 slots: {} enums: {} types: From 2f8e2130a0e58bacb99b7c7c713359c9961786e2 Mon Sep 17 00:00:00 2001 From: Damion Dooley Date: Wed, 15 Mar 2023 15:08:18 -0700 Subject: [PATCH 2/3] tweak --- web/templates/monkeypox/export.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/templates/monkeypox/export.js b/web/templates/monkeypox/export.js index 8cca599b..fa2e9e31 100644 --- a/web/templates/monkeypox/export.js +++ b/web/templates/monkeypox/export.js @@ -320,7 +320,7 @@ export default { ['PH_REASON_FOR_SEQUENCING_DETAILS', []], ['PH_SEQUENCING_DATE', []], ['PH_LIBRARY_PREP_KIT', []], - + ['PH_SEQUENCING_INSTRUMENT', []], ['PH_TESTING_PROTOCOL', []], //['PH_SEQ_PROTOCOL_NAME', []], ['PH_RAW_SEQUENCE_METHOD', []], @@ -347,7 +347,7 @@ export default { ['SUBMITTED_RESLT - Gene Target #5', []], ['SUBMITTED_RESLT - Gene Target #5 CT Value', []], - ['PH_CANCOGEN_AUTHORS', []], + ['PH_SEQUENCING_AUTHORS', []], ['HC_COMMENTS', []], ['sample collector contact email', []], @@ -428,6 +428,8 @@ export default { } // A complicated rule about what is stored in 'Specimen Source' + // Note that common name field will override scientific name in + // export to PH_SPECIMEN_SOURCE if (headerName === 'PH_SPECIMEN_SOURCE') { let cellValue = ''; for (const fieldName of [ @@ -443,7 +445,7 @@ export default { continue; } if ( - fieldName === 'host (scientific name)' || + // fieldName === 'host (scientific name)' || fieldName === 'host (common name)' ) { if (value === 'Homo sapiens' || value === 'Human') From 479f619cb2e7cadc0d20f383132c868f51821ec3 Mon Sep 17 00:00:00 2001 From: Damion Dooley Date: Tue, 4 Apr 2023 22:06:16 -0700 Subject: [PATCH 3/3] Cancogen/monkeypox fix for Homo sapiens/Human labeling --- web/templates/canada_covid19/export.js | 15 ++++++++++----- web/templates/canada_covid19/schema.json | 5 +---- web/templates/canada_covid19/schema.yaml | 2 -- web/templates/canada_covid19/schema_enums.tsv | 2 +- web/templates/monkeypox/export.js | 2 +- web/templates/monkeypox/schema.json | 10 ++-------- web/templates/monkeypox/schema.yaml | 4 ---- web/templates/monkeypox/schema_enums.tsv | 4 ++-- 8 files changed, 17 insertions(+), 27 deletions(-) diff --git a/web/templates/canada_covid19/export.js b/web/templates/canada_covid19/export.js index dd348781..18f5a076 100644 --- a/web/templates/canada_covid19/export.js +++ b/web/templates/canada_covid19/export.js @@ -529,6 +529,9 @@ export default { ['SUBMITTED_RESLT - Gene Target #3 CT Value', []], ['PH_CANCOGEN_AUTHORS', []], ['HC_COMMENTS', []], + + ['host (scientific name)', []] // Special rule below + ]); const sourceFields = dh.getFields(dh.table); @@ -558,6 +561,7 @@ export default { for (const inputRow of dh.getTrimmedData(dh.hot)) { const outputRow = []; + for (const [headerName, sources] of ExportHeaders) { if (headerName === 'HC_CURRENT_ID') { // Assign constant value. @@ -597,20 +601,21 @@ export default { 'environmental material', 'environmental site', ]) { - const value = inputRow[sourceFieldNameMap[fieldName]]; + let value = inputRow[sourceFieldNameMap[fieldName]]; // Ignore all null value types if (!value || null_values.has(value)) { continue; } + value = value.toLowerCase(); if ( - // error, obsolete: scientific name shouldn't be converted to "Human" - // fieldName === 'host (scientific name)' || + fieldName === 'host (scientific name)' || fieldName === 'host (common name)' ) { - if (value === 'Homo sapiens' || value === 'Human') + if (value === 'homo sapiens' || value === 'human') cellValue = 'Human'; - else cellValue = 'ANIMAL'; + else + cellValue = 'ANIMAL'; break; } if ( diff --git a/web/templates/canada_covid19/schema.json b/web/templates/canada_covid19/schema.json index 0b3c947f..1782b6ea 100644 --- a/web/templates/canada_covid19/schema.json +++ b/web/templates/canada_covid19/schema.json @@ -2306,10 +2306,7 @@ "permissible_values": { "Homo sapiens": { "text": "Homo sapiens", - "meaning": "NCBITaxon:9606", - "exact_mappings": [ - "NML_LIMS:Human" - ] + "meaning": "NCBITaxon:9606" }, "Bos taurus": { "text": "Bos taurus", diff --git a/web/templates/canada_covid19/schema.yaml b/web/templates/canada_covid19/schema.yaml index f2d4cc43..15c82fa5 100644 --- a/web/templates/canada_covid19/schema.yaml +++ b/web/templates/canada_covid19/schema.yaml @@ -4408,8 +4408,6 @@ enums: Homo sapiens: text: Homo sapiens meaning: NCBITaxon:9606 - exact_mappings: - - NML_LIMS:Human Bos taurus: text: Bos taurus meaning: NCBITaxon:9913 diff --git a/web/templates/canada_covid19/schema_enums.tsv b/web/templates/canada_covid19/schema_enums.tsv index 72cde8ff..a191c2e4 100644 --- a/web/templates/canada_covid19/schema_enums.tsv +++ b/web/templates/canada_covid19/schema_enums.tsv @@ -496,7 +496,7 @@ collection device menu ENVO:00003968 Air filter OBI:0002866 Virus Transport Medium -host (scientific name) menu NCBITaxon:9606 Homo sapiens Human +host (scientific name) menu NCBITaxon:9606 Homo sapiens NCBITaxon:9913 Bos taurus NCBITaxon:9615 Canis lupus familiaris NCBITaxon:9397 Chiroptera diff --git a/web/templates/monkeypox/export.js b/web/templates/monkeypox/export.js index fa2e9e31..4f3ed335 100644 --- a/web/templates/monkeypox/export.js +++ b/web/templates/monkeypox/export.js @@ -445,7 +445,7 @@ export default { continue; } if ( - // fieldName === 'host (scientific name)' || + fieldName === 'host (scientific name)' || fieldName === 'host (common name)' ) { if (value === 'Homo sapiens' || value === 'Human') diff --git a/web/templates/monkeypox/schema.json b/web/templates/monkeypox/schema.json index f4799c9c..0256c6f5 100644 --- a/web/templates/monkeypox/schema.json +++ b/web/templates/monkeypox/schema.json @@ -1597,10 +1597,7 @@ "permissible_values": { "Homo sapiens": { "text": "Homo sapiens", - "meaning": "NCBITaxon:9606", - "exact_mappings": [ - "NML_LIMS:Human" - ] + "meaning": "NCBITaxon:9606" } } }, @@ -1610,10 +1607,7 @@ "permissible_values": { "Homo sapiens [NCBITaxon:9606]": { "text": "Homo sapiens [NCBITaxon:9606]", - "meaning": "NCBITaxon:9606", - "exact_mappings": [ - "NML_LIMS:Human" - ] + "meaning": "NCBITaxon:9606" } } }, diff --git a/web/templates/monkeypox/schema.yaml b/web/templates/monkeypox/schema.yaml index e771bef3..b0c75298 100644 --- a/web/templates/monkeypox/schema.yaml +++ b/web/templates/monkeypox/schema.yaml @@ -4117,16 +4117,12 @@ enums: Homo sapiens: text: Homo sapiens meaning: NCBITaxon:9606 - exact_mappings: - - NML_LIMS:Human host (scientific name) international menu: name: host (scientific name) international menu permissible_values: Homo sapiens [NCBITaxon:9606]: text: Homo sapiens [NCBITaxon:9606] meaning: NCBITaxon:9606 - exact_mappings: - - NML_LIMS:Human host health state menu: name: host health state menu permissible_values: diff --git a/web/templates/monkeypox/schema_enums.tsv b/web/templates/monkeypox/schema_enums.tsv index e3a1adf9..8abba759 100644 --- a/web/templates/monkeypox/schema_enums.tsv +++ b/web/templates/monkeypox/schema_enums.tsv @@ -325,9 +325,9 @@ host (common name) international menu NCBITaxon:9606 Human [NCBITaxon:9606] NCBITaxon:10116 Rat FOODON:03411389 Squirrel -host (scientific name) menu NCBITaxon:9606 Homo sapiens Human +host (scientific name) menu NCBITaxon:9606 Homo sapiens -host (scientific name) international menu NCBITaxon:9606 Homo sapiens [NCBITaxon:9606] Human +host (scientific name) international menu NCBITaxon:9606 Homo sapiens [NCBITaxon:9606] host health state menu NCIT:C3833 Asymptomatic NCIT:C28554 Deceased