Write a single model to a PDB file. :param result: Model results batch. :param out_path: Output path. :param model: Model ID. :param b_factors: Optional B-factors.
(
result: ModelOutput,
out_path: str = os.path.join("test_results", "debug.pdb"),
model: int = 1,
b_factors: Optional[np.ndarray] = None,
)
| 285 | |
| 286 | |
| 287 | def write_pdb_single( |
| 288 | result: ModelOutput, |
| 289 | out_path: str = os.path.join("test_results", "debug.pdb"), |
| 290 | model: int = 1, |
| 291 | b_factors: Optional[np.ndarray] = None, |
| 292 | ): |
| 293 | """Write a single model to a PDB file. |
| 294 | |
| 295 | :param result: Model results batch. |
| 296 | :param out_path: Output path. |
| 297 | :param model: Model ID. |
| 298 | :param b_factors: Optional B-factors. |
| 299 | """ |
| 300 | os.makedirs(os.path.dirname(out_path), exist_ok=True) |
| 301 | protein = from_prediction(result["features"], result, b_factors=b_factors) |
| 302 | out_string = to_pdb(protein, model=model) |
| 303 | with open(out_path, "w") as of: |
| 304 | of.write(out_string) |
| 305 | |
| 306 | |
| 307 | def write_pdb_models( |
no test coverage detected