AtomicSystem.from_pubchem#

classmethod AtomicSystem.from_pubchem(cid=None)#

Load a molecule from PubChem.

Parameters:
cidint or str, optional

PubChem compound identifier to download. Given one, the molecule is fetched straight away; omitted, an interactive explorer opens instead.

Returns:
AtomicSystem or None

The molecule, or None if it could not be fetched or the explorer was cancelled.

Notes

Only coordinates and bonds are returned. Call guess_connections() for the angles and dihedrals.

Examples

>>> caffeine = AtomicSystem.from_pubchem(2519)  # reproducible
>>> molecule = AtomicSystem.from_pubchem()      # browse instead