Skip to content

Commit

Permalink
Merge pull request #272 from RobokopU24/drugcentral-logscale-potencies
Browse files Browse the repository at this point in the history
Convert activity type mapping to log-scale.
  • Loading branch information
EvanDietzMorris authored Dec 9, 2024
2 parents 43874d9 + 2a39e3a commit fcf6611
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion parsers/BINDING/src/loadBINDINGDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from Common.utils import GetData, GetDataPullError
from Common.loader_interface import SourceDataLoader
from Common.extractor import Extractor
from Common.biolink_constants import PUBLICATIONS, AFFINITY, AFFINITY_PARAMETER, KNOWLEDGE_LEVEL, AGENT_TYPE, KNOWLEDGE_ASSERTION, MANUAL_AGENT
from Common.biolink_constants import PUBLICATIONS, AFFINITY, AFFINITY_PARAMETER, KNOWLEDGE_LEVEL, AGENT_TYPE, \
KNOWLEDGE_ASSERTION, MANUAL_AGENT

# Full Binding Data.

Expand Down
5 changes: 2 additions & 3 deletions parsers/PHAROS/src/loadPHAROS.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import argparse
import re
import requests

from Common.loader_interface import SourceDataLoader, SourceDataBrokenError, SourceDataFailedError
from Common.kgxmodel import kgxnode, kgxedge
Expand Down Expand Up @@ -386,11 +385,11 @@ def get_edge_props(self, result) -> (str, list, dict, str):
# if there was affinity data save it
affinity = result['affinity']
if affinity is not None and affinity != '':
props['affinity'] = float(affinity)
props[AFFINITY] = float(affinity)

affinity_paramater = result['affinity_parameter']
if affinity_paramater:
props['affinity_parameter'] = f'p{result["affinity_parameter"]}'
props[AFFINITY_PARAMETER] = f'p{result["affinity_parameter"]}'

# return to the caller
return predicate, pmids, props, provenance
Expand Down
6 changes: 3 additions & 3 deletions parsers/drugcentral/src/loaddrugcentral.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from Common.loader_interface import SourceDataLoader, SourceDataFailedError, SourceDataBrokenError
from Common.utils import GetData, snakify
from Common.biolink_constants import PRIMARY_KNOWLEDGE_SOURCE, AGGREGATOR_KNOWLEDGE_SOURCES, PUBLICATIONS, \
KNOWLEDGE_LEVEL, KNOWLEDGE_ASSERTION, AGENT_TYPE, MANUAL_AGENT
KNOWLEDGE_LEVEL, KNOWLEDGE_ASSERTION, AGENT_TYPE, MANUAL_AGENT, AFFINITY, AFFINITY_PARAMETER
from Common.prefixes import DRUGCENTRAL, MEDDRA, UMLS, UNIPROTKB, PUBMED
from Common.predicates import DGIDB_PREDICATE_MAPPING
from Common.db_connectors import PostgresConnector
Expand Down Expand Up @@ -186,8 +186,8 @@ def get_bioactivity_attributes(self, line):
edge_props = {KNOWLEDGE_LEVEL: KNOWLEDGE_ASSERTION,
AGENT_TYPE: MANUAL_AGENT}
if line['act_type'] is not None:
edge_props['affinity'] = line['act_value']
edge_props['affinityParameter'] = line['act_type']
edge_props[AFFINITY] = line['act_value']
edge_props[AFFINITY_PARAMETER] = f"p{line['act_type']}"
if line['act_source'] == 'SCIENTIFIC LITERATURE' and line['act_source_url'] is not None:
papersource = line['act_source_url']
if papersource.startswith('http://www.ncbi.nlm.nih.gov/pubmed'):
Expand Down

0 comments on commit fcf6611

Please sign in to comment.