schrodinger.project.pandasutils module

A module which contains functions to convert between Schrodinger project data and a Pandas data frame.

class schrodinger.project.pandasutils.WhichRows(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

SELECTED = 1
ALL = 2
class schrodinger.project.pandasutils.WhichColumns(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

VISIBLE = 1
ALL = 2
schrodinger.project.pandasutils.use_pandas_utils()

Importing PandasTools has several side-effects. This context manager resets these side effects after use.

schrodinger.project.pandasutils.get_data_frame_from_project(pt: schrodinger.project.project.Project, which_rows: schrodinger.project.pandasutils.WhichRows = WhichRows.ALL, which_columns: schrodinger.project.pandasutils.WhichColumns = WhichColumns.ALL, prop_filter: Optional[str] = None, with_rdkit: bool = False, with_smiles: bool = False) pandas.core.frame.DataFrame

Return a Pandas frame given a Schrodinger project object (as might be returned from maestro.get_project_table()

Parameters
  • pt – Project (already open via Maestro or standalone) to convert

  • which_rows – Which rows from the project are to be converted (all or selected)

  • which_columns – Which columns from the project are to be converted

  • prop_filter – A regular expression which, if defined, will restrict the properties to datanames which match this expression

  • with_rdkit – A flag which indicates if RdKit MOL objects should be added. Globally modifies the way RDKit mols are represented

Returns

A Pandas dataframe populated with data from the project

Note: Calling this function with with_rdkit set to True will globally modify the way RDKit mols are represented as strings. If you want to restore the default string rendering call PandasUtils.UninstallPandasTools()