quemb.molbe.chemfrag.BondConnectivity.from_cartesian¶
- classmethod BondConnectivity.from_cartesian(m, *, bonds_atoms=None, vdW_radius=None, h_treatment='treat_H_diff')¶
Create a
BondConnectivityfrom achemcoord.Cartesian.- Parameters:
m (
Cartesian) – The Cartesian object to extract the connectivity data from.bonds_atoms (
Mapping[int,Set[int]] |Mapping[NewType(AtomIdx,int),OrderedSet[NewType(AtomIdx,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. This can also take in a modified processed_bonds_atoms object (dict) when specifying certain h_treatment optionsvdW_radius (
int|float|floating|Callable[[int|float|floating],int|float|floating] |Mapping[str,int|float|floating] |None) –If
bonds_atomsisNone, 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.h_treatment (
Literal['treat_H_diff','treat_H_like_heavy_atom','at_most_one_H']) –How do we treat the hydrogen atoms? Options include:
"treat_H_diff": Default, treating each H different from heavy atoms. Using the given vdW_radius to determine which H belong to which motif"treat_H_like_heavy_atom": Treating each H the same as the heavy atoms when determining fragments"at_most_one_H": Enforcing that each H can belong to at most one H, if a H is assigned to multiple motifs
- Return type:
Self