Several Python scripts were written by developers and users to help others use PyRosetta.


PyMOL Scripts


PyMOL is the favorite visualizer to use among the PyRosetta community. So much so that we built a Mover specifically for sending structures directly to an instance of PyMOL running the listener script.

PyMOL Servers (listeners)

PyMOL must run a "listener" script to properly translate packets sent to it from Rosetta. These listeners can only translate a few types of packets but can be customized to translate any desired output. If you plan on using PyRosetta with PyMOL often, we recommend you add the line "run PyMOLPyRosettaServer.py" to your .pymolrc so PyMOL starts automatically listening to PyRosetta. Currently, we only support PyRosetta v2.0 beta however another version of the script is posted here for developers. For more details please see the PyMOL_Mover Tutorial.

PyMOLPyRosettaServer.py            for PyRosetta v2.0 beta
PyMOLPyRosettaServerNew.py     for newest PyRosetta (developers only)


Sample Scripts


Twelve sample scripts are presented here to demonstrate PyRosetta's data structures, syntax, and traditional applications. Any data files required by default are also provided. For convenience, the scripts are packaged in various compressed (tar gz) directories. Many applications with decompress by default upon download, if not uncompress from the commandline using "tar -zxvf". Since these sample scripts are filled with comments on usage, we've provided a summary of the language used.

README
Sample Scripts
            Essential Objects
                        pose_structure.py              requires data file test_in.pdb
                        pose_scoring.py                 requires data file
test_in.pdb
                        fold_tree.py
                        movemap.py                      requires data file
test_in.pdb
                        packer_task.py                  requires data file test_in.pdb
            Folding Applications
                        folding.py                          requires data files
test_in.pdb, test_in.frag3, and test_in.frag9
                        refinement.py                    requires data file
test_in.pdb
                        loop_modeling.py              requires data files test_in.pdb and test_in.frag3
            Docking Applications
                        ala_scan.py                        requires data file test_dock.pdb (requires the Interface object contained only in the newest versions of PyRosetta)
                Protein Docking
                        docking.py                         requires data file test_dock.pdb
                DNA Docking
                        dna_interface.py                requires data file test_dna.pdb
                Small Molecule Docking
                        ligand_interface.py            requires data files test_lig.pdb and ATP.mdl and the tool molfile_to_params.py (compressed directory)



Tools


Numerous helper scripts have been developed to make using PyRosetta easier. As Rosetta developers, PyRosetta provides unique challenges since some changes are appropriate to make in the Rosetta C++ source code while others are better handled by constructing Python objects and methods. In previous releases of PyRosetta, these methods were directly added to the __init__.py file within PyRosetta and thus loaded into every new session. Customizing the __init__.py file is still a useful way to introduce your own personal changes but the number of useful tools has made this impractical.
Several of the Tools below rely on third-party software. If using PyRosetta on a computer network, make sure to obtain or request the required software.
These tool scripts are meant to provide a starting point for many custom applications. They are likely to become outdated soon and are not guaranteed to work like the sample scripts.

Current Tools

Unfortunately, the rapid changes to Rosetta and PyRosetta have made support difficult. The tools provided here are developer favorites or use methods essential to some PyRosetta applications. These may not work with all versions of PyRosetta and have only been tested with PyRosetta v2.0 beta or intermediate revisions. Once you are experienced using Python and PyRosetta (by performing the workshops and studying the sample scripts), editing these files to your liking should be fairly easy (sorry we cannot support all tasks directly).

cleaning.py                              simple PDB file cleaning for PyRosetta, removes non-ATOM lines and redundant chains
rcsb.py                                     loads PDB files, FASTA files, and Poses directly from RCSB (requires urllib)
mutants.py                               performs sequence changes, constructs Poses from sequences, etc.
generate_resfile.py                  produces resfiles for use with PackerTasks
molfile2params                        converts .mdl or .mol files to .params files, included with ligand_docking etc.
load_ligand.py                          loads files from PubChem and adds them to the minirosetta_database (requires molfile2params and openbabel)
extract_coords_pose.py           extracts coordinates from a Pose object into Python lists
structural_alignment.py            the Kabsch alignment algorithm for protein superimposition (requires numpy and extract_coords_pose.py)


All Files

All the script and data files are listed below
ala_scan.py
Download
An example algorithm for alanine scanning to investigate "hotspot" residues. This script requires the NEWEST PyRosetta to work.   35k v. 2 Sep 13, 2011 6:46 AM Evan Baugh
ATP.mdl
Download
A sample .mdl file used to generate a .params file with molfile_to_params.py (ligand_interface.py)  3k v. 1 Jul 25, 2011 2:19 PM Evan Baugh
cleaning.py
Download
A tool used to clean PDB files for PyRosetta.  4k v. 1 Jul 27, 2011 12:12 PM Evan Baugh
dna_docking.tar.gz
Download
A compressed (tar gz) directory for dna_interface.py including the data file test_dna.pdb   65k v. 3 Sep 13, 2011 7:03 AM Evan Baugh
dna_interface.py
Download
An example of full-atomistic detail DNAA-protein interface refinement. This algorithm demonstrates the Rosetta DockingProtocol and its usage.   26k v. 3 Sep 13, 2011 6:47 AM Evan Baugh
docking_applications.tar.gz
Download
A compressed (tar gz) directory of the ssample scripts covering docking applications. These scripts are available individually or packaged as separate compressed directories (docking.py, dna_interface.py, ligand_interface.py, ala_scan.py)   244k v. 2 Sep 13, 2011 7:03 AM Evan Baugh
docking.py
Download
An example of Rosetta protein-protein docking. This algorithm uses the Rosetta DockingProtocol directly and serves as a Python interface to docking in Rosetta.   25k v. 2 Sep 13, 2011 6:47 AM Evan Baugh
essential_objects.tar.gz
Download
A compressed directory (tar gz) of the sample scripts covering usage of the essential Rosetta objects (pose_structure.py, pose_scroring.py, fold_tree.py, movemap.py, packer_task.py)   49k v. 2 Sep 13, 2011 7:03 AM Evan Baugh
extract_coords_pose.py
Download
A tool for extracting protein coordinates from a Pose object.  3k v. 1 Jul 27, 2011 12:13 PM Evan Baugh
folding_applications.tar.gz
Download
A compressed (tar gz) directory of the sample scripts covering basic folding applications, low-resolution and high-resolution folding and loop remodeling (folding.py, refinement.py, loop_remodeling.py)   4811k v. 2 Sep 13, 2011 7:03 AM Evan Baugh
folding.py
Download
An example of fragment insertion, the core of Rosetta ab initio structure prediction. This algorithm is not intended to provide a framework for custom low-resolution (centroid) folding algorithms.   33k v. 2 Sep 13, 2011 6:47 AM Evan Baugh
fold_tree.py
Download
An example script demonstrating how to make and customize FoldTree objects. Using the PyMOL_Mover, an example is output to PyMOL using a linear protein structure.   11k v. 2 Sep 13, 2011 6:47 AM Evan Baugh
generate_resfile.py
Download
A tool for generating resfiles for use with PackerTask objects.  5k v. 1 Jul 27, 2011 12:14 PM Evan Baugh
ligand_docking.tar.gz
Download
A compressed (tar gz) directory for the sample script ligand_interface.py including the data files and the directory "molfile2params"   115k v. 2 Sep 13, 2011 7:03 AM Evan Baugh
ligand_interface.py
Download
An example of full-atomistic detail ligand-protein interface refinement. This algorithm demonstrates the Rosetta DockingProtocol and its usage.   33k v. 2 Sep 13, 2011 6:47 AM Evan Baugh
load_ligand.py
Download
A tool, requires molfile2params and openbabel. Loads .sdf files from PubChem, converts them to .mdl, converts these to .params. Can load these new ResidueTypes into a Pose or permanently add this .params file to the minirosetta_database  8k v. 1 Jul 27, 2011 12:17 PM Evan Baugh
loop_modeling.py
Download
An example of Cyclic Coordinate Descent loop closure usage for predicting protein loop conformations. This script demonstrates a custom low-resolution (centroid) simulated annealing algorithm.   35k v. 2 Sep 13, 2011 6:48 AM Evan Baugh
molfile2params.tar.gz
Download
A compressed (tar.gz) directory containing the scripts need to produce .params files from .mdl (or .mol) files. Conversion is executed using the Python file molfile_to_params.py  54k v. 1 Jul 25, 2011 2:21 PM Evan Baugh
movemap.py
Download
An example script demonstrating how to make and use MoveMap objects. The MoveMap functionality is demonstrated with backbone torsion minimization performed on a sample PDB.   8k v. 2 Sep 13, 2011 6:48 AM Evan Baugh
mutants.py
Download
A tool for making mutations, generating Pose objects from sequences, or comparing poses.  10k v. 1 Jul 27, 2011 12:17 PM Evan Baugh
packer_task.py
Download
An example script demonstrating how to make and use PackerTask objects. The PackerTask functionality is demonstrated with repacking and simple design (sequence change) performed on a sample PDB.   14k v. 2 Sep 13, 2011 6:48 AM Evan Baugh
pose_scoring.py
Download
An example of creating ScoreFunctions and extracting information from an Energies objects. Scoring statistics are ubiquitous in Rosetta.   14k v. 2 Sep 13, 2011 6:49 AM Evan Baugh
pose_structure.py
Download
An example of Pose objects, molecular representations. Various data is extracted from the Pose and printed to screen.   9k v. 2 Sep 13, 2011 6:48 AM Evan Baugh
protein_docking.tar.gz
Download
A compressed (tar gz) directory for the sample script docking.py including the data file test_dock.pdb   55k v. 3 Sep 13, 2011 7:04 AM Evan Baugh
PyMOLPyRosettaServerNew.py
Download
PyMOL listener script for use with the newest versions of PyRosetta. This is currently for developer use only. We will release a new version of PyRosetta soon...  30k v. 1 Jul 27, 2011 11:31 AM Evan Baugh
PyMOLPyRosettaServer.py
Download
PyMOL listener script for use with PyRosetta v2.0 beta. This script works with the only public version of PyRosetta currently supported.  7k v. 1 Jul 27, 2011 11:29 AM Evan Baugh
rcsb.py
Download
A tool for loading PDB files, FASTA files, and Poses directly from the RCSB Protein Data Bank.  5k v. 1 Jul 27, 2011 12:24 PM Evan Baugh
README_sample_scripts.txt
Download
A test file summarizing the structure and language conventions used in these sample scripts. Though not essential, being the sample scripts are quite large and may be hard to navigate.  4k v. 1 Jul 25, 2011 1:42 PM Evan Baugh
refinement.py
Download
An example of various Movers used to perturb molecular structures. These individual moves are combined to perform a "refinement", producing a protein structure in full-atomistic detail friendly to Rosetta scoring.   26k v. 2 Sep 13, 2011 6:49 AM Evan Baugh
sample_scripts.tar.gz
Download
A compressed (tar gz) directory of all the sample scripts here.   5073k v. 2 Sep 13, 2011 7:04 AM Evan Baugh
structural_alignment.py
Download
A tool requiring numpy and extract_coords_pose. Performs the Kabsch alignment algorithm on two pose objects. Originally written in Python by Jason Vertrees for PyMOL. Performs alignment on proteins of different lengths.  6k v. 1 Jul 27, 2011 12:20 PM Evan Baugh
test_dna.pdb
Download
A sample PDB file used in dna_interface.py  224k v. 2 Jul 25, 2011 2:18 PM Evan Baugh
test_dock.pdb
Download
A sample PDB used is several sample scripts here: docking.py, ala_scan.py  181k v. 1 Jul 25, 2011 2:17 PM Evan Baugh
test_in.frag3
Download
A sample fragment file (of 3-mers) generated using the Robetta online server for use with test_in.pdb in the sample script folding.py  6373k v. 1 Jul 25, 2011 2:22 PM Evan Baugh
test_in.frag9
Download
A sample fragment file (of 9-mers) generated using the Robetta online server for use with test_in.pdb in the sample script folding.py  18061k v. 1 Jul 25, 2011 2:23 PM Evan Baugh
test_in.pdb
Download
A sample PDB used in many sample scripts here: folding.py, loop_modeling.py, movemap.py, packer_task.py, pose_scoring.py, pose_structure.py, refinement.py  153k v. 2 Jul 25, 2011 2:15 PM Evan Baugh
test_lig.pdb
Download
A sample PDB file used in ligand_interface.py  221k v. 1 Jul 25, 2011 2:18 PM Evan Baugh