datamol.align
¶
auto_align_many(mols, partition_method='anon-scaffold', copy=True, cluster_cutoff=0.7, allow_r_groups=True, **kwargs)
¶
Partition a list of molecules into clusters sharing common scaffold of common core, then align the molecules to that common core. This function will compute the list of smiles/smarts representative of each cluster first.
The returned molecules will have two properties associated to them:
dm.auto_align_many.cluster_id
: the cluster id of the molecule.dm.auto_align_many.core
: the smiles/smarts of the core of the cluster.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mols |
Union[Sequence[Mol], pd.Series]
|
A list of molecules to auto align. |
required |
partition_method |
str
|
Partition method to use:
|
'anon-scaffold'
|
copy |
bool
|
Whether to copy the molecules before aligning them. |
True
|
cluster_cutoff |
float
|
Optional cluster cutoff. |
0.7
|
allow_r_groups |
bool
|
Optional, if True, terminal dummy atoms in the reference are ignored if they match an implicit hydrogen in the molecule, and a constrained depiction is still attempted |
True
|
**kwargs |
Any
|
Additional arguments to pass to clustering method |
{}
|
Source code in datamol/align.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
compute_2d_coords(mol, copy=True, verbose=False)
¶
Compute 2D coordinates for a molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
A molecule. |
required |
copy |
bool
|
Whether to copy the molecule. |
True
|
Source code in datamol/align.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
template_align(mol, template=None, copy=True, use_depiction=True, remove_confs=True, auto_select_coord_gen=False)
¶
Align an input molecule to a template. If the template is not provided then the input molecule is returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Union[str, Mol]
|
A molecule. |
required |
template |
Optional[Union[str, Mol]]
|
Template to align to. |
None
|
copy |
bool
|
whether to copy the molecule before aligning it. |
True
|
use_depiction |
bool
|
Whether to use the depiction API or use MolAlign The main difference is around how 3D information is handled, but also, because the depiction API will emphasize the atoms that do not match, whereas AlignMol will not. |
True
|
remove_confs |
bool
|
Whether to remove all conformation in the input molecule first. You can set this to true when not using depiction |
True
|
auto_select_coord_gen |
bool
|
Whether to automatically select the coordinate generation method. |
False
|
Returns:
Name | Type | Description |
---|---|---|
mol |
Optional[Mol]
|
aligned molecule (dm.Mol). None if initial mol argument is undefined or invalid. |
Source code in datamol/align.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|