Utilities
qcio.utils
¶
Utility functions for working with qcio objects.
json_dumps
¶
json_dumps(obj: Union[BaseModel, List[BaseModel]]) -> str
Serialization helper for lists of pydantic objects.
Source code in qcio/utils.py
31 32 33 34 35 |
|
rmsd
¶
Calculate the root mean square deviation between two structures in Angstrom.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
struct1 |
Structure
|
The first structure. |
required |
struct2 |
Structure
|
The second structure. |
required |
align |
bool
|
Whether to align the structures before calculating the RMSD including atom renumbering. If True, rdkit will compute the optimal alignment of the two structures before calculating the RMSD. If False, the RMSD will be calculated without alignment. |
True
|
numthreads |
int
|
The number of threads to use for the RMSD calculation. Applies only
to the alignment step if |
1
|
Returns:
Type | Description |
---|---|
float
|
The RMSD between the two structures in Angstroms. |
Source code in qcio/utils.py
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 |
|
align
¶
align(
struct: Structure,
refstruct: Structure,
reorder_atoms: bool = True,
) -> Tuple[Structure, float]
Return a new structure that is optimally aligned to the reference structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
struct |
Structure
|
The structure to align. |
required |
refstruct |
Structure
|
The reference structure. |
required |
reorder_atoms |
bool
|
Reorder the atoms to match the reference structure. If False, the atoms will be aligned without changing their order. |
True
|
Returns:
Type | Description |
---|---|
Tuple[Structure, float]
|
Tuple of the aligned structure and the RMSD in Angstroms. |
Source code in qcio/utils.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|