kg_covid_19.transform_utils.chembl package¶
Submodules¶
kg_covid_19.transform_utils.chembl.chembl_transform module¶
-
class
kg_covid_19.transform_utils.chembl.chembl_transform.
ChemblTransform
(input_dir: str = None, output_dir: str = None)¶ Bases:
kg_covid_19.transform_utils.transform.Transform
Parse ChEMBL and transform them into a property graph representation.
-
parse_chembl_activity
(data: List)¶ Parse ChEMBL Activity records.
- An activity document links 4 entities,
assay
document
target
molecule
Each of the activity document will be converted to an edge that links a molecule to a target with biolink:interacts_with edge_label. The edge itself will have additional properties like ‘publications’ and ‘assay’ that references the publication and assay, respectively. The edge will also have measurements as edge properties that describe the activity/interaction further.
- Args:
data: A list of ChEMBL Activity records
- Returns:
A list
-
parse_chembl_assay
(data: List)¶ Parse ChEMBL Assay records.
- Args:
data: A list of ChEMBL Assay records
- Returns:
A list
-
parse_chembl_document
(data: List)¶ Parse ChEMBL Document records.
- Args:
data: A list of ChEMBL Document records
- Returns:
A list
-
parse_chembl_molecules
(data: List)¶ Parse ChEMBL Molecule records.
- Args:
data: A list of ChEMBL Molecule records
- Returns:
A list
-
parse_doc_fields
(record: dict, allowed_properties: set, remap: dict = None)¶ Parse a record from the API.
- Args:
record: The record or document from the API allowed_properties: properties that are to be parsed remap: properties that are to be remapped from one name to another
- Returns:
A dict of properties
-
read_json
(json_file)¶ Read in json files
- Args:
data_file: json_file to parse
- Returns:
A list of records
-
run
(data_file: Optional[str] = None, chembl_data_files: Optional[dict] = None) → None¶ Method is called and performs needed transformations to process SARS-CoV-2 subset of ChEMBL.
http://chembl.blogspot.com/2020/05/chembl27-sars-cov-2-release.html
- Args:
data_file: NOT USED - preserves to placate mypy. Use “data_files” instead chembl_data_files: data files to parse
- Returns:
None.
-
Module contents¶
-
class
kg_covid_19.transform_utils.chembl.
ChemblTransform
(input_dir: str = None, output_dir: str = None)¶ Bases:
kg_covid_19.transform_utils.transform.Transform
Parse ChEMBL and transform them into a property graph representation.
-
parse_chembl_activity
(data: List)¶ Parse ChEMBL Activity records.
- An activity document links 4 entities,
assay
document
target
molecule
Each of the activity document will be converted to an edge that links a molecule to a target with biolink:interacts_with edge_label. The edge itself will have additional properties like ‘publications’ and ‘assay’ that references the publication and assay, respectively. The edge will also have measurements as edge properties that describe the activity/interaction further.
- Args:
data: A list of ChEMBL Activity records
- Returns:
A list
-
parse_chembl_assay
(data: List)¶ Parse ChEMBL Assay records.
- Args:
data: A list of ChEMBL Assay records
- Returns:
A list
-
parse_chembl_document
(data: List)¶ Parse ChEMBL Document records.
- Args:
data: A list of ChEMBL Document records
- Returns:
A list
-
parse_chembl_molecules
(data: List)¶ Parse ChEMBL Molecule records.
- Args:
data: A list of ChEMBL Molecule records
- Returns:
A list
-
parse_doc_fields
(record: dict, allowed_properties: set, remap: dict = None)¶ Parse a record from the API.
- Args:
record: The record or document from the API allowed_properties: properties that are to be parsed remap: properties that are to be remapped from one name to another
- Returns:
A dict of properties
-
read_json
(json_file)¶ Read in json files
- Args:
data_file: json_file to parse
- Returns:
A list of records
-
run
(data_file: Optional[str] = None, chembl_data_files: Optional[dict] = None) → None¶ Method is called and performs needed transformations to process SARS-CoV-2 subset of ChEMBL.
http://chembl.blogspot.com/2020/05/chembl27-sars-cov-2-release.html
- Args:
data_file: NOT USED - preserves to placate mypy. Use “data_files” instead chembl_data_files: data files to parse
- Returns:
None.
-