Skip to content

v3.0.2

Compare
Choose a tag to compare
@callahantiff callahantiff released this 14 Oct 07:37
· 99 commits to master since this release
5c2f2a5

Release: v3.0.2

Website: https://github.com/callahantiff/PheKnowLator/wiki/v2.0.0
Data Access: Archived Builds
Docker Container: DockerHub Dedicated Project Container
PyPI: pkt-kg 3.0.2

Updated Jupyter Notebooks:

Updated Scripts:

  • builds/data_preprocessing.py
  • pkt_kg/metadata.py
  • pkt_kg/utils/kg_utils.py
  • builds/data_to_download.txt
  • pkt_kg/utils/data_utils.py
  • tests/test_data_utils_downloading.py

Updates

  • Addresses issue #118 (PR: #119) by patching the prior functionality related to obtaining labels and definitions from ontologies. Specifically, it now ensures that whenever possible the language encoding for these fields is English. Please see details below for information on how to address nodes containing foreign characters prior to this release.

    Solution for Builds Prior to v3.0.2
    The (bad_node_patch.json - attached) file contains a dictionary where the outer keys are the entity_uri and the outer values are another dictionary where the inner keys are label and description/definition and the inner values for these inner keys are the updated strings without foreign characters. An example of this dictionary is shown below:

    key = '<http://purl.obolibrary.org/obo/UBERON_0000468>'

bad_node_patch.json.zip

print(bad_node_patch[key])

{'label': 'multicellular organism', 'description/definition': 'Anatomical structure that is an individual member of a species and consists
of more than one cell.'}


The code to identify the nodes with erroneous foreign characters is shown below:

```python
import re
import pandas as pd

# link to downloaded `NodeLabels.txt` file
input_file = `'NodeLabels.txt'`

# load data as Pandas DataFrame
nodedf = pd.read_csv(input_file, sep='\t', header=0)

# identify bad nodes and filter DataFrame so it only contains these rows
nodedf['bad'] = nodedf['label'].apply(lambda x: re.search("[\u4e00-\u9FFF]", x) if not pd.isna(x) else None)
nodedf_bad_nodes = nodedf[~pd.isna(nodedf['bad'])].drop_duplicates()