MM3 Parser¶
mm3
¶
Parser for Schrödinger MM3* force field files (mm3.fld).
Reads and writes MM3*-format force field files used by Schrödinger's MacroModel, extracting bond, angle, torsion, improper, stretch-bend, and van der Waals parameters for Q2MM optimization.
MM3
¶
Bases: FF
Schrödinger MM3* force field reader and writer (mm3.fld).
Attributes:
| Name | Type | Description |
|---|---|---|
smiles |
list[str]
|
MM3* SMILES syntax used in custom parameter sections of the force field file. |
sub_names |
list[str]
|
Strings used to describe each custom parameter section read. |
atom_types |
list[list[str]]
|
Atom types derived from each SMILES formula. The SMILES may contain integers referencing earlier atoms, but this list holds only resolved atom type strings. |
lines |
list[str]
|
Every line from the MM3* force field file. |
Initializes an MM3 force field instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | None
|
Path to the mm3.fld file. Defaults to None. |
None
|
data
|
object | None
|
Pre-loaded data. Defaults to None. |
None
|
method
|
str | None
|
Calculation method label. Defaults to None. |
None
|
params
|
list[Param] | None
|
Pre-loaded parameters. Defaults to None. |
None
|
score
|
float | None
|
Objective function score. Defaults to None. |
None
|
Source code in q2mm/parsers/mm3.py
atom_types
property
¶
Derives atom types from SMILES substructure definitions.
Uses the SMILES-esque substructure definition (located directly below the substructure's name) to determine the atom types.
Returns:
| Type | Description |
|---|---|
list[list[str]]
|
Atom types for each SMILES substructure. |
lines
property
writable
¶
Lines of the force field file.
Returns:
| Type | Description |
|---|---|
list[str]
|
All lines from the mm3.fld file, lazily loaded from disk on first access. |
split_smiles
¶
Splits an MM3* SMILES string into individual atom tokens.
Uses the MM3* SMILES substructure definition (located directly below the substructure's name) to determine the atom types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smiles
|
str
|
MM3* SMILES substructure string. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Individual atom labels extracted from the SMILES string. |
Source code in q2mm/parsers/mm3.py
convert_smiles_to_types
¶
Converts an MM3* SMILES string to a list of atom types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
smiles
|
str
|
MM3* SMILES substructure string. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Resolved atom types derived from the SMILES string. |
Source code in q2mm/parsers/mm3.py
convert_to_types
¶
Converts atom labels (which may be digit references) to atom types.
For example::
atom_labels = [1, 2]
atom_types = ["Z0", "P1", "P2"]
would return ["Z0", "P1"].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atom_labels
|
list[str]
|
Atom labels that can be strings like
|
required |
atom_types
|
list[str]
|
Full list of atom type strings to resolve digit references against. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Resolved atom types with all digit references replaced by the corresponding atom type string. |
Source code in q2mm/parsers/mm3.py
import_ff
¶
Reads parameters from an mm3.fld file.
Parses bond, angle, stretch-bend, torsion, improper, and van der Waals parameters from the MM3* force field file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | None
|
Path to the force field file.
Defaults to |
None
|
sub_search
|
str
|
Marker string used to identify
optimizable substructure sections. Defaults to |
'OPT'
|
Source code in q2mm/parsers/mm3.py
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | |
export_ff
¶
Exports the force field to a file, typically mm3.fld.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | None
|
Output file path. Defaults to
|
None
|
params
|
list[Param] | None
|
Parameters to write.
Defaults to |
None
|
lines
|
list[str] | None
|
Base file lines to modify.
Generated via |
None
|
Source code in q2mm/parsers/mm3.py
get_DOFs_by_ff_row
¶
Groups degrees of freedom by force field row number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structs
|
list[Structure]
|
Structures whose DOFs are collected. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Mapping of |
Source code in q2mm/parsers/mm3.py
match_mm3_label
¶
Checks whether a line has a recognized MM3* parameter label.
The label is the first 2 characters in the line containing the parameter in a Schrödinger mm3.fld file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label is recognized, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_vdw
¶
Matches MM3* label for van der Waals parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_bond
¶
Matches MM3* label for bonds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_angle
¶
Matches MM3* label for angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_stretch_bend
¶
Matches MM3* label for stretch-bends.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_torsion
¶
Matches MM3* label for all orders of torsional parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_lower_torsion
¶
Matches MM3* label for torsions (1st through 3rd order).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_higher_torsion
¶
Matches MM3* label for torsions (4th through 6th order).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |
Source code in q2mm/parsers/mm3.py
match_mm3_improper
¶
Matches MM3* label for improper torsions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm3_label
|
str
|
Line or string whose first 2 characters are checked. |
required |
Returns:
| Type | Description |
|---|---|
Match | None
|
Match object if the label matches, else None. |