schrodinger.application.jaguar.macro_pka_utils module¶
- class schrodinger.application.jaguar.macro_pka_utils.RowData(name, mol, pop, pH_pop)¶
Bases:
tuple
- mol: Mol¶
Alias for field number 1
- name: str¶
Alias for field number 0
- pH_pop: float¶
Alias for field number 3
- pop: float¶
Alias for field number 2
- class schrodinger.application.jaguar.macro_pka_utils.GraphData(x, y, labels)¶
Bases:
NamedTuple
- x: dict[tuple[int, int], list[float]]¶
Alias for field number 0
- y: dict[tuple[int, int], list[float]]¶
Alias for field number 1
- labels: dict[tuple[int, int], str]¶
Alias for field number 2
- schrodinger.application.jaguar.macro_pka_utils.register_file(name, logfile=False)¶
- schrodinger.application.jaguar.macro_pka_utils.get_aligned_mols(mols: list[rdkit.Chem.rdchem.Mol]) list[rdkit.Chem.rdchem.Mol] ¶
Align molecules by the common core of all compounds using RDKit MCS and return new RDKit mol instances.
- Parameters:
mols – list of molecules
- Returns:
list of of newly-oriented RDKit mol objects
- schrodinger.application.jaguar.macro_pka_utils.get_2Dimage(mol: Mol, scaling: int = 30) str | None ¶
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 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.is_pka_ordering_physical(macro_pka: dict[tuple[int, int], float]) bool ¶
Physically, macro-pKa values should decrease monotonically with increasing charge. However, mispredictions can break this expectation in actual calculations. Check the macro-pKa’s and return False if any of the values are reversed.
- Parameters:
macro_pka – macro-pKa values and (prot_charge, deprot_charge) keys
- Returns:
True if pKa order is physical, otherwise False
- class schrodinger.application.jaguar.macro_pka_utils.PhPopulations(pops: dict[int, dict[int, float]], macro_pkas: dict[tuple[int, int], float])¶
Bases:
object
Container for pH-dependent and pH-independent tautomer populations from a Macro-pKa calculation.
- __init__(pops: dict[int, dict[int, float]], macro_pkas: dict[tuple[int, int], float])¶
- Parameters:
pops – dict of pH-independent tautomer populations of form {charge: {tautomer_index: population}}
macro_pkas – dict of Macro-pKa equilibrium constants of form {(prot_charge, deprot_charge): pKa}
- get_populations_at_pH(pH: float) dict[int, dict[int, float]] ¶
Get populations of each tautomer at a given pH value.
- Parameters:
pH – pH at which to compute pH-dependent populations
- Returns:
pH-dependent populations in form {charge: {tautomer_index: population}}
- get_pH_population_factors(pH: float) dict[int, float] ¶
Get population factors for a given pH value, which may be used to scale the pH-independent tautomer populations to obtain the pH-dependent populations. Note that the factor is the same for all tautomers of a given molecular charge.
- Parameters:
pH – pH at which to compute population factors.
- Returns:
dict of population scaling factors keyed by charge.
- replace_calcd_pKas_with_expts(ref_pkas: list[float])¶
Match up the experimental pKas with the calculated macro-pKas such that the differences are minimized. This is done by expanding the exptl pKa list and calculating the differences between the experimental and calculated pKas. The expanded experimental pKa list with the smallest average difference is then used to map the experimental pKas to the calculated macro-pKas. There is a key assumption that all experimental macro-pKas are sequential and contiguous.
- Parameters:
ref_pkas – list of reference/experimental pKas
- Returns:
mapped experimental pKas
- schrodinger.application.jaguar.macro_pka_utils.sort_and_screen_populations(populations: dict[int, dict[int, float]], cutoff: float) list[tuple[int, int, float]] ¶
Sort tautomers by charge, pH-independent populations, and index. Screen away tautomers that are insignificant according to their pH-independent population.
Specifically, loop over charges, taking the most populated tautomer per charge in turn. Use the tautomer index to tie-break when populations are equal. Return a flat list instead of a dictionary.
- Parameters:
populations – pH-independent tautomer populations, indexed by molecular charge and tautomer index.
cutoff – cutoff for tautomer populations to include.
- Returns:
list of sorted population data list[(charge, index, population)]
- schrodinger.application.jaguar.macro_pka_utils.write_populations_report(jobname: str, tautomers: dict[int, dict[int, rdkit.Chem.rdchem.Mol]], macro_pkas: dict[tuple[int, int], float], populations: PhPopulations, user_pH: float, page_title: str | None = None, cmdline: str | None = None, names: dict[int, dict[int, str]] | None = None, scaling: int = 30, cutoff: float = 0.0001, print_warning: bool = False) str ¶
Create a final HTML page summarizing all the dominant tautomers found, the macro-pKa transitions, and pH-dependent and independent populations.
- Parameters:
jobname – name of job to prefix file names.
tautomers – tautomers of all charges, indexed by molecular charge and a unique tautomer index.
macro_pkas – macro-pKa’s for all charge transitions computed, indexed by prot/deprot charges.
populations – pH-dependent and independent tautomer populations, indexed by molecular charge and tautomer index.
user_pH – user-requested pH to show populations in table.
page_title – title to print at top of report.
cmdline – command line string for printing.
names – optional unique names for each tautomer, indexed by molecular charge and tautomer index (same as
tautomers
indices).scaling – scale factor to multiply original image size by, where ‘original’ is derived from the span of the X or Y cartesian coordinates.
cutoff – optional cutoff for tautomer populations to include (0 to 1)
print_warning – if True, print a warning about the order of the pKa values when they are unphysical.
- Returns:
absolute path to HTML file on launch machine
- schrodinger.application.jaguar.macro_pka_utils.dump_output_csv_file(jobname: str, pkas: dict[tuple[int, int], float])¶
Write Macro-pKa output to a simple .csv file
- Parameters:
jobname – name of job to prefix file names
pkas – dict of Macro-pKa’s like {(prot_charge, deprot_charge): pKa}
- schrodinger.application.jaguar.macro_pka_utils.array_abs_diff(a: ndarray, b: ndarray) ndarray ¶
Find the elementwise difference between two arrays. Used in PhPopulations.replace_calcd_pKas_with_expts()
- Parameters:
a – first array
b – second array
- Returns:
elementwise absolute difference between a and b