Member Site › Forums › PyRosetta › PyRosetta – General › (1) Score pose, (2) move atom, (3) score pose
- This topic has 6 replies, 2 voices, and was last updated 13 years, 5 months ago by Anonymous.
-
AuthorPosts
-
-
July 15, 2011 at 6:04 pm #977Anonymous
from rosetta import *
import sysinit()
pose = Pose()
scorefxn = create_score_function_ws_patch('standard','score12')pose_from_pdb(pose,'config.pdb')
scorePose = scorefxn(pose)
print scorePose
coord = pose.residue(740).atom('N').xyz()
print coord
coord.x = 100.0
print coord
scorePose = scorefxn(pose)
print scorePose
Returns:
...
core.pack.task: Packer task: initialize from command line()
core.scoring.dunbrack: Dunbrack library took 0.01 seconds to load from binary
-1347.47520146
-30.36600000000000 14.16400000000000 -17.65900000000000
100.0000000000000 14.16400000000000 -17.65900000000000
-1347.47520146
Is this something I’m doing wrong, or do I need to trigger some kind of neighbor list update after moving an atom?
-
July 15, 2011 at 6:41 pm #5856Anonymous
coord is not a reference, it is a local copy. You haven’t modified the coordinate of residue 740 atom N, you’ve made a local copy of that coordinate and then modified THAT.
You’ll need to make a local copy of the Residue object for residue 740, modify that, and replace the Pose’s 740 with your new 740 (if you really wanted to do that to it, anyway….)
-
July 15, 2011 at 6:48 pm #5857Anonymous
So there is no way to get access to an atom’s mutable position vector?
I can’t set an atom’s position through:
atom = pose.residue(5).atom(‘N’) ?
-
July 15, 2011 at 6:56 pm #5858Anonymous
coord = pose.residue(740).atom('N').xyz()
print coord
coord.x = 100.0
print pose.residue(740).atom('N').xyz()
…should prove that this is a pointer. It looks like there are two sets of coordinates kept. One in the atomtree and one elsewhere, and I may need to trigger an update somehow.
-
July 15, 2011 at 7:11 pm #5861Anonymous
It looks like the set_xyz method is the way to go…
void
Conformation::set_xyz(
AtomID const & id,
PointPosition const & position
)
{
// update atomtree coords
if ( !atom_tree_.empty() ) atom_tree_.set_xyz( id, position );// update residue coords
residues_[ id.rsd() ]->set_xyz( id.atomno(), position );// notify scoring
set_xyz_moved( id );
}
-
July 15, 2011 at 7:00 pm #5859Anonymous
Try pose.set_xyz(AtomID, PointPosition). AtomID is composed of a residue and atom number, I forget in what order. PointPosition is probably an alias for a coordinate triplet.
-
July 15, 2011 at 7:06 pm #5860Anonymous
A) The code is written such that it handles all the automatic updating for you.
The traditional way to force a coordinate update, (before we had all the automatic updating working well), was pose.residue(1). Since you’re already calling pose.residue, it’s going to try to do the update.
C) It’s possible there’s something broken in between the C++ and Python layers here.
-
-
AuthorPosts
- You must be logged in to reply to this topic.