You are here

Error with etable_atom_pair_energies()

3 posts / 0 new
Last post
Error with etable_atom_pair_energies()
#1

I am new to Pyrosetta and programing and I am learning how to use Pyrosetta. So when I was practicing scoring with Workshop #3 bullet point 5, I came across a error, and I have no idea what's wrong with.

Here is what I did. 

r1 = pose.residue(24)

r2 = pose.residue(20)

a1 = r1.atom("N")

a2 = r1.atom("O")

etable_atom_pair_energies(a1, a2, scorefxn)

And it came out this error:

TypeError: etable_atom_pair_energies() missing 2 required positional arguments: ' atom_index_2' and 'sfxn'

For line 2 and 3, the book uses ras.residue(), but for some reason it did not work for me but the pose did. 

So from what it looks like I have typed things wrong, and I don't know what is going on. Can anyone help me with this problem? Thank you all a lot.

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Update:

I think I figured out how to use this function. Instead of following the book, I did the following trying to find the attractive energy between the N of residue 24 and O of the residue 20:

etable_atom_pair_energies(r1, a1, r2, a2, fa_atr)

But I came accross another error. 

AttributeError: 'pyrosetta.rosetta.core.scoring.ScoreTypr' object has no attribute 'energy_method_options'

Can anyone help me with this?

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Update 2:

I guess I didn't understand what can be put as sfxn in the function below. Can someone give any examples on what can be input as sfxn?

etable_atom_pair_energies(r1, a1, r2, a2, sfxn)

 

Category: 
Post Situation: 
Mon, 2019-01-28 14:00
yijietseng
#!/usr/bin/env python
#-*- coding: utf-8 -*

from pyrosetta import *
from pyrosetta.teaching import *
from rosetta.core.scoring.hbonds import HBondSet
from pyrosetta.rosetta import core, protocols

init()
pose = pose_from_pdb("6q21.clean.pdb")
fa_scorefxn = get_fa_scorefxn()

## extract atom-pair energy;
r1 = pose.residue(24)
r2 = pose.residue(20)
a1 = r1.atom_index("N")
a2 = r2.atom_index("O")
print etable_atom_pair_energies(r1, a1, r2, a2, fa_scorefxn)

Returns:
tuple: values of the lj_atr, lj_rep, fa_solv, and fa_elec potentials.

see: https://graylab.jhu.edu/PyRosetta.documentation/pyrosetta.toolbox.atom_pair_energy.html?highlight=etable_atom_pair_energies#pyrosetta.toolbox.atom_pair_energy.etable_atom_pair_energies

Fri, 2019-02-01 00:39
zhangying1990

Thank you so much for reply, that really helped. I guess I was really confused on which argument I should put in. Thank you again. 

Tue, 2019-02-19 18:04
yijietseng