Utilities
qcio.json_dumps
¶
json_dumps(obj: Union[BaseModel, list[BaseModel]]) -> str
Serialization helper for lists of pydantic objects.
Source code in qcio/utils.py
35 36 37 38 39 |
|
qcio.rmsd
¶
rmsd(struct1: Structure, struct2: Structure, symmetry: bool = True, numthreads: int = 1, use_hueckel: bool = True, use_vdw: bool = False, cov_factor: float = 1.3, length_unit: LengthUnit = LengthUnit.BOHR) -> float
Calculate the root mean square deviation between two structures in Bohr or Angstrom.
May lead to a 'combinatorial explosion' especially if many molecule symmetries
(e.g., many hydrogens) are present.If this function is taking a long time to
compute, consider passing symmetry=False
to disable symmetry consideration. Or
pass numthreads=an_integer
to increase the number of threads used for the
symmetry consideration step.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
struct1 |
Structure
|
The first structure. |
required |
struct2 |
Structure
|
The second structure. |
required |
symmetry |
bool
|
Whether to consider symmetries in the structures before calculating
the RMSD, i.e., to allow atom renumbering. This relies on the RDKit
|
True
|
numthreads |
int
|
The number of threads to use for the RMSD calculation. Applies only
to the alignment step if |
1
|
use_hueckel |
bool
|
Whether to use Hueckel method when determining connectivity.
Applies only to |
True
|
use_vdw |
bool
|
Whether to use Van der Waals radii when determining connectivity.
Applies only to |
False
|
cov_factor |
float
|
The scaling factor for the covalent radii when determining
connectivity. Applies only to |
1.3
|
length_unit |
LengthUnit
|
The unit of length to use for the RMSD calculation. Default is "bohr". If "angstrom", the RMSD will be in Angstroms. |
BOHR
|
Returns:
Type | Description |
---|---|
float
|
The RMSD between the two structures in Angstroms. |
Source code in qcio/models/utils.py
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 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
|
qcio.align
¶
align(struct: Structure, refstruct: Structure, symmetry: bool = True, use_hueckel: bool = True, use_vdw: bool = False, cov_factor: float = 1.3, length_unit: LengthUnit = LengthUnit.BOHR) -> tuple[Structure, float]
Return a new structure that is optimally aligned to the reference structure and the RMSD between the two structures in Bohr or Angstroms.
May lead to a 'combinatorial explosion' especially if many molecule symmetries
(e.g., many hydrogens) are present.If this function is taking a long time to
compute, consider passing symmetry=False
to disable symmetry consideration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
struct |
Structure
|
The structure to align. |
required |
refstruct |
Structure
|
The reference structure. |
required |
symmetry |
bool
|
Whether to consider symmetries in the structures before aligning and
calculating the RMSD, i.e., to allow atom renumbering. This relies on the
RDKit's |
True
|
use_hueckel |
bool
|
Whether to use Hueckel method when determining connectivity.
Applies only to |
True
|
use_vdw |
bool
|
Whether to use Van der Waals radii when determining connectivity.
Applies only to |
False
|
cov_factor |
float
|
The scaling factor for the covalent radii when determining
connectivity. Applies only to |
1.3
|
length_unit |
LengthUnit
|
The unit of length to use for the RMSD calculation. Default is "bohr". If "angstrom", the RMSD will be in Angstroms. |
BOHR
|
Returns:
Type | Description |
---|---|
tuple[Structure, float]
|
Tuple of the aligned structure and the RMSD in Angstroms. |
Source code in qcio/utils.py
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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
qcio.to_multi_xyz
¶
to_multi_xyz(structures: Iterable[Structure]) -> str
Create a multi-structure XYZ string from a list of structures.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
structures |
Iterable[Structure]
|
An Iterable of Structure objects. |
required |
Returns:
Type | Description |
---|---|
str
|
The multi-structure XYZ string. |
Source code in qcio/models/utils.py
573 574 575 576 577 578 579 580 581 582 |
|