schrodinger.application.jaguar.macro_pka_utils module

class schrodinger.application.jaguar.macro_pka_utils.RowData(smiles, pop, pH_pop)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

pH_pop: float

Alias for field number 2

pop: float

Alias for field number 1

smiles: str

Alias for field number 0

schrodinger.application.jaguar.macro_pka_utils.get_aligned_mols(molecules: List[str]) dict

Align molecules (given as SMILES) by the common core of all compounds using RDKit MCS and return new RDKit mol instances.

Parameters

molecules – list of SMILES strings

Returns

dictionary of newly-oriented molecules indexed by SMILES

schrodinger.application.jaguar.macro_pka_utils.get_2Dimage(name, mol, scaling: int = 30) Optional[str]

Return image bytes of SVG file depicting a 2D structure. It doesn’t store SVG file in disk.

The optional argument <scaling> allows the image size to be adjusted dynamically according to the span of the 2D coordinates. Else a default size is used for all molecules.

Parameters
  • mol (rdkit.Mol) – RDKit mol structure to generate the image file

  • scaling – scale factor to multiply original image size by, where ‘original’ is derived from the span of the X or Y cartesian coordinates.

Returns

image bytes of 2D structure

schrodinger.application.jaguar.macro_pka_utils.get_2Dimage_png(name: str, mol, scaling: int = 30) Optional[str]

Create a PNG image file name.png depicting a 2D structure.

Note: PNG writing requires graphics libraries, which are not generally available on headless Linux servers. In this case, the method will return None.

Returns

Filename or None if PNG cannot be written

schrodinger.application.jaguar.macro_pka_utils.write_html_results_summary(pH: float, macro_pka: Dict[Tuple[int, int], float], populations: Dict[int, List[schrodinger.application.jaguar.macro_pka_utils.RowData]], jobname: str, cmdline: Optional[str] = None, scaling: int = 30, titles: Optional[Dict[str, str]] = None, page_title: Optional[str] = None) str

Create a final HTML page and PDF document summarizing tautomer populations (pH-dependent and independent) and the macro-pKa transitions.

Parameters
  • pH – compute populations at this pH

  • macro_pka – macro-pKa values and (prot_charge, deprot_charge) keys

  • populations – population data keyed by formal charge. For each charge, a list of tautomer-data should be given with three attributes: (1) smiles: SMILES string denoting tautomer structure (2) pop: pH-independent population (3) pH_pop: pH-dependent population

  • jobname – name of job to prefix file names

  • cmdline – command line string for printing

  • scaling – scale factor to multiply original image size by, where ‘original’ is derived from the span of the X or Y cartesian coordinates.

  • titles – optional structure titles keyed by SMILES; if provided, this triggers incorporation of a pH-dependent populations graph, which is expected to exist in the CWD as a .png file.

  • page_title – optional title to print at top of HTML page

Returns

filename of PDF document if it succeeds, otherwise filename of HTML file. PDF generation will fail if graphics libraries are missing.

schrodinger.application.jaguar.macro_pka_utils.graph_populations_at_pH(jobname: str, macropKas: List[float], all_label: Dict[Tuple[int, int], str], all_x: Dict[Tuple[int, int], List[float]], all_y: Dict[Tuple[int, int], List[float]], input_abs_charge: int = 0, user_pH: Optional[float] = None)

Create pH-dependent populations graph.

Parameters
  • jobname – name of job to prefix file names

  • macropKas – list of macro-pKa values to plot

  • all_label (dict[tuple, list]) – dict of labels (tautomer name). Must be in the desired order for the legend

  • all_x – dict of x values (pH) for each tautomer. Must have same keys as all_label

  • all_y – dict of y values (% population). Must have same keys as all_label

  • input_abs_charge – offset to convert relative to absolute charge

  • user_pH – user-input pH value for reference