quemb.molbe.chemfrag.BondConnectivity.from_cartesian¶
- classmethod BondConnectivity.from_cartesian(m, *, bonds_atoms=None, vdW_radius=None, treat_H_different=True)¶
Create a
BondConnectivity
from achemcoord.Cartesian
.- Parameters:
m (
Cartesian
) – The Cartesian object to extract the connectivity data from.bonds_atoms (
Mapping
[int
,set
[int
]] |None
) – Can be used to specify the connectivity graph of the molecule. Has exactly the same format as the output ofchemcoord.Cartesian.get_bonds()
, which is called internally if this argument is not specified. Allows it to manually change the connectivity by modifying the output ofchemcoord.Cartesian.get_bonds()
. The keyword is mutually exclusive withvdW_radius
.vdW_radius (
Real
|Callable
[[Real
],Real
] |Mapping
[str
,Real
] |None
) –If
bonds_atoms
isNone
, then the connectivity graph is determined by the van der Waals radius of the atoms. It is possible to pass:a single number which is used as radius for all atoms,
a callable which is applied to all radii and can be used to e.g. scale via
lambda r: r * 1.1
,a dictionary which maps the element symbol to the van der Waals radius, to change the radius of individual elements, e.g.
{"C": 1.5}
.
The keyword is mutually exclusive with
bonds_atoms
.treat_H_different (
bool
) – If True, we treat hydrogen atoms differently from heavy atoms.
- Return type:
Self