olorenchemengine.external package#



olorenchemengine.external.piCalculax module#

piCalculax is a library for isoelectric point prediction for chemically modified peptides.

The original library has been adapted to be incorporated into Oloren ChemEngine

For more information visit the github repository: https://github.com/EBjerrum/pICalculax

class olorenchemengine.external.piCalculax.calc_pI(ph=7.4, log=True, **kwargs)#

Bases: BaseCompoundVecRepresentation

olorenchemengine.external.piCalculax.charge(ph, pkalist, chargelist)#

Jacob Tolborgs charge model where the charge is assigned from partial charges from all pKa values at the pH point

olorenchemengine.external.piCalculax.find_pKas(mol, pkatable=[('Tetramethylrhodamine #3', _MockObject.Chem.MolFromSmiles, [-10, 1.19, 3.59, 10], [1, 1, 0, 1]), ('6-hydroxy-3H-xanthen-3-one', _MockObject.Chem.MolFromSmarts, [2.94, 6.56], [1, 0]), ('Anilin', _MockObject.Chem.MolFromSmarts, 4.87, 1), ('N-acetyl Hydrazine', _MockObject.Chem.MolFromSmarts, 2.81, 1), ('Hydrazine', _MockObject.Chem.MolFromSmarts, 8.1, 1), ('N-acetyl Piperazine', _MockObject.Chem.MolFromSmarts, 7.1, 1), ('Piperazine', _MockObject.Chem.MolFromSmarts, 9.73, 1), ('Pyridine', _MockObject.Chem.MolFromSmarts, 5.25, 1), ('Sulfonate', _MockObject.Chem.MolFromSmarts, -1.5, 0), ('Phosphonate', _MockObject.Chem.MolFromSmarts, [1.5, 7.0], [0, -1]), ('7H-Pyrimido[4,5-b][1,4]oxazine-2,4-diamine', _MockObject.Chem.MolFromSmarts, 3.6, 1), ('Tyrosine', _MockObject.Chem.MolFromSmarts, 10.3, 0), ('Histidine', _MockObject.Chem.MolFromSmarts, 6.6, 1), ('Histidine1', _MockObject.Chem.MolFromSmarts, 6.6, 1), ('Histidine2', _MockObject.Chem.MolFromSmarts, 6.6, 1), ('Glutamic Acid', _MockObject.Chem.MolFromSmarts, 4.2, 0), ('Cysteine', _MockObject.Chem.MolFromSmarts, 6.8, 0), ('Condensed Cysteine', _MockObject.Chem.MolFromSmarts, 6.8, 0), ('Condensed Cysteine', _MockObject.Chem.MolFromSmarts, 6.8, 0), ('Aspartic Acid v2', _MockObject.Chem.MolFromSmarts, 3.5, 0), ('Arginine', _MockObject.Chem.MolFromSmarts, 12.0, 1), ('Lysine', _MockObject.Chem.MolFromSmarts, 10.5, 1), ('End Carboxylate (avg)', _MockObject.Chem.MolFromSmarts, 3.3, 0), ('End Amine (avg) PseudoAtom safe', _MockObject.Chem.MolFromSmarts, 7.7, 1), ('Acrydine', _MockObject.Chem.MolFromSmarts, 6.15, 1), ('Generic Carboxylic Acid', _MockObject.Chem.MolFromSmarts, 4.75, 0), ('Generic tert. Amine, not amide', _MockObject.Chem.MolFromSmarts, 9.8, 1), ('Generic Amine, not amide', _MockObject.Chem.MolFromSmarts, 10.0, 1)], condensedtable=[('Condensed Tyrosine', _MockObject.Chem.MolFromSmarts, 10.3, 0), ('Condensed Histidine', _MockObject.Chem.MolFromSmarts, 6.6, 1), ('Condensed Glutamic Acid', _MockObject.Chem.MolFromSmarts, 4.2, 0), ('Condensed Aspartic Acid', _MockObject.Chem.MolFromSmarts, 3.5, 0), ('Condensed Arginine', _MockObject.Chem.MolFromSmarts, 12.0, 1), ('Condensed Lysine', _MockObject.Chem.MolFromSmarts, 10.5, 1), ('Condensed AA end amino', _MockObject.Chem.MolFromSmarts, 7.7, 1), ('Condensed cys end amino', _MockObject.Chem.MolFromSmarts, 7.7, 1), ('Condensed AA end Carboxylic', _MockObject.Chem.MolFromSmarts, 3.3, 0)], debug=False, returnindices=False)#

This function finds pKa values in a supplied molecule by matching it up to SMARTS rules in a table Returns the list of pKa values and a list with the charge of the group at pH levels blow the pKa. Example: So histidine has a +1 charge at pH levels below the pKa of ~6

olorenchemengine.external.piCalculax.pI(pkalist, chargelist)#

Uses Jacob Tolborgs charge function and calculates pI. If only only acidic or basic groups are found, the pI is ill defined and returned as 42 or -42

olorenchemengine.external.stoned module#

olorenchemengine.external.stoned.get_mutated_SELFIES(selfies_ls, num_mutations)#

Mutate all the SELFIES in ‘selfies_ls’ ‘num_mutations’ number of times.

Parameters: selfies_ls (list) : A list of SELFIES num_mutations (int) : number of mutations to perform on each SELFIES within ‘selfies_ls’

Returns: selfies_ls (list) : A list of mutated SELFIES


Obtain a list of all selfie characters in string selfie

Parameters: selfie (string) : A selfie string - representing a molecule

Example: >>> get_selfie_chars(‘[C][=C][C][=C][C][=C][Ring1][Branch1_1]’) [‘[C]’, ‘[=C]’, ‘[C]’, ‘[=C]’, ‘[C]’, ‘[=C]’, ‘[Ring1]’, ‘[Branch1_1]’]

Returns: chars_selfie: list of selfie characters present in molecule selfie

olorenchemengine.external.stoned.mutate_selfie(selfie, max_molecules_len, write_fail_cases=False, index=None)#

Return a mutated selfie string (only one mutation on selfie is performed)

Mutations are done until a valid molecule is obtained Rules of mutation: With a 33.3% propbabily, either:

  1. Add a random SELFIE character in the string

  2. Replace a random SELFIE character with another

  3. Delete a random character

Parameters: selfie (string) : SELFIE string to be mutated max_molecules_len (int) : Mutations of SELFIE string are allowed up to this length write_fail_cases (bool) : If true, failed mutations are recorded in “selfie_failure_cases.txt”

Returns: selfie_mutated (string) : Mutated SELFIE string smiles_canon (string) : canonical smile of mutated SELFIE string


Returns a random (dearomatized) SMILES given an rdkit mol object of a molecule. Parameters: mol (rdkit.Chem.rdchem.Mol) : RdKit mol object (None if invalid smile string smi)

Returns: mol (rdkit.Chem.rdchem.Mol) : RdKit mol object (None if invalid smile string smi)


Return a canonical smile representation of smi

Parameters: smi (string) : smile string to be canonicalized

Returns: mol (rdkit.Chem.rdchem.Mol) : RdKit mol object (None if invalid smile string smi) smi_canon (string) : Canonicalized smile representation of smi (None if invalid smile string smi) conversion_successful (bool): True/False to indicate if conversion was successful

Module contents#