API Documentation

Targets

targets.py Functions and classes for handling the target data.

class plbenchmark.targets.Target(name: str)[source]

Class to store the data of one target.

add_ligand_data()[source]

Adds data from ligands to plbenchmark.targets.target. Molecule images and the minimum and maximum affinity are added.

Returns

None

Processes primary data to have links in the html string of the target data

Returns

None

get_dataframe(columns=None)[source]

Access the target data as a pandas.DataFrame

Parameters

colslist of columns which should be returned in the pandas.DataFrame

Returns

pandas.DataFrame

get_edge_set()[source]

Get plbenchmark:edges:edgeSet associated with the target

Returns

plbenchmark:edges:edgeSet object

get_edge_set_dataframe(columns=None)[source]

Get plbenchmark:edges:edgeSet associated with the target as a pandas.DataFrame

Parameters

columns – list of columns which should be returned in the pandas.DataFrame

Returns

plbenchmark:edges:edgeSet object

get_edge_set_html(columns=None)[source]

Get plbenchmark:edges:edgeSet associated with the target in a html string

Parameters

columnslist of edge which should be returned

Returns

html string

get_graph()[source]

Get a graph representation of the ligand perturbations associated with the target in a matplotlib.figure

Returns

matplotlib.figure

get_ligand_set()[source]

Get ligandSet associated with the target

Returns

plbenchmark.ligands.ligandSet object

get_ligand_set_dataframe(columns=None)[source]

Get ligandSet associated with the target in a pandas.DataFrame

Parameters

columnslist of columns which should be returned in the pandas.DataFrame

Returns

pandas.DataFrame

get_ligand_set_html(columns=None)[source]

Get ligandSet associated with the target in a html string

Parameters

columns – list of columns which should be returned

Returns

html string

get_name()[source]

Access the name of the target.

Returns

name as a string

class plbenchmark.targets.TargetSet(*arg, **kw)[source]

Class inherited from dict to store all available targets in plbenchmark.

get_dataframe(columns=None)[source]

Convert targetSet class to pandas.DataFrame

Parameters

columnslist of columns which should be returned in the pandas.DataFrame

Returns

pandas.DataFrame

get_html(columns=None)[source]

Access the plbenchmark:targets:targetSet as a HTML string

Parameters

colslist of columns which should be returned in the pandas.DataFrame

Returns

HTML string

get_names()[source]

Get a list of available target names

Returns

list of strings

get_target(name)[source]

Accesses one target of the targetSet

Parameters

name – string name of the target

Returns

plbenchmark.targets.target class

plbenchmark.targets.get_target_data_path(target)[source]

Gets the file path of the target data

Parameters

target – string with target name

Returns

list of directories (have to be joined with ‘/’ to get the file path relative to the plbenchmark repository)

plbenchmark.targets.get_target_dir(target)[source]

Gets the directory name of the target

Parameters

target – string with target name

Returns

string with directory name

plbenchmark.targets.set_data_dir(path='/home/docs/checkouts/readthedocs.org/user_builds/plbenchmarks/checkouts/main/plbenchmark/sample_data')[source]

Gets the directory name of the target

Parameters

path – string with path to data directory

Ligands

ligands.py Functions and classes for handling the ligand data.

class plbenchmark.ligands.Ligand(d: dict, target: Optional[str] = None)[source]

Store and convert the data of one ligand in a pandas.Series.

add_mol_to_frame()[source]

Adds a image file of the ligand to the pandas.Dataframe

Returns

None

derive_observables(derived_type='dg', destination='DerivedMeasurement', out_unit=None)[source]

Derive observables from (stored) primary data, which is then stored in the pandas.DataFrame

Parameters
  • derived_type – type of derived observable, can be any of ‘dg’ ‘ki’, ‘ic50’ or ‘pic50’

  • destination – string with column name for ‘pandas.DataFrame’ where the derived observable should be stored.

  • out_unit – unit of type pint unit of derived coordinate

Returns

None

Processes primary data to have links in the html string of the ligand data

Returns

None

get_coordinate_file_path()[source]

Get file path relative to the plbenchmark repository of the SDF coordinate file of the docked ligand

Returns

file path as string

get_dataframe(columns=None)[source]

Access the ligand data as a pandas.Dataframe

Parameters

columns – list of columns which should be returned in the pandas.Dataframe

Returns

pandas.Dataframe

get_html(columns=None)[source]

Access the ligand as a HTML string

Parameters

columns – list of columns which should be returned in the pandas.Dataframe

Returns

HTML string

get_image()[source]

Creates a molecule image.

Returns

PIL.Image object

get_molecule()[source]

Get molecule object with coordinates of the docked ligand

Returns

file path as string

get_name()[source]

Access the name of the ligand.

Returns

name: string

class plbenchmark.ligands.LigandSet(target, *arg, **kw)[source]

Class inherited from dict to store all available ligands of one target.

get_dataframe(columns=None)[source]

Access the ligandSet as a pandas.Dataframe

Parameters

columnslist of columns which should be returned in the pandas.Dataframe

Returns

pandas.Dataframe

get_html(columns=None)[source]

Access the plbenchmark:ligands.ligandSet as a HTML string

Parameters

columnslist of columns which should be returned in the pandas.Dataframe

Returns

HTML string

get_ligand(name)[source]

Accesses one ligand of the ligandSet

Parameters

name – string name of the ligand

Returns

plbenchmark.ligands.ligand class

get_list()[source]

Returns list of ligands

Returns

list of ligand names

get_molecules()[source]

Returns a dict with names as keys and values as py:class:openforcefield:topology:Molecule objects

Returns

dict

Edges

edges.py Functions and classes for handling the perturbation edges.

class plbenchmark.edges.Edge(d: dict)[source]

Store and convert the data of one perturbation (“edge”) in a pandas.Series.

Parameters

ddict with the edge data

Returns

None

add_ligand_data(ligand_set)[source]

Adds data from ligands to edge. Molecule images and the affinity difference are added.

Parameters

ligand_setplbenchmark:ligands:ligandSet class of the same target

Returns

None

get_dataframe(columns=None)[source]

Access the edge data as a pandas.DataFrame

Parameters

cols – list of columns which should be returned in the pandas.DataFrame

Returns

pandas.DataFrame

get_dict()[source]

Access the edge data as a dict which contains the name of the edge as key and the names of the two ligands as list.

Returns

dict

get_name()[source]

Access the name of the edge.

Returns

name as string

class plbenchmark.edges.EdgeSet(target, *arg, **kw)[source]

Class inherited from dict to store all available edges of one target.

get_dataframe(columns=None)[source]

Access the plbenchmark:edges.edgeSet as a pandas.DataFrame

Parameters

colslist of columns which should be returned in the pandas.DataFrame

Returns

pandas.DataFrame

get_dict()[source]

Access the plbenchmark:edges.edgeSet as a dict which contains the name of the edges as key and the names of the two ligands in a list as items.

Returns

dict

get_edge(name)[source]

Accesses one edge of the plbenchmark.edges.edgeSet

Parameters

name – string name of the edge

Returns

plbenchmark:edges:edge class

get_html(columns=None)[source]

Access the plbenchmark:edges.edgeSet as a HTML string

Parameters

colslist of columns which should be returned in the pandas.DataFrame

Returns

HTML string

Utils

utils.py Contains utility functions

plbenchmark.utils.convert_error(error_value, value, original_type, final_type, temperature=300.0, out_unit=None)[source]

Converts an experimental value into another derived quantity with specified unit.

Parameters
  • error_value – float, error of val, numerical value

  • value – float, numerical value

  • original_type – string, code for the original observable. Can be dg, ki, ic50, pic50

  • final_type – string, code for the desired derived quantity. Can be dg, ki, ic50, pic50

  • temperature – float, temperature in kelvin

  • out_unit – unit of type pint, output unit of final_type, needs to fit to the requested final_type

Returns

pint.Quantity with desired unit

plbenchmark.utils.convert_value(value, original_type, final_type, temperature=300.0, out_unit=None)[source]

Converts an experimental value into another derived quantity with specified unit.

Parameters
  • value – float, numerical value

  • original_type – string, code for the original observable. Can be dg, ki, ic50, pic50

  • final_type – string, code for the desired derived quantity. Can be dg, ki, ic50, pic50

  • temperature – float, temperature in kelvin

  • out_unit – unit of type pint, output unit of final_type, needs to fit to the requested final_type

Returns

pint.Quantity with desired unit

plbenchmark.utils.find_doi_url(doi)[source]

Finds the links to a digital object identifier (doi).

Parameters

doi – string

Returns

string compiled string including the urls to the publication

plbenchmark.utils.find_pdb_url(pdb)[source]

Finds the links to a pdb or a list of pdb codes.

Parameters

pdb – string or list of strings

Returns

string compiled string including the urls to the pdb entries