I would like to study mutations in a membrane protein with PyRosetta. Is this currently possible and if so, how do I pass on information about the transmembrane region to the scoring function?
Should I use the 'score_membrane.wts' scoring function?
It should be possible, although there is not necessarily a good way to programmatically twisty all the knobs. Instead, you have to manipulate the Rosetta options system. See http://www.pyrosetta.org/faq#TOC-1.-How-do-I-interact-with-the-Rosetta-O... for details. Keep in mind that the values of some options (especially energy function options) are accessed early and stored internally, so changing them midway through the program might not work as expected. It's often best to set options as early as possible, and then leave them at a single setting throughout the whole PyRosetta run.
To tell Rosetta what the transmembrane regions are, use a span file. The regular Rosetta documentation covers this somewhat in the membrane ab inito documentation. https://www.rosettacommons.org/manuals/archive/rosetta3.5_user_guide/db/... Although not needed, adding a lipophilicity file can often also help with membrane predictions.
Regarding what weights files to use score_membrane.wts is a low-resolution (centroid mode) score function. It's good for folding and loop modeling studies, but if you're using a somewhat constant backbone structure, you'll want a full atom scorefunction, of which I would recommend the membrane_highres_Menv_smooth.wts scoring function with the following options:
-membrane:no_interpolate_Mpair #membrane scoring specification
-membrane:Menv_penalties #turn on membrane penalty scores
-in:file:spanfile protein.span # Transmembrane prediction
-in:file:lipofile protein.lips # Lipophilicity prediction
There's no way to change these options programmatically - they have to go through the options system, and should be set before you create the scorefunction.
Does the scoring function consider lipo files? I would have to download the NR database from NCBI, is that right?
Yes, the same machinery that considers the span file will also take the lipo file into consideration.
I've never run the run_lips.pl script myself, but as I understand it you will indeed need BLAST and the NR database from NCBI to run it. (Keep in mind that the lipofile is optional - if you have issues generating it, you can still run the protocol without it.)
I am trying to get rosetta score for membrane protein (using Pyrosetta).
pose = Pose()
spanfile = os.path.join(work_dir,os.path.basename(pdb_filename)+".spn")
rosetta.core.set_string_option( 'in::file::spanfile' , spanfile)
print rosetta.core.get_string_option( 'in::file::spanfile' )
mem_scorefxn = create_score_function('score_membrane')
I get this error:
ERROR: set_option: OptionKey with id in::file::spanfile not found!
Any ideas what am doing wrong here?
by the way I also tried using : core.get_file_option and got the same error
Which version of PyRosetta did you use? I jus tried example below (take from http://www.pyrosetta.org/faq#TOC-1.-How-do-I-interact-with-the-Rosetta-O...) on one of the latest build and it works as expected. If you using an old build it quite possible that it does not have this option yet.
In : import rosetta
In : rosetta.init()
In : rosetta.core.set_string_option('in:file:frag3', 'aaa')
In : print rosetta.core.get_string_option('in:file:frag3')
In : rosetta.core.set_string_option('in:file:spanfile', 'bbb')
In : print rosetta.core.get_string_option('in:file:spanfile')
Thanks for the reply.
I am using a new version which was downloaded last week.
It looks like it has the set/get options but is not able to find the "option keys" for some reason.
I get the error:
ERROR: set_option: OptionKey with id in:file:frag3 not found!
ERROR:: Exit from: /home/sergey/PyRosetta.autobuild.linux.Ubuntu/main/source/src/python/bindings/rosetta/core/__core_all_at_once_.0.cpp line: 48
Maybe something to do with the compilation.
Is it possible to get the source so I can compile it on my computer?
Thanks a lot.
Can you post the full command you are using to set the options? Have you called rosetta.init() before you try to set the option?
In the meantime, instead of getting and setting individual options, you can have the options as strings in a list and re-init Rosetta with those options:
Make sure to have "-" in front of the option. In your case, you would have opts = ["-in:file:frag3 path_to_my_file.txt"] Any other options that you would want to set can be added to the opts list.
Thanks a lot for your reply.
rosetta.init(" ".join(opts)) works!
Please help me...
Try the following:
from rosetta import *
Thanks for helping me before.
Now I have a new problem.
I would like to score a complex with two chains.
When using a simple score (not membrane)
pose = Pose()
pose_from_pdb(pose, pdb_filename) #pdb with both chains
bound_score = fa_scorefxn(pose)
With this I get the whole complex score.
But I would like to score it with the membrane score function.
opts = ["-in:file:spanfile "+spanfile, "-in:file:fullatom","-membrane:no_interpolate_Mpair","-membrane:Menv_penalties"]
mem_scorefxn = create_score_function('membrane_highres_Menv_smooth') # or ('score_membrane')
bound_score = mem_scorefxn(pose)
I prepare a concatenated file of two span files (also changing the residue number).
What I see in the output log is that only one chain's membrane region is taken from the span file.
Any ideas how to do this?
Attaching the pdb file, span files and the output file.
First off, good job on knowing that you need to adjust the residue numbering. Residue numbering mismatches are typically where people get tripped up.
The issue you're seeing, though, is the line "6 496" in the span file. The second number is the total number of residues, which you correctly updated, but the first number is the number of transmembrane helicies. Since you left it at 6, it only reads in the first 6 entries in the file, and omits the rest. You need to adjust that line to match.
Thanks a lot for your help.
I really appreciate it!
All the best.