# Scoring a membrane protein in PyRosetta?

15 posts / 0 new
Scoring a membrane protein in PyRosetta?
#1

Hi everyone,

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?

Thanks,
Tobias

Post Situation:
Thu, 2014-01-16 15:05
tsikosek

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:

#Boolean options
-membrane:no_interpolate_Mpair #membrane scoring specification
-membrane:Menv_penalties #turn on membrane penalty scores

#file options
-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.

Fri, 2014-01-17 08:42
rmoretti

Thanks!

Does the scoring function consider lipo files? I would have to download the NR database from NCBI, is that right?

Tue, 2014-01-21 12:25
tsikosek

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.)

Tue, 2014-01-21 16:31
rmoretti

Hi,
I am trying to get rosetta score for membrane protein (using Pyrosetta).
My code:
init()
pose = Pose()
pose_from_pdb(pose, pdb_filename)

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')
print mem_scorefxn.show(pose)

I get this error:

Any ideas what am doing wrong here?
Thanks

Wed, 2014-01-22 01:57
nh

by the way I also tried using : core.get_file_option and got the same error

Wed, 2014-01-22 02:45
nh

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 [1]: import rosetta In [2]: rosetta.init() ... In [6]: rosetta.core.set_string_option('in:file:frag3', 'aaa') In [7]: print rosetta.core.get_string_option('in:file:frag3') aaa ... In [8]: rosetta.core.set_string_option('in:file:spanfile', 'bbb') In [9]: print rosetta.core.get_string_option('in:file:spanfile') bbb

Wed, 2014-01-22 12:07
Sergey

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:: 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.

Sun, 2014-01-26 00:41
nh

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:

rosetta.init(" ".join(opts))

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.

Tue, 2014-01-28 07:41

Hi,

rosetta.init(" ".join(opts)) works!

Wed, 2014-01-29 02:31
nh

Hi again,

Tue, 2014-01-28 00:12
nh

Hi nh,
Try the following:
from rosetta import *
init()
import rosetta.basic.options
rosetta.basic.options.set_string_option("in:file:spanfile", "asdf")
print rosetta.basic.options.get_string_option("in:file:spanfile")

Mon, 2014-02-10 03:02
ggyimesi

Hi again,
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)
Like:
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.

I do:
opts = ["-in:file:spanfile "+spanfile, "-in:file:fullatom","-membrane:no_interpolate_Mpair","-membrane:Menv_penalties"]
rosetta.init(" ".join(opts))
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.

Thanks!

Thu, 2014-02-13 04:08
nh

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.

Fri, 2014-02-14 12:20
rmoretti

Hi,

It works!!
Thanks a lot for your help.
I really appreciate it!

All the best.

Sun, 2014-02-16 01:53
nh