From 3596d7482c6b380e6c1f8d5f1f66acf75e141532 Mon Sep 17 00:00:00 2001 From: Colleen Xu Date: Tue, 6 Jul 2021 21:33:53 -0700 Subject: [PATCH 1/4] fix: add adverse-event operations note: mapping to PhenotypicFeature MEDDRA rather than Disease....is that okay? To address https://github.com/biothings/BioThings_Explorer_TRAPI/issues/217 --- mychem.info/openapi_full.yml | 53 +++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/mychem.info/openapi_full.yml b/mychem.info/openapi_full.yml index 1b0dbd2a..003837ee 100644 --- a/mychem.info/openapi_full.yml +++ b/mychem.info/openapi_full.yml @@ -237,6 +237,8 @@ paths: - "$ref": "#/components/x-bte-kgs-operations/targetedBy" - "$ref": "#/components/x-bte-kgs-operations/treatedBy" - "$ref": "#/components/x-bte-kgs-operations/contraindicatedBy" + - "$ref": "#/components/x-bte-kgs-operations/causesAdverseEvent" + - "$ref": "#/components/x-bte-kgs-operations/adverseEventCausedBy" components: parameters: callback: @@ -423,6 +425,9 @@ components: MESH: chembl.drug_indications.mesh_id max_phase: chembl.drug_indications.max_phase_for_ind first_approval: chembl.drug_indications.first_approval + adverseEvent: + name: drugcentral.fda_adverse_event.meddra_term + MEDDRA: drugcentral.fda_adverse_event.meddra_code x-bte-kgs-operations: metabolizedBy: - supportBatch: true @@ -709,4 +714,50 @@ components: predicate: treated_by source: "infores:chembl" response_mapping: - "$ref": "#/components/x-bte-response-mapping/chembl" \ No newline at end of file + "$ref": "#/components/x-bte-response-mapping/chembl" + causesAdverseEvent: + ## example: https://mychem.info/v1/query?q=drugbank.name:nitisinone&fields=drugcentral.fda_adverse_event + ## there are also counts for...having drug + adverse event (ae) (drug_ae), having drug but no adverse event (drug_no_ae) + ## no drug but had adverse event (no_drug_ae), no drug and no adverse event (no_drug_no_ar) + ## not sure what the llr, llr_threshold, level means + - supportBatch: true + inputSeparator: "," + parameters: + fields: drugcentral.fda_adverse_event + requestBody: + body: + q: "{inputs[0]}" + scopes: chembl.molecule_chembl_id + header: application/x-www-form-urlencoded + inputs: + - id: CHEMBL.COMPOUND + semantic: ChemicalSubstance + outputs: + - id: MEDDRA + semantic: PhenotypicFeature + predicate: causes_adverse_event ## current biolink predicate + ## through drugcentral, FDA Adverse Event Reporting System (FAERS) information + source: drugcentral + response_mapping: + "$ref": "#/components/x-bte-response-mapping/adverseEvent" + adverseEventCausedBy: + - supportBatch: true + inputSeparator: "," + parameters: + fields: chembl.molecule_chembl_id + size: '1000' + requestBody: + body: + q: "{inputs[0]}" + scopes: drugcentral.fda_adverse_event.meddra_code + header: application/x-www-form-urlencoded + outputs: + - id: CHEMBL.COMPOUND + semantic: ChemicalSubstance + inputs: + - id: MEDDRA + semantic: PhenotypicFeature + predicate: adverse_event_caused_by ## current biolink predicate + source: drugcentral + response_mapping: + "$ref": "#/components/x-bte-response-mapping/chembl" From ba875ef711f4113128f53f956b8af40effe3d124 Mon Sep 17 00:00:00 2001 From: Colleen Xu Date: Sun, 18 Jul 2021 21:29:13 -0700 Subject: [PATCH 2/4] Change MEDDRA ID semantic type to Disease Making it Biolink Disease for now, since we have more support for mapping to other IDs through MyDisease (see [comment](https://github.com/biothings/BioThings_Explorer_TRAPI/issues/217#issuecomment-880204237)). --- mychem.info/openapi_full.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mychem.info/openapi_full.yml b/mychem.info/openapi_full.yml index 003837ee..ce00dff3 100644 --- a/mychem.info/openapi_full.yml +++ b/mychem.info/openapi_full.yml @@ -734,7 +734,7 @@ components: semantic: ChemicalSubstance outputs: - id: MEDDRA - semantic: PhenotypicFeature + semantic: Disease predicate: causes_adverse_event ## current biolink predicate ## through drugcentral, FDA Adverse Event Reporting System (FAERS) information source: drugcentral @@ -756,7 +756,7 @@ components: semantic: ChemicalSubstance inputs: - id: MEDDRA - semantic: PhenotypicFeature + semantic: Disease predicate: adverse_event_caused_by ## current biolink predicate source: drugcentral response_mapping: From fc3c1fc8e372a74eb5778601fde639492b0b15a9 Mon Sep 17 00:00:00 2001 From: Colleen Xu Date: Wed, 21 Jul 2021 21:20:28 -0700 Subject: [PATCH 3/4] scopes for chemical -> adverse event disease changed to handle the [248 records](https://mychem.info/v1/query?q=_exists_:drugcentral.fda_adverse_event%20AND%20NOT%20_exists_:chembl.molecule_chembl_id) that don't have the chembl field --- mychem.info/openapi_full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mychem.info/openapi_full.yml b/mychem.info/openapi_full.yml index ce00dff3..a3bd55a5 100644 --- a/mychem.info/openapi_full.yml +++ b/mychem.info/openapi_full.yml @@ -727,7 +727,7 @@ components: requestBody: body: q: "{inputs[0]}" - scopes: chembl.molecule_chembl_id + scopes: "_id,chembl.molecule_chembl_id" header: application/x-www-form-urlencoded inputs: - id: CHEMBL.COMPOUND From 53147f0c8d47d2b174e1369e800b95d08f777dd2 Mon Sep 17 00:00:00 2001 From: Colleen Xu Date: Wed, 4 Aug 2021 12:57:20 -0700 Subject: [PATCH 4/4] fix: update scopes/fields/response-mapping, comments, source to maximize the number of records that can be retrieved --- mychem.info/openapi_full.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/mychem.info/openapi_full.yml b/mychem.info/openapi_full.yml index a3bd55a5..f17f09e9 100644 --- a/mychem.info/openapi_full.yml +++ b/mychem.info/openapi_full.yml @@ -716,10 +716,12 @@ components: response_mapping: "$ref": "#/components/x-bte-response-mapping/chembl" causesAdverseEvent: - ## example: https://mychem.info/v1/query?q=drugbank.name:nitisinone&fields=drugcentral.fda_adverse_event - ## there are also counts for...having drug + adverse event (ae) (drug_ae), having drug but no adverse event (drug_no_ae) - ## no drug but had adverse event (no_drug_ae), no drug and no adverse event (no_drug_no_ar) - ## not sure what the llr, llr_threshold, level means + ## - chose to map to Disease semantic type due to more support for ID mapping there, will support queries + ## link: https://github.com/biothings/BioThings_Explorer_TRAPI/issues/217#issuecomment-880204237 + ## - example: https://mychem.info/v1/query?q=drugbank.name:nitisinone&fields=drugcentral.fda_adverse_event + ## - there are also counts for...having drug + adverse event (ae) (drug_ae), having drug but no adverse event (drug_no_ae) + ## no drug but had adverse event (no_drug_ae), no drug and no adverse event (no_drug_no_ar) + ## not sure what the llr, llr_threshold, level means - supportBatch: true inputSeparator: "," parameters: @@ -727,7 +729,9 @@ components: requestBody: body: q: "{inputs[0]}" - scopes: "_id,chembl.molecule_chembl_id" + ## there are 2016 records with drugcentral.fda_adverse_event fields + ## most of them (1994) also have the drugcentral.xrefs.chembl_id field + scopes: drugcentral.xrefs.chembl_id header: application/x-www-form-urlencoded inputs: - id: CHEMBL.COMPOUND @@ -737,14 +741,16 @@ components: semantic: Disease predicate: causes_adverse_event ## current biolink predicate ## through drugcentral, FDA Adverse Event Reporting System (FAERS) information - source: drugcentral + source: "infores:drugcentral" response_mapping: "$ref": "#/components/x-bte-response-mapping/adverseEvent" adverseEventCausedBy: - supportBatch: true inputSeparator: "," parameters: - fields: chembl.molecule_chembl_id + ## there are 2016 records with drugcentral.fda_adverse_event fields + ## most of them (1994) also have the drugcentral.xrefs.chembl_id field + fields: drugcentral.xrefs.chembl_id size: '1000' requestBody: body: @@ -758,6 +764,6 @@ components: - id: MEDDRA semantic: Disease predicate: adverse_event_caused_by ## current biolink predicate - source: drugcentral + source: "infores:drugcentral" response_mapping: - "$ref": "#/components/x-bte-response-mapping/chembl" + "$ref": "#/components/x-bte-response-mapping/drugcentral-chembl"