helpers

pdberellig.helpers.utils

Various utilities used in the pipeline

pdberellig.helpers.utils.download_chebi(out_folder)

Downloads the structures.csv.gz file from ChEBI FTP and saves to the destination folder

Parameters:

out_folder (str) – path to the output folder

Return type:

str

pdberellig.helpers.utils.get_ids_to_process_from_file(file_name)

Read in all the items to process from a file.

Parameters:

file_name (str) – Path to the file.

Returns:

List of items to be processed.

Return type:

list of str

pdberellig.helpers.utils.get_ligand_intx_chains(ligand_id)

Returns the details of ligand interacting PDB chains including chain numbers,uniprot ids and ec number by calling PDBe API

Parameters:

ligand_id (str) – ligand identifier from PDB

Return type:

DataFrame

pdberellig.helpers.utils.init_rdkit_templates(path)

Returns list of templates for cofactor classes.

Parameters:

path (str) – Path to the directory with templates

Return type:

list[CompareObj]

pdberellig.helpers.utils.parse_ligand(cif_path, ligand_type)

Parse cif file of ligand and returns Component object

Parameters:
  • cif_path (str) – path to ligand cif file

  • ligand_type (str) – type of ligand (CCD, PRD, CLC)

Return type:

Component

pdberellig.helpers.utils.setup_log(stage, mode)

Set up application log.

Parameters:
  • stage (str) – Stage of the logger in the pipeline hierarchy.

  • mode (str) – Mode of the application.

pdberellig.helpers.utils.sparql_to_df(query, sparql_url)

Returns the result of input sparql query as a data frame

Parameters:

sparql_url (str) – input sparql query

Return type:

DataFrame

pdberellig.helpers.file_utils

pdberellig.helpers.file_utils.get_chebi_iterator(chebi_file)

Returns an iterator over contents of the ChEBI_complete.sdf.gz file

Parameters:

chebi_file (str) – Path to the chebi file

Returns:

pdberellig.helpers.file_utils.get_cif_path(base_dir, ccd)

Get the path to the cif file for the given ccd.

Parameters:

base_dir (str) – Path to the base directory of the ccd files.