You are here

rosetta app

6 posts / 0 new
Last post
rosetta app
#1

hi,

  How to get the location (xyz) of residue, i do not how to use  "PointPosition const & xyz( AtomID const & id ) const" and "PointPosition const &  xyz( NamedAtomID const & id ) const" in class  Pose. I use rosetta ,thaks so much !

Post Situation: 
Wed, 2017-07-05 06:52
MA

PointPosition is a typedef of numeric::xyzVector < core::Real > .  xyzVector holds x, y, and z as an ordered triplet.  You can access them with x(), y(), and z().

So, 

core::Real x_coord = pose.xyz(thisAtom).x().

 

I am assuming:

A) you are intentionally writing Rosetta C++ code, which is unusual for an user

B) you have the AtomID already, or you'd've asked about that too.

Wed, 2017-07-05 07:02
smlewis

Dear smlewis,

 Thank for your help, as you said, i do not know how to get AtomID. If you have free  time , please give me a whole c++ code about this problem. Thank you very much!

Wed, 2017-07-05 19:10
MA

If you open up core/id/AtomID.hh, you will see it offers a simple constructor:

  /// @brief Property constructor
  inline
  AtomID(
    Size const atomno_in,
    Size const rsd_in
  ) :
    atomno_( atomno_in ),
    rsd_( rsd_in )
  {}

Pass in which residue number you want, and which atom number of that residue you want.

You can get a map of PDB-style atom names to atom number indices from ResidueType.  Your Pose can return the ResidueType of a residue given the position - the function is probably pose.residue_type()

Thu, 2017-07-06 07:24
smlewis

Sorry to bother you again. 

A) what is the meaning of 'thisAtom' in the sentense "core::Real x_coord = pose.xyz(thisAtom).x()." ?

B) how can I get the x_coord of  'N' Atom of residue 1 by using the previous sentence, and 'C', 'CA',and 'O'.

C) can I get the complete Atom position by "pose.xyz(thisAtom)"?

tks!

Tue, 2017-07-11 00:17
MA

A) 'thisAtom' would be the AtomID that you need to construct, using the instructions in my previous post.

B) That line of code will do what you want, given that you've created AtomID objects for the atoms in question.

C) This line of code will return an xyzVector, yes.  It's effectively an ordered triplet.

 

What are you actually trying to do?  Why do you need coordinates in C++ code?  You don't seem comfortable writing C++; maybe there is some other way to do what you want to do.

Tue, 2017-07-11 07:53
smlewis