converter_tasks¶
- pyrosetta.distributed.cluster.converter_tasks.not_on_worker() Generator[None, Any, None]¶
A context manager for running code on the head node process.
- pyrosetta.distributed.cluster.converter_tasks.maybe_issue_environment_warnings() None¶
Issue a warning message if an environment manager is not installed and we are not in an active virtual environment on the head node process.
- pyrosetta.distributed.cluster.converter_tasks.get_protocols_list_of_str(input_file: Optional[Union[str, Pose, PackedPose]] = None, scorefile: Optional[str] = None, decoy_name: Optional[str] = None) List[str]¶
Get the user-defined PyRosetta protocols as a list object of str objects.
Warning: This function uses the pickle module to deserialize pickled Pose objects and pickled pandas.DataFrame objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- Args:
- input_file: str | Pose | PackedPose | None
A str object specifying the path to the “.pdb”, “.pdb.bz2”, “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, “.b64_pose.bz2”, “.init” or “.init.bz2” file from which to extract PyRosettaCluster instance attributes. If input_file is provided, then ignore the scorefile and decoy_name keyword arguments. Note that “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, “.b64_pose.bz2”, “.init” and “.init.bz2” files contain pickled Pose objects that are deserialized using the SecureSerializerBase class in PyRosetta upon calling the this function, but please still only input these file types if you know and trust their source. Learn more here.
Default: None
- scorefile: str | None
A str object specifying the path to a JSON Lines (JSONL)-formatted scorefile or pickled pandas.DataFrame scorefile from a PyRosettaCluster simulation from which to extract PyRosettaCluster instance attributes. If scorefile is provided, then decoy_name must also be provided. In order to use a scorefile, it must contain full simulation records from the original PyRosettaCluster simulation; i.e., the simulation_records_in_scorefile keyword argument value was set to True. Note that in order to securely load pickled pandas.DataFrame objects, please ensure that pyrosetta.secure_unpickle.add_secure_package(“pandas”) has been run. If using pandas version >=3.0.0, PyArrow-backed datatypes may be enabled by default; in this case, please ensure that pyrosetta.secure_unpickle.add_secure_package(“pyarrow”) has also first been run.
Default: None
- decoy_name: str | None
A str object specifying the decoy name for which to extract PyRosettaCluster instance attributes. If decoy_name is provided, then scorefile must also be provided.
Default: None
- Returns:
A list object of str objects specifying user-defined PyRosetta protocol names.
- pyrosetta.distributed.cluster.converter_tasks.get_scores_dict(obj: Union[str, Pose, PackedPose]) Dict[str, Dict[str, Any]]¶
Get the PyRosettaCluster full simulation record from an output decoy file or a Pose or PackedPose object from a PyRosettaCluster simulation. If a PyRosetta initialization file is provided, then PyRosetta must be already initialized (see the pyrosetta.distributed.io.init_from_file and pyrosetta.init_from_file docstrings for more information).
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- Args:
- obj: str | Pose | PackedPose
A required str object specifying the path to the “.pdb”, “.pdb.bz2”, “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, “.b64_pose.bz2”, “.init” or “.init.bz2” file from which to extract PyRosettaCluster instance attributes. If input_file is provided, then ignore the scorefile and decoy_name keyword arguments. Note that “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, “.b64_pose.bz2”, “.init” and “.init.bz2” files contain pickled Pose objects that are deserialized using the SecureSerializerBase class in PyRosetta upon calling the this function, but please still only input these file types if you know and trust their source. Learn more here.
- Returns:
A dict object representing the PyRosettaCluster full simulation record.
- pyrosetta.distributed.cluster.converter_tasks.export_init_file(output_file: str, output_init_file: Optional[str] = None, compressed: Optional[bool] = None) None¶
Export a PyRosetta initialization file from an output decoy file. The PyRosettaCluster simulation that produced the output decoy file must have had the output_init_file attribute set to a str object, so that the value of the “init_file” key can be detected in the “metadata” entry of full simulation record. This function is used to prepend the output decoy file to the detected PyRosetta initialization file for facile reproduction of an output decoy of interest using the reproduce function.
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- Args:
- output_file: str
A required str object specifying a filesystem path to an output decoy file. The file must end in either: “.pdb”, “.pdb.bz2”, “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, or “.b64_pose.bz2”. Note that “.pkl_pose”, “.pkl_pose.bz2”, “.b64_pose”, and “.b64_pose.bz2”, files contain pickled Pose objects that are deserialized using the SecureSerializerBase class in PyRosetta upon calling the export_init_file function, but please still only input these file types if you know and trust their source. Learn more here.
- output_init_file: str | None
A str object specifying the output PyRosetta initialization file path ending with “.init”. If None is provided, then the PyRosetta initialization file path is derived from the output_file argument value by replacing the file extension with “.init” (or “.init.bz2” when the compressed keyword argument value is set to True).
Default: None
- compressed: bool | None
A bool object specifying whether or not to compress the output PyRosetta initialization file with the bzip2 library, resulting in an output PyRosetta initialization file with a “.init.bz2” filename extension. If None, then False.
Default: None
- Returns:
None
- pyrosetta.distributed.cluster.converter_tasks.get_yml() str¶
Export the current environment configuration to a string depending on the environment manager.
- Returns:
A str object representing the current environment configuration.
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(obj: Any, func: Callable[[...], Any], attr: str) List[Any]¶
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(obj: Union[Pose, PackedPose, Dict[str, Any]], func: Callable[[...], Any], attr: str) List[Any]
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(obj: Union[Pose, PackedPose, Dict[str, Any]], func: Callable[[...], Any], attr: str) List[Any]
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(obj: Union[Pose, PackedPose, Dict[str, Any]], func: Callable[[...], Any], attr: str) List[Any]
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(objs: Set[Any], func: Callable[[...], Any], attr: str) NoReturn
- pyrosetta.distributed.cluster.converter_tasks.to_iterable(objs: Iterable[Any], func: Callable[[...], Any], attr: str) List[Any]
- pyrosetta.distributed.cluster.converter_tasks._catch_pose_or_kwargs(obj: Union[Pose, PackedPose, Dict[str, Any]], func: Callable[[...], Any], attr: str) List[Any]¶
- pyrosetta.distributed.cluster.converter_tasks._iterate(objs: Iterable[Any], func: Callable[[...], Any], attr: str) List[Any]¶
- pyrosetta.distributed.cluster.converter_tasks.to_int(obj: Any, attribute: str) int¶
- pyrosetta.distributed.cluster.converter_tasks.to_int(obj: int, attribute: str) int
- pyrosetta.distributed.cluster.converter_tasks.to_int(obj: float, attribute: str) NoReturn
- pyrosetta.distributed.cluster.converter_tasks._is_int(obj: int, attribute: str) int¶
- pyrosetta.distributed.cluster.converter_tasks.to_packed(obj: Any, protocol_name: str) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.to_packed(obj: Pose, protocol_name: str) PackedPose
- pyrosetta.distributed.cluster.converter_tasks.to_packed(obj: Union[PackedPose, Dict[str, Any]], protocol_name: str) Union[PackedPose, Dict[str, Any]]
- pyrosetta.distributed.cluster.converter_tasks.to_packed(obj: Union[PackedPose, Dict[str, Any]], protocol_name: str) Union[PackedPose, Dict[str, Any]]
- pyrosetta.distributed.cluster.converter_tasks.to_packed(obj: None, protocol_name: str) PackedPose
Parse a single result from the user-provided PyRosetta protocol.
- pyrosetta.distributed.cluster.converter_tasks._to_packed(obj: Pose, protocol_name: str) PackedPose¶
- pyrosetta.distributed.cluster.converter_tasks._is_packed_or_kwargs(obj: Union[PackedPose, Dict[str, Any]], protocol_name: str) Union[PackedPose, Dict[str, Any]]¶
- pyrosetta.distributed.cluster.converter_tasks._none_to_packed(obj: None, protocol_name: str) PackedPose¶
- pyrosetta.distributed.cluster.converter_tasks.to_str(obj: Any, attribute: str) str¶
- pyrosetta.distributed.cluster.converter_tasks.to_str(obj: int, attribute: str) str
- pyrosetta.distributed.cluster.converter_tasks.to_str(obj: float, attribute: str) NoReturn
- pyrosetta.distributed.cluster.converter_tasks._to_int(obj: int, attribute: str) str¶
- pyrosetta.distributed.cluster.converter_tasks._to_float(obj: float, attribute: str) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_protocols_str(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_protocols_str(obj: str) List[str]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_protocols_str(obj: str) List[str]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_protocols_str(obj: str) List[str]
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_kwargs(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_kwargs(obj: str) Dict[str, Any]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_kwargs(obj: str) Dict[str, Any]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_kwargs(obj: str) Dict[str, Any]
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_metadata_kwargs(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_metadata_kwargs(obj: str) Tuple[Dict[str, Any], Dict[str, Any]]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_metadata_kwargs(obj: str) Tuple[Dict[str, Any], Dict[str, Any]]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_file_to_instance_metadata_kwargs(obj: str) Tuple[Dict[str, Any], Dict[str, Any]]
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks.parse_scorefile(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_scorefile(obj: str) str
- pyrosetta.distributed.cluster.converter_tasks._parse_str(obj: str) str¶
- pyrosetta.distributed.cluster.converter_tasks.parse_decoy_name(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_decoy_name(obj: str) str
- pyrosetta.distributed.cluster.converter_tasks._from_str(obj: str) str¶
- pyrosetta.distributed.cluster.converter_tasks._merge_and_update_scores(packed: PackedPose, _reserved_scores_dict: Dict[str, Any]) PackedPose¶
Warning: This function uses the pickle module to deserialize pickled Pose objects and arbitrary Python types in Pose.cache dictionary. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(obj: Any, _scores_dict: Dict[str, Any], protocol_name: str) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(obj: Union[Pose, PackedPose], _scores_dict: Dict[str, Any], protocol_name: str) List[PackedPose]
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(obj: Union[Pose, PackedPose], _scores_dict: Dict[str, Any], protocol_name: str) List[PackedPose]
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(objs: Iterable[Any], _scores_dict: Dict[str, Any], protocol_name: str) List[Union[PackedPose, Dict[str, Any]]]
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(obj: Optional[Dict[str, Any]], _scores_dict: Dict[str, Any], protocol_name: str) Union[PackedPose, Dict[str, Any]]
- pyrosetta.distributed.cluster.converter_tasks.reserve_scores_in_results(obj: Optional[Dict[str, Any]], _scores_dict: Dict[str, Any], protocol_name: str) Union[PackedPose, Dict[str, Any]]
Warning: This function uses the pickle module to deserialize pickled Pose objects and arbitrary Python types in Pose.cache dictionary. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks._parse_packed(obj: Union[Pose, PackedPose], _scores_dict: Dict[str, Any], protocol_name: str) List[PackedPose]¶
- pyrosetta.distributed.cluster.converter_tasks._parse_iterable(objs: Iterable[Any], _scores_dict: Dict[str, Any], protocol_name: str) List[Union[PackedPose, Dict[str, Any]]]¶
- pyrosetta.distributed.cluster.converter_tasks._default_none_or_dict(obj: Optional[Dict[str, Any]], _scores_dict: Dict[str, Any], protocol_name: str) Union[PackedPose, Dict[str, Any]]¶
- pyrosetta.distributed.cluster.converter_tasks.parse_client(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_client(obj: Optional[Client]) Optional[Client]
- pyrosetta.distributed.cluster.converter_tasks.parse_client(obj: Optional[Client]) Optional[Client]
- pyrosetta.distributed.cluster.converter_tasks._default(obj: Optional[Client]) Optional[Client]¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_packed_pose(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_input_packed_pose(obj: Optional[PackedPose]) Optional[PackedPose]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_packed_pose(obj: Optional[PackedPose]) Optional[PackedPose]
- pyrosetta.distributed.cluster.converter_tasks.parse_input_packed_pose(obj: Pose) PackedPose
- pyrosetta.distributed.cluster.converter_tasks._from_packed_or_none(obj: Optional[PackedPose]) Optional[PackedPose]¶
- pyrosetta.distributed.cluster.converter_tasks._from_pose(obj: Pose) PackedPose¶
- pyrosetta.distributed.cluster.converter_tasks.parse_instance_kwargs(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.parse_instance_kwargs(obj: Dict[Any, Any]) Dict[str, Any]
- pyrosetta.distributed.cluster.converter_tasks.parse_instance_kwargs(obj: None) Dict[str, Any]
- pyrosetta.distributed.cluster.converter_tasks._parse_dict(obj: Dict[Any, Any]) Dict[str, Any]¶
- pyrosetta.distributed.cluster.converter_tasks.parse_init_file(input_file: str, input_packed_pose: Optional[PackedPose], skip_corrections: bool, init_from_file_kwargs: Dict[str, Any]) Tuple[Optional[PackedPose], PackedPose]¶
Return a tuple object of the input PackedPose object and the output PackedPose object from a “.init” or “.init.bz2” file, verifying PyRosettaCluster metadata in the “.init” or “.init.bz2” file.
Warning: This function uses the pickle module to deserialize pickled Pose objects. Using the pickle module is not secure, so please only run with input files you trust. Learn more about the pickle module and its security here.
- pyrosetta.distributed.cluster.converter_tasks.is_empty(obj: Any) NoReturn¶
- pyrosetta.distributed.cluster.converter_tasks.is_empty(obj: None) bool
- pyrosetta.distributed.cluster.converter_tasks.is_empty(obj: PackedPose) bool
Test whether a PackedPose object is empty.
- pyrosetta.distributed.cluster.converter_tasks._from_packed(obj: PackedPose) bool¶
- pyrosetta.distributed.cluster.converter_tasks.identical_packed_pose_states(packed_pose_1: Union[Pose, PackedPose], packed_pose_2: Union[Pose, PackedPose]) bool¶
Test whether the scientific state of two Pose or PackedPose objects are identical.
- pyrosetta.distributed.cluster.converter_tasks.is_bytes(obj: Any) bool¶
Test whether an object is an instance of bytes.
- pyrosetta.distributed.cluster.converter_tasks.is_packed(obj: Any) bool¶
Test whether an object is an instance of PackedPose.
- pyrosetta.distributed.cluster.converter_tasks.is_dict(obj: Any) bool¶
Test whether an object is an instance of dict.