toolbox

Brief: A toolbox of exposed methods for use in PyRosetta.

Remarks: These methods are useful in PyRosetta and are further intended to

demonstrate proper syntax for various common activities.

ONLY essential, tested, PyRosetta-exclusive methods should live here! Remember, the rest of the Python scripts in “toolbox/” are NOT supported, just provided, (ex. environment setup scripts, etc.).

For those interested, Rosetta has a Surface Area calculator and a Radius of Gyration calculator; they are EnergyMethods sa and rg, respectively. Create an empty ScoreFunction and use ScoreFunction.set_weight to use these calculations. Other common geometry calculators are CA_rmsd and all_atom_rmsd.

Author: Evan Baugh

Edits: Labonte

pyrosetta.toolbox.cleanATOM(pdb_file, edit=-4)

Writes a PDB file from <pdb_file> with all lines not beginning with ATOM removed tp <pdb_file>.clean.pdb.

Note: the second argument, <edit>, is for PDB files not ending in .pdb.

Example:
cleanATOM(“1YY9.pdb”)
See also:
Pose Pose.dump_pdb pose_from_file pose_from_rcsb cleanCRYS
pyrosetta.toolbox.cleanCRYS(pdb_file, olig=2)

Removes redundant crystal contacts and isolates a monomer by writing a PDB file for a monomer of <pdb_file>, if it is an <olig>-mer, to <pdb_file>.mono.

Note: This is by simple sequence comparison.

Example:
cleanCRYS(“1YY8.pdb”, 2)
See also:
Pose Pose.dump_pdb pose_from_file pose_from_rcsb cleanATOM
pyrosetta.toolbox.generate_resfile_from_pdb(pdbfilename, resfilename, input_sc=True)

Writes a resfile for PDB file <pdbfilename> named <resfilename>, optionally allowing input side chains to be used in packing.

Example:
generate_resfile_from_pdb(“1YY8.pdb”, “1YY8.resfile”)
See also:
Pose PackRotamersMover TaskFactory
pyrosetta.toolbox.generate_resfile_from_pose(pose, resfilename, input_sc=True)

Writes a resfile for <pose> named <resfilename>, optionally allowing input side chains to be used in packing.

Example:
generate_resfile_from_pose(pose, “1YY8.resfile”)
See also:
Pose PackRotamersMover TaskFactory
pyrosetta.toolbox.get_hbonds(pose)

Returns an HBondSet of the hydrogen bonding in <pose>.

Note: More info can be found in rosetta.core.scoring.hbonds.

Example:
hbset = get_hbonds(pose) hbset.show() hbset.hbond(1).acc_res()
See also:
Pose Energies HBondSet ScoreFunction create_score_function
pyrosetta.toolbox.get_secstruct(pose, output=True, space=8, page=80)

Predicts the secondary structure of <pose>, loading this data into the pose’s secstruct information and printing the prediction to screen.

<output> determines if the information is printed to the screen or not; <space> and <page> determine formatting.

Example:
get_secstruct(pose)
See also:
Pose Pose.secstruct Pose.sequence pose_from_file pose_from_sequence pose_from_rcsb
pyrosetta.toolbox.mutate_residue(pose, mutant_position, mutant_aa, pack_radius=0.0, pack_scorefxn='')
Replaces the residue at <mutant_position> in <pose> with <mutant_aa>
and repack any residues within <pack_radius> Angstroms of the mutating residue’s center (nbr_atom) using <pack_scorefxn>

note: <mutant_aa> is the single letter name for the desired ResidueType

example:
mutate_residue(pose, 30, A)
See also:
Pose PackRotamersMover MutateResidue pose_from_sequence
pyrosetta.toolbox.restrict_non_nbrs_from_repacking(pose, res, task, pack_radius)

Evan’s nbr detection in a function. Should go in C++