io

pyrosetta.io.dump_multimodel_pdb(poses, output_filename)

Dump a multimodel PDB file from a list, tuple, or set of Pose objects, and an output filename.

Inputs: poses: Pose or iterable of Pose objects. This function automatically detects which one. output_filename: The desired name of the output PDB file.

Example: dump_multimodel_pdb(poses, “designs.pdb”)

@klimaj

pyrosetta.io.dump_pdb(pose, output_filename)

Dump a PDB file from a Pose object and output filename. If the output filename ends with “.pdb.bz2” or “.bz2”, then dump a bz2-encoded PDB file. If the output filename ends with “.pdb.gz” or “.gz”, then dump a gzip-encoded PDB file. If the output filename ends with “.pdb.xz” or “.xz”, then dump a xz-encoded PDB file.

@klimaj

pyrosetta.io.dump_scored_pdb(pose, output_filename, scorefxn)

Dump a scored PDB file from a Pose object, output filename, and score function. If the output filename ends with “.pdb.bz2” or “.bz2”, then dump a bz2-encoded PDB file. If the output filename ends with “.pdb.gz” or “.gz”, then dump a gzip-encoded PDB file. If the output filename ends with “.pdb.xz” or “.xz”, then dump a xz-encoded PDB file. Otherwise, implement the Pose.dump_scored_pdb method.

@klimaj

pyrosetta.io.pose_from_file(*args, **kwargs)

Uses the input filename from *args or **kwargs and returns a Pose object from it, deserializing:

  • bz2-encoded files ending with file extensions: (“.pdb.bz2”, “.bz2”)

  • gzip-encoded files ending with file extensions: (“.pdb.gz”, “.gz”)

  • xz-encoded files ending with file extensions: (“.pdb.xz”, “.xz”)

Otherwise, implements pyrosetta.rosetta.core.import_pose.pose_from_file(*args, **kwargs)).

@klimaj

pyrosetta.io.pose_from_pdb(*args, **kwargs)

Uses the input filename from *args or **kwargs and returns a Pose object from it, deserializing:

  • bz2-encoded files ending with file extensions: (“.pdb.bz2”, “.bz2”)

  • gzip-encoded files ending with file extensions: (“.pdb.gz”, “.gz”)

  • xz-encoded files ending with file extensions: (“.pdb.xz”, “.xz”)

Otherwise, implements pyrosetta.rosetta.core.import_pose.pose_from_file(*args, **kwargs)).

@klimaj

pyrosetta.io.pose_from_pdbstring(*args, **kwargs)

Instantiate a Pose object from a PDB string. If a Pose object is provided, it is passed to pyrosetta.rosetta.core.import_pose.pose_from_pdbstring, otherwise a new Pose object is instantiated.

@klimaj

pyrosetta.io.pose_from_sequence(seq, res_type='fa_standard', auto_termini=True)

Returns a Pose object generated from a single-letter sequence of amino acid residues in <seq> using the <res_type> ResidueType and creates N- and C- termini if <auto_termini> is set to True.

Unlike make_pose_from_sequence(), this method generates a default PDBInfo and sets all torsion angles to 180 degrees.

Example:

pose = pose_from_sequence(“THANKSEVAN”)

See also:

Pose make_pose_from_sequence() pose_from_file() pose_from_rcsb()

pyrosetta.io.poses_from_files(objs, *args, **kwargs)

Returns an iterator object which is composed of Pose objects from input files.

Example: import glob poses = pyrosetta.io.poses_from_files(glob.glob(“path/to/pdbs/*.pdb”))

pyrosetta.io.poses_from_multimodel_pdb(filename, *args, **kwargs)

Returns an Iterator object which is composed of Pose objects from an input multimodel PDB file. Poses are generated in the order in which they appear in the input multimodel PDB file. Any models without lines are skipped with a warning. Additional input *args and **kwargs are passed to pose_from_pdbstring.

Example: poses = pyrosetta.io.poses_from_multimodel_pdb(filename) for pose in poses:

name = pose.pdb_info().name()

@klimaj

pyrosetta.io.poses_from_sequences(objs, *args, **kwargs)

Returns an iterator object which is composed of Pose objects with input sequences.

Example: poses = pyrosetta.io.poses_from_sequences([“TEST”, “TESTING [ATP]”, “ACDEFGHIKLMNPQRSTVWY”])

pyrosetta.io.poses_from_silent(silent_filename)

Returns an Iterator object which is composed of Pose objects from a silent file.

@atom-moyer

pyrosetta.io.poses_to_silent(poses, output_filename)

Takes a Pose or list of poses and outputs them as a binary silent file. This method requires a Pose object. If you are using a PackedPose, use pyrosetta.distributed.io.to_silent()

Inputs: poses: Pose or list of poses. This function automatically detects which one. output_filename: The desired name of the output silent file.

Example: poses_to_silent(poses, “mydesigns.silent”)

The decoy name written to your silent file is take from pose.pdb_info().name() To set a different decoy name, change it in your pose before calling this function. Example: pose.pdb_info().name(“my_tag.pdb”)

@srgerb

pyrosetta.io.to_pdbstring(pose)

Convert to pdb-formatted string with score and energy data.