rdkit_to_params package

Subpackages

Module contents

The class Params is the main class of the package. It is used to generate the params file (residuetype definitions for Rosetta) from an RDKit molecule or another params file.

“””

The main class here is Params. All underscore base classes are not meant to be used standalone. Entries is the class for an list of entries of the same kind.

class rdkit_to_params.Params[source]

Bases: _ParamsIoMixin, _RDKitMixin, _PoserMixin

Params creates and manipulates params files. It can handles several types of params operations, such as “atom name surgery” and rdkit.Chem.Mol to a params file.

## Key methods

  • Params.load(filename) will instantiate from file.

  • Params.from_mol(mol) will instantiate from Chem.Mol

  • p.dump(filename) will save a file.

  • loads and dumps for strings.

  • p.fields will return all header fields.

  • p.test tests the params file in PyRosetta.

  • p.rename_atom(old, new) changes an atom name

## Attributes

The attributes are generally the uppercase line headers, with a few exceptions.

  • .comments is for # lines

  • “BOND_TYPE” and “BOND” are merged into .BOND.

  • “UPPER”, “LOWER” and “CONNECT” are merged into .CONNECT

With the exception of .NAME which depends on .IO_STRING basically all the header type attributes are actually instances of the class Entries, which holds a sequence of specific entries. see entry.py for the properties of each. These can be a singleton, such as .IO_STRING which when a new line is added it gets overwritten instead, or not like say .ATOM. That is to say that .ATOM[0] will give the first atom as expected, but this has to be done for .IO_STRING[0] too.

Atomnames…

  • p.get_correct_atomname will return the 4 letter name of the atom with nice spacing.

  • p.rename_atom will change one atomname to a new one across all entries.

  • BOND, CHI, CUT_BOND entries store 4 char atomnames as .first, .second, .third, .fourth.

  • ICOOR_INTERNAL entries store 5 char atomnames as .child,``.parent``,``.second_parent``,``.third_parent``.

  • ATOM_ALIAS, NBR_ATOM, FIRST_SIDECHAIN_ATOM, ADD_RING are just entries.GenericEntries instances, where .body is a string which will contain the atomname.

  • METAL_BINDING_ATOMS, ACT_COORD_ATOMS are entries.GenericListEntries instances where .values is a list of string with maybe atomnames.

## Inheritance

It inherits several class, which are not not mean to be used standalone, except for testing.

The pyrosetta and rdkit functionality are dependent on these being installed.

  • _ParamsIoMixin adds read write, and inherits

  • _ParamsInitMixin which adds the basics.

  • _PoserMixin is a base that adds pyrosetta functionality if avaliable.

  • _RDKitCovertMixin, which adds rdkit from_mol conversion functionality, the class is split in two, the other part being

  • _RDKitParamsPrepMixin, which prepares the molecule for _RDKitCovertMixin.from_mol`.

property NAME
_Measure

alias of Measure

__init__()
_add_genrtypes() None

Add Rosetta Atom types to each atom.

_add_icoor(atoms: List[Atom]) None
_add_partial_charges()
_add_partial_charges_OLD()

This is pointless convoluted. :return:

_add_rtypes() None

Add Rosetta Atom types to each atom. Mostly a guess…

_aminoacid_override(elemental)
_change_conn_for_terminal(connection_idx, new_name)[source]

LOWER_CONNECT attaches to N UPPER_CONNECT attaches to C

Parameters:
  • connection_idx

  • new_name

Returns:

_find_centroid()
_fix_atom_names()
classmethod _from_smiles_w_pdb(pdb: Mol, smiles, generic, name)
_get_PDBInfo_atomname(atom, throw=True) str
_get_atom_descriptors(atom: Atom) dict
_get_measurements(conf: Conformer, a: Atom, b: Atom, c: Atom, d: Atom)
_get_nondummy_neighbors(atom) List[str]
_get_resn_from_PDBInfo()

Gets the residue name for PDB info.

Returns:

_get_unseen_neighbors(atom: Atom, seen: List[Atom], nondummy: bool = True)
_parse_atom(atom: Atom) None
_parse_atoms()
_parse_bond(bond: Bond) None
_parse_bonds()
_parse_icoors() None
_parse_line(line, skip_unknown: bool = True)
_parse_rotatables()

I am not sure if this is right… I do not know if a C(=O)-C=O is rotatable (cis-trans).

Returns:

_parse_w_virtuals()

Add 1 or 2 vanadium (virtual) atoms, 0.1A away :return:

_prep_dump_pdb(filename: str, overwrite=False, stripped=True) Mol
_prep_for_terminal(mainchain_atoms: List[str] | None = None, connection_idx: int = 1)[source]

p = Params.from_smiles(’C(=O)[C@@]1NC(=O)CC1’, name=’CAP’, atomnames=[None, ‘C’, ‘O’, ‘CA’, ‘N’]) p.make_N_terminal_cap(mainchain_atoms=[‘C’, ‘O’, ‘CA’, ‘N’]) import nglview as nv view = nv.show_rosetta(p.to_polymeric_pose(sequence=’X[CAP]AA’)) view.add_hyperball(’’) view

_prevent_overcycling()
_relax(pose, scorefxn: <MagicMock name='mock.ScoreFunction' id='140242464984704'> | None = None, cycles: int | None = 15)
_rename_atom_in_entries(oldname, newname)[source]
_repr_html_()
_set_PDBInfo_atomname(atom, name, overwrite=False)
add_Hs(add_conformer=True)

Add Hs before convert_mol step!

The add add_conformer is legacy. :return:

add_conformer()
classmethod add_names(mol: Mol, atomnames: None | dict | list | str | Mol, name: str | None = None) Mol

Quick way to add atom names to a mol object –adds them the normal way.

Parameters:
  • mol – Chem.Mol, will actually be edited in place.

  • names – list/dict/str/chem of unique names.

  • name – 3letter code for the molecule.

Returns:

the mol

add_residuetype(pose: <MagicMock name='mock.Pose' id='140242464065424'>, reset: bool = True) <MagicMock name='mock.rosetta.core.chemical.ResidueTypeSet' id='140242463785936'>

Adds the params to a copy of a residue type set of a pose. If reset is True it will also save it as the default RTS —it keeps other custom residue types.

Parameters:
  • pose

  • reset

Returns:

convert_mol()

This method does the actual conversion to params entries

Returns:

property dummyless
dump(filename: str) None
dump_pdb(filename: str, overwrite=False, stripped=True) None

Write first conformer to a PDB file.

Parameters:
  • filename – name of file.

  • overwrite – error if exists?

  • stripped – remove * atoms?

Returns:

None

dump_pdb_conf(filename: str, overwrite=False, stripped=True) int

Write conformers to a PDB file.

Parameters:
  • filename – name of file.

  • overwrite – error if exists?

  • stripped – remove * atoms?

Returns:

number of conf written

dumps(html=False) str
dumps_pdb(stripped=True) str
property fields

This operates under the assumption that the user may have added extra uppercase entries!

Returns:

fix_mol()
classmethod from_mol(mol: Mol, name: str | None = None, generic: bool = False, atomnames: Dict[int, str] | None = None) _RDKitInitMixin

This calls load_mol and then convert_mol with optional atomnames changes.

Parameters:
  • mol (Chem.Mol) – Rdkit molecule, with explicit protons and all.

  • name (str) – 3-letter name

  • generic (bool) – convert mol with generic or classic AtomTypes?

  • atomnames – optional dictionary to set names.

Return type:

instance

classmethod from_smiles(smiles: str, name='LIG', generic: bool = False, atomnames: Dict[int, str] | None = None) _RDKitInitMixin

Make a Params instance from a smiles.

Parameters:
  • smiles – SMILES to use.

  • name – name3/resn

  • generic – use generic atoms types

  • atomnames – optional dictionary to set names.

Returns:

classmethod from_smiles_w_pdbblock(pdb_block: str, smiles: str, generic: bool = False, name='LIG', proximityBonding: bool = True)

Assumes there is only one residue of the resn/name3

Parameters:
  • pdb_block

  • generic (bool) – convert mol with generic or classic AtomTypes?

  • name (str) – 3-letter name

  • proximityBonding (bool) – rdkit option for Chem.MolFromPDBFile. Did the author of the pdb not add CONECT?

Return type:

instance

classmethod from_smiles_w_pdbfile(pdb_file: str, smiles: str, generic: bool = False, name='LIG', proximityBonding: bool = True)

Assumes there is only one residue of the resn/name3

Parameters:
  • pdb_file

  • generic (bool) – convert mol with generic or classic AtomTypes?

  • name (str) – 3-letter name

  • proximityBonding (bool) – rdkit option for Chem.MolFromPDBFile. Did the author of the pdb not add CONECT?

Return type:

instance

get_atom_by_name(name)
get_correct_atomname(name: str) str[source]

Given a name, gets the correctly spaced out one as appears in the ATOM entry. To pad out a name use pad_name This has nothing to do with ._get_PDBInfo_atomname which just returns the atom name from a Chem.Atom.

Parameters:

name – dirty name

Returns:

correct name

greekification = True
greekify(ascii=True)

Converts the atom names into relative names, i.e. using the Greek alphabet.

Its name is terrible, but hellenify or translitterate are too confusing.

If ascii is True, these will be Greek-like letters else they will be actual Greek Unicode letters if it is not – A really terrible idea. (In PyMOL, it will not read. In Rosetta, Unicodes cause strange errors, e.g. “Can’t add atom named ` CΒ` to ResidueType as it already has one with that name.” even if it isn’t) Also, no PBD file has CA with upper case alpha). It is mainly as an experiment to see what happens TBH

is_aminoacid()[source]
classmethod load(filename: str, skip_unknown: bool = True)
classmethod load_mol(mol: Mol, generic: bool = False, name: str | None = None) _RDKitPrepMixin

A fully prepared molecule with optional dummy atoms to be coverted into a Params object This simply loads the molecule. The classmethod from_mol calls load_mol and then fixes the molecule.

Parameters:
  • mol – fully prepared molecule with optional dummy atoms

  • generic – generic or classic atom types

  • name – 3 letter name

Returns:

classmethod load_smiles(smiles: str, generic: bool = False, name: str | None = None) _RDKitPrepMixin

A SMILES with optional dummy atoms to be coverted into a Params object

Parameters:
  • smiles – can contain multiple *

  • generic – generic or classic atom types

  • name – 3 letter name

Returns:

classmethod loads(text: str, skip_unknown: bool = True)
log = <Logger rdkit_to_params (WARNING)>
make_C_terminal_cap(mainchain_atoms=None, connection_idx=1)[source]

Make current covalent compound into a C-terminal cap, aka. goes on the C-terminal end of the peptide. That is the compound has a N-terminus (UPPER)

Parameters:
  • mainchain_atoms – mainchain atoms.

  • connection_idx – Fortran indiced

Returns:

make_N_terminal_cap(mainchain_atoms=None, connection_idx=1)[source]

Make current covalent compound into a N-terminal cap, aka. goes on the N-terminal end of the peptide. That is the compound has a C-terminus (LOWER) LOWER_CONNECT attaches to N so should be None.

Parameters:

connection_idx – Fortran indiced

Returns:

move_aside()

Changes the names of the atoms to not clash.

Returns:

move_back()

Removes the ugly XX!

Returns:

property nbr
ordering = ['NAME', 'IO_STRING', 'TYPE', 'AA', 'ROTAMER_AA', '#ATOM', 'ATOM_ALIAS', 'BOND', 'CHARGE', 'CUT_BOND', 'CHI', 'CONNECT', 'ADD_RING', 'PROPERTIES', 'VARIANT', 'METAL_BINDING_ATOMS', 'FIRST_SIDECHAIN_ATOM', 'MAINCHAIN_ATOMS', 'BACKBONE_AA', 'RAMA_PREPRO_FILENAME', 'ACT_COORD_ATOMS', 'NBR_ATOM', 'NBR_RADIUS', 'ICOOR_INTERNAL', 'PDB_ROTAMERS']
classmethod pad_name(name, atom=None)
static params_to_pose(paramsfile: str, name: str) <MagicMock name='mock.Pose' id='140242464065424'>

Staticmethod to get a pose from a params file.

Parameters:
  • paramsfile – params file.

  • name – 3-letter residue name.

Returns:

polish_mol(resi=1, chain='X')

The mol may be inconsistent in its PDBResidueInfo

Returns:

rename(atomnames: None | dict | list | str | Mol) None

Rename options for atomnames:

  • None: nothing

  • Dict: rename_from_dict

  • List: rename_from_list

  • str in ‘1:XX, 3:YY’ format: rename_from_dict via rename_from_str

  • str in ‘XX,YY’ format: rename_from_list via rename_from_str

  • Chem.Mol: rename_from_template

Parameters:

atomnames – renaming values

Returns:

rename_atom(atom_or_atomname: str | Atom, newname: str, overwrite=True) str | None[source]

rename an atom by atomname or Chem.Atom (the former just calls rename_atom_by_name as is just for legacy)

calls rename_atom_by_name -> _rename_atom_in_entries

Parameters:
  • atom_or_atomname

  • newname

Returns:

rename_atom_by_name(oldname: str, newname: str) str[source]

Change the atom name from oldname to newname and returns the 4 char newname.

Parameters:
  • oldname – atom name, preferably 4 char long.

  • newname – atom name, preferably 4 char long.

Returns:

4 char newname

rename_by_substructure(substructure: Mol, atomnames: Sequence[str]) List[str]

Assigns to the atoms in self.mol the names based on the backbone template and the names variable. See _fix_atom_names for example usage. Changes also params.

Parameters:
  • substructure

  • atomnames – the list oof new names. Falsey names will not be set.

Returns:

the list of the old names.. why? May change in future.

rename_from_dict(atomnames: Dict[int, str])

Renames the self.mol atom names by a dict that has key atom idx and value name

Parameters:

atomnames – idx -> new name

Returns:

rename_from_list(atomnames: List[str])

Renames the self.mol atom names based on the order in list. If None it is skipped.

Parameters:

atomnames – list of unique names.

Returns:

rename_from_str(atomnames: str)
  • ‘1:XX, 3:YY’ format: calls rename_from_dict

  • ‘XX,YY’ format: calls rename_from_list

Parameters:

atomnames – str

Returns:

rename_from_template(template: Mol, overwrite: bool = True)

Assigns to the atoms in self.mol the names based on the template, which does not need to be a perfect match. See _fix_atom_names for example usage. Does not change the Params.

Parameters:

template – mol object with atom names

Returns:

None for now.

rename_repeated_atoms()
retype_by_name(mapping: Dict[str, str])

Renames the atom names in self.mol by changing key to value of the mapping dictionary.

Parameters:

mapping – old name to new name

Returns:

static split_stereoisomers(mol: Mol) Dict[str, List[Mol]]

Utility to split stereoisomers of amino acids into L/D

Parameters:

mol

Returns:

dict of keys ‘levo’, ‘dextro’, ‘neither’, ‘both’

test(outfile: str | None = None) <MagicMock name='mock.Pose' id='140242464065424'>

Makes a pose with the ligand to see if it works.

Parameters:

outfile – optionally save file.

Returns:

pose

to_polymeric_pose(relax=False, sequence: str | None = None)
to_pose(relax=False)
validate()[source]

Submodules

rdkit_to_params.constraint module

This contains make_constraint which is creates a constraint file. It is completely independent and different in style because it was different. It is not integral to the conversion, it’s just a utility.

class rdkit_to_params.constraint.Constraints(smiles: Tuple[str, str], names: List[str], ligand_res: str | int, target_res: str | int)[source]

Bases: object

__init__(smiles: Tuple[str, str], names: List[str], ligand_res: str | int, target_res: str | int)[source]

Generate the required constraints for a covalent bond as CONN1 does not deal with distance and torsions.

Give smiles of the two sides (with *) and the names, residue numbers convert. It requires 2 atoms on each side in addition to the attachment point. Note that the atom names are stored in a non-standard way out of laziness. in the Atom prop ‘_AtomName’. The instance has the following attributes

  • smiles: stored input smiles string

  • names: stored input list of names

  • ligand_res: stored input ligand residue

  • target_res: stored input protein residue

  • cov_template: Chem.Mol from first smiles.

  • target_template: Chem.Mol from first smiles

  • combo: combined templates

  • atom_pair_constraint: AtomPair

  • angle_constraint: Angle . NB. this is two lines.

  • dihedral_constraint: dihedral

  • coordinate_constraint: coordinate (see make_coordinate_constraint methods)

  • custom_constaint: user added these

Class methods: * assign_names(mol, list) classmethods that assigns names (dodgy ‘_AtomName’) to a mol in place. * nominalise(mol) propagate the nonstandard names (good for saving sdf) * join_by_dummy(molA, molB) classmethods that returns a joined molecule

>>> Constraints(smiles=('*C(=N)', '*SC'), names= ['*', 'CX', 'NY', '*', 'SG', 'CB'], ligand_res= '1B', target_res='145A')

AtomPair SG 145A CX 1B HARMONIC 1.74 0.2

Angle CB 145A SG 145A CX 1B HARMONIC 1.73 0.35

Angle SG 145A CX 1B NY 1B HARMONIC 2.08 0.35

Dihedral CB 145A SG 145A CX 1B NY 1B CIRCULARHARMONIC -3.14 0.35

Parameters:
  • smiles – a tuple/list of two string. The first is the ligand, the second is the peptide.

  • names – a list of atom names. The ‘*’ will need a name -but will be ignored-, but not the H.

  • ligand_res – ligand residue in pose or PDB format (12 vs. 12A)

  • target_res – peptide residue in pose or PDB format (12 vs. 12A)

_get_conformer(mol)[source]
classmethod _get_new_index(mol: Mol, index: int) int[source]
_repr_html_()[source]
property angle_covalent
property angle_target
classmethod assign_names(mol: Mol, names: List[str]) None[source]

Stores names of atoms as given in the list. totally non-standard way. PDBInfo is correct way. But too much effort.

property conformer
property dihedral
property distance
dump(filename)[source]
dumps()[source]
get_atom(mol: Mol, name: str) Atom[source]
classmethod get_conn(mol: Mol) Atom[source]

Get connecting atom of mol.

classmethod join_by_dummy(a: Mol, b: Mol) Mol[source]
classmethod make_coordinate_constraints(mol, ligand_res, ref_res, ref_atomname='CA', stdevs: Dict[str | int, float] | None = None) Constraints[source]

Returns an instance (or the same instance if called as a bound method) with added .coordinate_constraint. If no stdevs are supplied all non dummy atoms have a HARMONIC with std 1.

Parameters:
  • mol

  • ligand_res

  • ref_res

  • ref_atomname

  • stdevs (Union[str,int], float]]) – stdev to use for HARMONIC. dictionary with keys either integer (AtomIdx) or str (atomname)

Returns:

classmethod make_inverse_coordinate_constraints_by_neighbours(mol, ligand_res, unfixed: List[str], ref_res, ref_atomname='CA') Constraints[source]

Given a list of indices constraint their distant neighbours. This is basically for modify those atoms. E.g. given one structure, make a variant.

Parameters:
  • mol

  • ligand_res

  • unfixed

  • ref_res

  • ref_atomname

Returns:

classmethod mock()[source]

This is an empty instance.

Returns:

classmethod nominalise(*args, **kwargs)[source]
classmethod nominalize(mol)[source]

If the mol has PDBResidueInfo it will fill the nonstandard mol prop _AtomNames and the atom prop _AtomName. If it has mol prop _AtomNames will propagate them down to the atoms and viceversa. But will not fill PDBResidueInfo because there is too much metadata required.

Parameters:

mol

Returns:

rdkit_to_params.entries module

The main class here is Entries`, which is a fancy list. It gets called for each uppercase attribute in the initialisation of Params (which happens in _ParamsInitMixin __e.g.__ Entries.from_name('IO_STRING')).

class rdkit_to_params.entries.AAEntry(body: str = 'UNK')[source]

Bases: GenericEntry

__init__(body: str = 'UNK')[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.ACT_COORD_ATOMSEntry(*args: str)[source]

Bases: GenericListEntry

__init__(*args: str)[source]
_repr_html_()
classmethod from_str(text)
class rdkit_to_params.entries.ADD_RINGEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.ATOMEntry(name: str, rtype: str, mtype: str = 'X', partial: float = 0)[source]

Bases: object

__init__(name: str, rtype: str, mtype: str = 'X', partial: float = 0) None
_repr_html_()[source]
classmethod from_str(text: str)[source]
mtype: str = 'X'
name: str
partial: float = 0
rtype: str
class rdkit_to_params.entries.ATOM_ALIASEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.BACKBONE_AAEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.BONDEntry(first: str, second: str, order: int = 1)[source]

Bases: object

dataclass class for both BOND and BOND_ENTRY. The __str__ method will know based on .order. The hash is the two atom names sorted. So BOND records with the same names will be equal.

__init__(first: str, second: str, order: int = 1) None
_repr_html_()[source]
first: str
classmethod from_str(text: str)[source]
order: int = 1
second: str
class rdkit_to_params.entries.CHARGEEntry(atom: str, charge: int)[source]

Bases: object

No idea if anything respects this.

__init__(atom: str, charge: int) None
_repr_html_()[source]
atom: str
charge: int
classmethod from_str(text: str)[source]
class rdkit_to_params.entries.CHIEntry(index: int, first: str, second: str, third: str, fourth: str)[source]

Bases: object

__init__(index: int, first: str, second: str, third: str, fourth: str) None
_repr_html_()[source]
first: str
fourth: str
classmethod from_str(text: str)[source]
index: int
second: str
third: str
class rdkit_to_params.entries.CONNECTEntry(atom_name: str, index: int = 1, connect_type: str = '', connect_name: str = '')[source]

Bases: object

This is a mess, but it guesses what you mean. Deals with UPPER, LOWER and CONNECT.

__init__(atom_name: str, index: int = 1, connect_type: str = '', connect_name: str = '') None
_repr_html_()[source]
atom_name: str
connect_name: str = ''
connect_type: str = ''
classmethod from_str(text)[source]
index: int = 1
class rdkit_to_params.entries.CUT_BONDEntry(first: str, second: str)[source]

Bases: object

No idea what CUT_BOND is for.

__init__(first: str, second: str) None
_repr_html_()[source]
first: str
classmethod from_str(text: str)[source]
second: str
class rdkit_to_params.entries.CommentEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.Entries(entry_cls, singleton: Singletony = Singletony.singleton)[source]

Bases: MutableSequence

A fancy default list, where the elements are instances of whatver is in entry_cls. It can be initialised via the class method from_name which accepst a string that has to be present in the class attribute .choices. The .append method can work with str, list, dict or instance of the actual class it wants. Note that the string for the string way must be without the header to the line. The entry classes requires a from_str classmethod that returns an instance for this. They also require __str__ method as this is how the entries are converted into string.

Entries.from_name('BOND')

__init__(entry_cls, singleton: Singletony = Singletony.singleton)[source]

The entries class is a fancy constrained list. The data is actually stored in .data.

Parameters:
  • entry_cls – what is the allowed class of the entries

  • singleton – is only one entry allowed?

_abc_impl = <_abc_data object>
_assign_value(value)[source]
_repr_html_()[source]
append(value)

S.append(value) – append value to the end of the sequence

choices = {'#': (<class 'rdkit_to_params.entries.CommentEntry'>, <Singletony.multiton: 0>), '<UNKNOWN>': (<class 'rdkit_to_params.entries.UNKNOWNEntry'>, <Singletony.multiton: 0>), 'AA': (<class 'rdkit_to_params.entries.AAEntry'>, <Singletony.singleton: 1>), 'ACT_COORD_ATOMS': (<class 'rdkit_to_params.entries.ACT_COORD_ATOMSEntry'>, <Singletony.singleton: 1>), 'ADD_RING': (<class 'rdkit_to_params.entries.ADD_RINGEntry'>, <Singletony.multiton: 0>), 'ATOM': (<class 'rdkit_to_params.entries.ATOMEntry'>, <Singletony.multiton: 0>), 'ATOM_ALIAS': (<class 'rdkit_to_params.entries.ATOM_ALIASEntry'>, <Singletony.multiton: 0>), 'BACKBONE_AA': (<class 'rdkit_to_params.entries.BACKBONE_AAEntry'>, <Singletony.singleton: 1>), 'BOND': (<class 'rdkit_to_params.entries.BONDEntry'>, <Singletony.multiton: 0>), 'CHARGE': (<class 'rdkit_to_params.entries.CHARGEEntry'>, <Singletony.multiton: 0>), 'CHI': (<class 'rdkit_to_params.entries.CHIEntry'>, <Singletony.multiton: 0>), 'CONNECT': (<class 'rdkit_to_params.entries.CONNECTEntry'>, <Singletony.multiton: 0>), 'CUT_BOND': (<class 'rdkit_to_params.entries.CUT_BONDEntry'>, <Singletony.multiton: 0>), 'FIRST_SIDECHAIN_ATOM': (<class 'rdkit_to_params.entries.FIRST_SIDECHAIN_ATOMEntry'>, <Singletony.singleton: 1>), 'ICOOR_INTERNAL': (<class 'rdkit_to_params.entries.ICOOR_INTERNALEntry'>, <Singletony.multiton: 0>), 'IO_STRING': (<class 'rdkit_to_params.entries.IO_STRINGEntry'>, <Singletony.singleton: 1>), 'MAINCHAIN_ATOMS': (<class 'rdkit_to_params.entries.MAINCHAIN_ATOMS'>, <Singletony.list_singleton: 2>), 'METAL_BINDING_ATOMS': (<class 'rdkit_to_params.entries.METAL_BINDING_ATOMSEntry'>, <Singletony.singleton: 1>), 'NBR_ATOM': (<class 'rdkit_to_params.entries.NBR_ATOMEntry'>, <Singletony.singleton: 1>), 'NBR_RADIUS': (<class 'rdkit_to_params.entries.NBR_RADIUSEntry'>, <Singletony.singleton: 1>), 'PDB_ROTAMERS': (<class 'rdkit_to_params.entries.PDB_ROTAMERSEntry'>, <Singletony.singleton: 1>), 'PROPERTIES': (<class 'rdkit_to_params.entries.PROPERTIESEntry'>, <Singletony.list_singleton: 2>), 'RAMA_PREPRO_FILENAME': (<class 'rdkit_to_params.entries.RAMA_PREPRO_FILENAMEEntry'>, <Singletony.singleton: 1>), 'ROTAMER_AA': (<class 'rdkit_to_params.entries.ROTAMER_AAEntry'>, <Singletony.singleton: 1>), 'TYPE': (<class 'rdkit_to_params.entries.TYPEEntry'>, <Singletony.singleton: 1>), 'VARIANT': (<class 'rdkit_to_params.entries.VARIANTEntry'>, <Singletony.list_singleton: 2>), 'comment': (<class 'rdkit_to_params.entries.CommentEntry'>, <Singletony.multiton: 0>)}
clear() None -- remove all items from S
count(value) integer -- return number of occurrences of value
extend(values)

S.extend(iterable) – extend sequence by appending elements from the iterable

classmethod from_name(name: str)[source]
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

insert(index, value)[source]

S.insert(index, value) – insert value before index

pop([index]) item -- remove and return item at index (default last).

Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse()

S.reverse() – reverse IN PLACE

class rdkit_to_params.entries.FIRST_SIDECHAIN_ATOMEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.GenericEntry(header: str, body: str)[source]

Bases: object

This is meant to be inherited. header is the entry type. body is a string.

__init__(header: str, body: str)[source]
_repr_html_()[source]
classmethod from_str(text)[source]
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.GenericListEntry(header: str, *args: str)[source]

Bases: object

This is meant to be inherited. header is the entry type. values is a list of strings.

__init__(header: str, *args: str)[source]
_repr_html_()[source]
classmethod from_str(text)[source]
class rdkit_to_params.entries.ICOOR_INTERNALEntry(child: str, phi: float, theta: float, distance: float, parent: str, second_parent: str, third_parent: str)[source]

Bases: object

Lines stolen from Rosetta documentation > Child Phi Angle Theta Distance Parent Angle Torsion > ICOOR_INTERNAL C14 167.536810 59.880644 1.473042 N2 C11 C12

  • Child atom (A4)

  • phi angle (torsion angle between A1, A2, A3, A4)

  • theta angle (improper angle = (180 - (angle between A4, A3, A2)))

  • distance (between A4 and A3)

  • parent atom (A3)

  • angle atom (A2)

  • torsion atom (A4)

__init__(child: str, phi: float, theta: float, distance: float, parent: str, second_parent: str, third_parent: str) None
_repr_html_()[source]
child: str
distance: float
classmethod from_str(text: str)[source]
parent: str
phi: float
second_parent: str
theta: float
third_parent: str
class rdkit_to_params.entries.IO_STRINGEntry(name3: str = 'LIG', name1: str = 'Z')[source]

Bases: object

  • .name3 is three letter name. Params().NAME is actually a dynamic attribute that uses this.

  • .name1 is a one letter name.

These get checked for length.

__init__(name3: str = 'LIG', name1: str = 'Z') None
_repr_html_()[source]
classmethod from_str(text)[source]
name1: str = 'Z'
name3: str = 'LIG'
class rdkit_to_params.entries.MAINCHAIN_ATOMS(*args: str)[source]

Bases: GenericListEntry

__init__(*args: str)[source]
_repr_html_()
classmethod from_str(text)
class rdkit_to_params.entries.METAL_BINDING_ATOMSEntry(*args: str)[source]

Bases: GenericListEntry

__init__(*args: str)[source]
_repr_html_()
classmethod from_str(text)
class rdkit_to_params.entries.NBR_ATOMEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.NBR_RADIUSEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.PDB_ROTAMERSEntry(body: str)[source]

Bases: GenericEntry

This does zero checks for fine existance.

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.PROPERTIESEntry(*args: str)[source]

Bases: GenericListEntry

__init__(*args: str)[source]
_repr_html_()
classmethod from_str(text)
class rdkit_to_params.entries.RAMA_PREPRO_FILENAMEEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.ROTAMER_AAEntry(body: str)[source]

Bases: GenericEntry

__init__(body: str)[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.Singletony(value)[source]

Bases: Enum

Is the entry

1. a singleton (e.g. NAME) which can have only one value 0. a regular multientry affair (e.g. ATOM) 2. a singleton (e.g. PROPERTY) which can accept multiple values

list_singleton = 2
multiton = 0
singleton = 1
class rdkit_to_params.entries.TYPEEntry(body: str = 'LIGAND')[source]

Bases: GenericEntry

LIGAND or POLYMER. No exceptions.

__init__(body: str = 'LIGAND')[source]
_repr_html_()
classmethod from_str(text)
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.UNKNOWNEntry(header: str, body: str)[source]

Bases: GenericEntry

__init__(header: str, body: str)
_repr_html_()
classmethod from_str(text)[source]
log = <Logger rdkit_to_params.entries (WARNING)>
class rdkit_to_params.entries.VARIANTEntry(*args: str)[source]

Bases: GenericListEntry

__init__(*args: str)[source]
_repr_html_()
classmethod from_str(text)
rdkit_to_params.entries.html_span(inner: str | float, color: str | None = None) str[source]

Simple span element for _repr_html_

‘#FA8072’ :param inner: :param color: default is #FA8072, salmon if #40e0d0 :return: