Skip to content

Commit

Permalink
Merge pull request #386 from cidgoh/PGP-issue-9etc
Browse files Browse the repository at this point in the history
Pgp issue 9etc
  • Loading branch information
ddooley committed Apr 5, 2023
2 parents a9ca9d2 + 479f619 commit 94616d1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 30 deletions.
16 changes: 12 additions & 4 deletions web/templates/canada_covid19/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -587,6 +591,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 [
Expand All @@ -595,19 +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 (
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 (
Expand Down
5 changes: 1 addition & 4 deletions web/templates/canada_covid19/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions web/templates/canada_covid19/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/templates/canada_covid19/schema_enums.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions web/templates/monkeypox/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', []],
Expand All @@ -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', []],
Expand Down Expand Up @@ -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 [
Expand Down
12 changes: 3 additions & 9 deletions web/templates/monkeypox/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1597,10 +1597,7 @@
"permissible_values": {
"Homo sapiens": {
"text": "Homo sapiens",
"meaning": "NCBITaxon:9606",
"exact_mappings": [
"NML_LIMS:Human"
]
"meaning": "NCBITaxon:9606"
}
}
},
Expand All @@ -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"
}
}
},
Expand Down Expand Up @@ -12543,7 +12537,7 @@
"annotations": {
"version": {
"tag": "version",
"value": "3.3.2"
"value": "3.3.3"
}
},
"description": "International specification for Monkeypox clinical virus biosample data gathering",
Expand Down
6 changes: 1 addition & 5 deletions web/templates/monkeypox/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion web/templates/monkeypox/schema_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions web/templates/monkeypox/schema_enums.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94616d1

Please sign in to comment.