SMILES Parser#
(Open)SMILES parser implemented based on
as of 03/2021
- class autode.smiles.parser.Parser#
- __init__() None #
SMILES Parser
- property charge#
Total charge on all the atoms
- property mult#
Approximate spin multiplicity (2S+1). For multiple unpaired electrons will default to a singlet
- property n_atoms#
Number of atoms in parsed, not including implicit hydrogens
- property n_bonds#
Number of bonds parsed
- parse(smiles: str)#
Parse a SMILES string e.g. ‘[He]’, ‘C’
- property parsed#
Has the parser parsed every character of the SMILES string
- property smiles#
SMILES string being parsed
- autode.smiles.parser.atomic_charge(string)#
Parse a section of a SMILES string associated with an atom for the formal charge on the atom, will ignore anything but +, -. e.g.:
+ -> 1 - -> -1 ++ -> 2 H+ -> 1
- autode.smiles.parser.atomic_class(string: str) int | None #
Extract the atomic class from a string i.e.:
H4:2 -> 2 :7 -> 7 :001 -> 1
- autode.smiles.parser.atomic_n_hydrogens(string)#
Extract the number of hydrogens from a partial SMILES, i.e.:
H3- -> 3 H -> 1 C -> 0
- Returns:
Number of hydrogens
- Return type:
(int)
- autode.smiles.parser.atomic_sterochem(string)#
Extract the first occurring atomic stereochemistry from a partial SMILES i.e:
@H3 -> @ @ -> @ @@- -> @@
- Returns:
Type of point stereochemistry
- Return type:
- autode.smiles.parser.next_char(string: str, idx: int) str #
Get the next character in a string if it exists otherwise return an empty string
- Returns:
Next character in the string