You are here

Calling SnugDock from PyRosetta

4 posts / 0 new
Last post
Calling SnugDock from PyRosetta
#1

I am very new to the PyRosetta platform and was hoping to get some guidance on how I can do a SnugDock run from the PyRosetta interface with an antibody pdb and antigen pdb, as I know that the ROSIE queue can be quite long. I've seen the PyRosetta 4.0 documentation for SnugDock but am a little bit overwhelmed as I'm not too well versed in Python. Any level of guidance would be greatly appreciated! 

 

Category: 
Post Situation: 
Wed, 2020-07-29 15:10
shruthi.murali

Sorry for the obvious question, is the a reason you are opting for pyrosetta as opposed to the much simpler binary: https://www.rosettacommons.org/docs/latest/application_documentation/antibody/snugdock?
Pyrosetta allows much greater control, but has a learning curve and a basic understanding of the implication of Boost-wrapped C++ code (such as strict types (typehints are taken seriously unlike Python) or overloaded functions (closest equivalent is preset arguments in Python), which is not beginner Python...

My guess it is for learning? Which is great... So How to figure out how to use it something where the documentation is unclear:

First, see if you can copy someone else, googling f"{mover name} pyrosetta github" may give you someones code to inspire you. Try also * (wild card) dot mover name pyrosetta github.

Second, look at what the various classes inherit: pyrosetta.rosetta.protocols.antibody.snugdock.SnugDock bases pyrosetta.rosetta.protocols.docking.DockingHighRes, while pyrosetta.rosetta.protocols.antibody.snugdock.SnugDockProtocol bases pyrosetta.rosetta.protocols.moves.Mover.

I am not familiar with SnugDock but I assume it does a low res and high res step?

So both are movers, but the former is a DockingHighRes mover and you'll find many examples of how it works, so should work similarly.

DockingHighRes(scorefxn, jump) where jump is an interger of the jump. Which can be set up like pyrosetta.rosetta.protocols.docking.DockingProtocol().setup_foldtree(pose, 'A_BC'). This mover is often preceeded by RigidBodyPerturbMover(jump, Å, deg) and RigidBodySpinMover(jump). If we have a gander at the arguments of the binary linked above you'll see -partners LH_G -spin -dock_pert 3 8.

Actually if you look at the command line arguments of the binary and you do in python dir(pyrosetta.rosetta.protocols.antibody.snugdock.SnugDockProtocol) you will see many similar names. One difference is -nstruct 1000, which is nothing more than a for loop wrapping your whole code —okay, that would run on a single core but it's a good start.

Third, if are totally stuck, you might want to have a look at the C++ code, which you'll find in the reg dl of rosetta in main/source/scr. The header files might have a @brief or a @describe.

Thu, 2020-07-30 04:14
matteoferla

Thank you so much for all of the pointers. The reason I wanted to use PyRosetta is because I run Windows OS and don't have enough memory to run at the size of Rosetta on VM. I now have PyRosetta set up and working, but still need help calling SnugDock. I have read and understand the tutorial from the Nature Protocols paper, but that was for Rosetta. Generally I understand there are the following steps that need to be used in order to run a SnugDock run but would appreciate feedback on the methods I could use since I cannot find any SnugDock-specific code on Github as an example.  

1.) Imports

pyrosetta.rosetta

pyrosetta.rosetta.protocols.antibody

pyrosetta.rosetta.protocols.antibody.design

pyrosetta.rosetta.protocols.antibody.snugdock

2.) Load and clean the Ab and antigen structures with cleanATOM

3.) If I have only the antibody sequence and not a crystal structure, I would need to generate homology models first. I am assuming that I can skip this step and move on directly to relaxing my antibody structures to generate the ensemble list of Abs if I already have a crystal structure of my Ab. 

To determine the homology models, I was thinking of using CDR grafting in RosettaAntibodyDesign and mostly following the tutorials in the PyRosetta notebooks - or is there an easier way to do this?

1.) I would begin with a manually "docked" complex from a prelimary ZDOCK/GRAMM-X run and remove the antigen chain in the pdb file.

2.) Renumber this new Ab only file with PyIgClassify.

3.) Sequence design for the heavy chains, L1, and L3 for the pose of the Ab only .pdb file from PyIgClassify.

4.) Graft design the CDRs and sequence design L1 and L3.

5.) Model H3. I'm not sure how I can do this in PyRosetta so any guidance would be greatly appreciated. 

At this point, would the designed and grafted heavy chains, L1, and L3 along with the modeled H3 all be compiled into the same list? That is, how would I make the ensemble list of the antibody to prepack and then feed into SnugDock?

4.) Relax the antigen structure to generate the antigen ensemble list. If I already have the crystal strucure of my antibody can I jump straight into this step, avoiding making homology models and creating my antibody ensemble list from that?

Apply FastRelax to .pdb antigen and .pdb antibody. I'm assuming that if I have an ensemble list of homology models I can skip relaxing the homology antibodies.

5.) Assemble a putative docked complex with the Ab (L, H) and the antigen chain (A) by aligning to a preliminary ZDOCK/GRAMM-X/etc. run as a starting docking position. I'm assuming I would only need to do this for one of the members of the antibody ensemble list with one of the members of the antigen ensemble list for a total of 1 manually "docked" complexes as a starting point. I am aware that the order of each member of the Ab ensemble list is very important and must be L, H.

6.) Prepack the manually "docked" complex, the antibody ensemble, and the antigen ensemble. 

I am not sure if I should use prepack or set_prepack and am also not sure what my command should be for this line.

7.) Set the SnugDock flags and run.

I found this on a different forum post: 

snugdock.mpi.linuxgccrelease -s antibody_antigen_start.prepack.pdb -ensemble1 antibody_ensemble.list  -ensemble2 antigen_ensemble.list -antibody:auto_generate_kink_constraint -antibody:all_atom_mode_kink_constraint -partners LH_G –spin -dock_pert 3 8 -ex1 -ex2aro -nstruct 1000 

If I'm running this from PyRosetta on my Windows machine running Ubuntu, how would I change the command to run on my computer?

 

Thank you so much for all of your help!

Thu, 2020-08-06 12:27
shruthi.murali

I cannot answer your antibody specific modelling questions. Hopefully someone else can!

However, taking a step back. Do you have access to a cluster? If unsure, I would strongly recommend checking if your institute/department or university has one, which is common, but with varying degrees of usage. I would opt for going through the faff of submitting a job rather than hammer a laptop.

About the size of Rosetta, there is a minified version but you could give a go to keeping the database folder and only the relevant binary file from main/source/bin. In MacOS it is a symlink to /main/source/release or something, but not in Linux, but it might be release specific.

 

 

Fri, 2020-08-07 03:29
matteoferla