Viewing 3 reply threads
  • Author
    Posts
    • #2692
      Anonymous

        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 !

      • #13557
        Anonymous

          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.

          • #13570
            Anonymous

              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!

          • #13575
            Anonymous

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

            • #13595
              Anonymous

                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!

                • #13599
                  Anonymous

                    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.

              Viewing 3 reply threads
              • You must be logged in to reply to this topic.