MCPcopy Create free account
hub / github.com/BioinfoMachineLearning/FlowDock / write_pdb_single

Function write_pdb_single

flowdock/utils/visualization_utils.py:287–304  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

285
286
287def 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
307def write_pdb_models(

Callers 1

multi_pose_samplingFunction · 0.90

Calls 3

from_predictionFunction · 0.85
to_pdbFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected