center transformation and fitting

24 views
Skip to first unread message

Yogesh Sharma

unread,
Dec 4, 2021, 5:41:28 AM12/4/21
to MDnalysis discussion
A = mda.Universe(ACOORD,ATRAJ)
ArefAtoms = A.residues[179].atoms
center_transformation = MDAnalysis.transformations.center_in_box(ArefAtoms, center='mass', point=[0,0,0])
A.trajectory.add_transformations(center_transformation)

hi I got this demo script from net.  Just a quick question what does the [179] specifies here? is it time step or an resid?

Richard Gowers

unread,
Dec 4, 2021, 5:50:42 AM12/4/21
to mdnalysis-...@googlegroups.com
Hi Yogesh 

Its slicing the residues, so it’s the 180th residue in the topology.


--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/516bb0a2-13b3-48b2-b32e-df9fe13c0895n%40googlegroups.com.

Yogesh Sharma

unread,
Dec 4, 2021, 6:29:07 AM12/4/21
to mdnalysis-...@googlegroups.com
Hi Richard
thnk you for your time. what does the slicing mean in terms of fitting?
   with  regards
Yogesh Sharma



Oliver Beckstein

unread,
Dec 4, 2021, 4:50:12 PM12/4/21
to mdnalysis-discussion
Hi Yogesh Sharma,

what does the slicing mean in terms of fitting?

ArefAtoms = A.residues[179].atoms

takes the atoms of the 180th residue of the universe A and stores it as the AtomGroup ArefAtoms. The center of mass of this AtomGroup is used to for centering the content of the trajectory with the center_in_box() on-the-fly transformation. There’s no fitting happening.


Do you want to fit a trajectory to a reference? In this case have a look at the tutorials in the user guide https://userguide.mdanalysis.org/stable/examples/analysis/alignment_and_rms/README.html to learn how to do fitting. 

Do you want to use on the fly transformations (which is what the code snippet does)? If so I recommend reading https://userguide.mdanalysis.org/stable/trajectories/transformations.html first. You’ll then be in a position to adapt code for your own purpose.

Best,
Oliver

On Dec 4, 2021, at 4:28 AM, Yogesh Sharma <yogesh...@gmail.com> wrote:

Hi Richard
thnk you for your time. what does the slicing mean in terms of fitting?
   with  regards
Yogesh Sharma



On Sat, Dec 4, 2021 at 4:20 PM Richard Gowers <richard...@gmail.com> wrote:
Hi Yogesh 

Its slicing the residues, so it’s the 180th residue in the topology.


On Sat, Dec 4, 2021 at 10:41, Yogesh Sharma <yogesh...@gmail.com> wrote:
A = mda.Universe(ACOORD,ATRAJ)
ArefAtoms = A.residues[179].atoms
center_transformation = MDAnalysis.transformations.center_in_box(ArefAtoms, center='mass', point=[0,0,0])
A.trajectory.add_transformations(center_transformation)

hi I got this demo script from net.  Just a quick question what does the [179] specifies here? is it time step or an resid?


-
--
Oliver Beckstein (he/his/him)


MDAnalysis – a NumFOCUS fiscally sponsored project




Message has been deleted
Message has been deleted

Oliver Beckstein

unread,
Dec 5, 2021, 1:57:13 PM12/5/21
to mdnalysis-discussion
Hi Yogesh Sharma,

On Dec 5, 2021, at 5:58 AM, Yogesh Sharma <yogesh...@gmail.com> wrote:

actually i am trying to get pore radius over trajectory using ax = HA.plot() . but i am getting uncentered plot like i have attached in the screenshot. so i thought may be it should be some kind of centering issue. suggestions please. 

Did you look at your trajectory and do you see that your protein is moving about?

If the protein is really moving then a centering transformation might help and I would try that as the next step. 

However, HOLE2 is not guaranteed to always create consistent paths. It depends on the starting point and the random number seed. It’s always a good idea to run HOLE2 manually on specific frames to get an idea how your parameters like CPOINT and CVECT affect the output.

Oliver

Yogesh Sharma

unread,
Dec 6, 2021, 1:37:28 AM12/6/21
to mdnalysis-...@googlegroups.com
Thank you Dr. Oliver.
yes it was an issue with the starting point, by specifying cpoint its solved.

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages