Previous Thread
Next Thread
Print Thread
P-N vector orientation
#19421 11/26/08 08:14 PM
Joined: Sep 2003
Posts: 8,471
rmv Offline OP
Forum Member
OP Offline
Forum Member
Joined: Sep 2003
Posts: 8,471
This example illustrates computing an angle theta wrt. the bilayer normal (Z axis), and getting the probability distribution, p(theta), for each leaflet.

* the angle from the Z proj for P--N; first file @FF last file @LF
*

stream rtfprm.str ! READ RTF,PARAM
stream psfcrd.str ! READ PSF,COOR

! CHANGE FOR OTHER SIZES; LIPID COUNT, AND HALFWAY POINT
set nlpd 72
set nlph 36
! CALC SIZES FOR CORREL
calc n = 1 + @LF - @FF
calc mxa = @NLPD * 6
calc mxs = 10 + @NLPD * 2
calc mxt = 100 * @N ! 100 FRAMES PER FILE

correl maxtim @MXT maxa @MXA maxs @MXS noupdate
enter sa zero
edit sa total 360 offset 0. delta 0.5 skip 1
enter sb dupl sa

! DECLARE Z, R VECTOR COMPONENTS
set k 1
label elp
enter z@K vect z L @K N L @K P
enter r@K vect r L @K N L @K P
incr k by 1
if k le @NLPD goto elp

! OPEN FILES
set m @FF
set u 8
label tlp
open read unit @U file name dyn@M.trj
incr u by 1
incr m by 1
if m le @LF goto tlp
traj firstu 8 nunit @N

! LOOP OVER LIPIDS; LEAFLET A = 1 THRU NLPH, B > NLPH
set k 1
label clp
set inv 1.0
if k gt @NLPH set inv -1.0 ! SIGN INVERTED FOR LEAFLET B
mantim z@K ratio r@K ! NORMALIZE (DIVIDE BY LENGTH)
mantim z@K mult @INV ! LEAFLET CORRECTION
mantim z@K acos ! COMPUTE ANGLE THETA
mantim z@K hist 0. 180. 360 ! COMPUTE p(THETA); LEAFLET AVG
if k le @NLPH mantim sa add z@K
if k gt @NLPH mantim sb add z@K

incr k by 1
if k le @NLPD goto clp

! NORMALIZE SO THAT p(theta) SUMS TO 1.0
mantim sa divi @NLPH
mantim sb divi @NLPH

edit sa veccod 2 delta 0.5 skip 1 offset 0. total 360
open write unit 1 card name pn-hst@LF.dat
write sa unit 1 dumb time
* dumb
*

end
stop


Rick Venable
computational chemist

Re: P-N vector orientation
rmv #19422 12/01/08 10:49 AM
Joined: Jul 2004
Posts: 165
B
Forum Member
Offline
Forum Member
B
Joined: Jul 2004
Posts: 165
rick,

An angle of 0 corresponds to a vector aligned with the axis of reference pointing toward the aqueous phase, and an angle of 180 corresponds to a vector pointing toward the bilayer core, correct?

thank you.

Re: P-N vector orientation
beginner #19423 12/01/08 05:48 PM
Joined: Sep 2003
Posts: 8,471
rmv Offline OP
Forum Member
OP Offline
Forum Member
Joined: Sep 2003
Posts: 8,471
Yes, although it is often useful to discuss 90-theta, which is 0 when parallel to the bilayer surface, and positive with an outward tilt, negative for inward.

Re: P-N vector orientation
rmv #19424 01/06/09 09:28 PM
Joined: Jul 2004
Posts: 165
B
Forum Member
Offline
Forum Member
B
Joined: Jul 2004
Posts: 165
dear rick,

could you please give me a hint how could I get an average value of the angle?

thank you

Re: P-N vector orientation
beginner #19425 01/06/09 09:57 PM
Joined: Sep 2003
Posts: 8,471
rmv Offline OP
Forum Member
OP Offline
Forum Member
Joined: Sep 2003
Posts: 8,471
I believe that the integral of p(theta) should give the mean, and the median value should be easy to read from a plot of p(theta).

Re: P-N vector orientation
rmv #19426 01/06/09 10:09 PM
Joined: Jul 2004
Posts: 165
B
Forum Member
Offline
Forum Member
B
Joined: Jul 2004
Posts: 165
thanks rick, it is my mistake.
I tried to get the average by modified this script and compare the result with what I did by the script that you suggested to calculate the bilayer chain tillt.

I found out that in this case we can not average the 2 monolayers (not setup set nlpd and nlph ) as we did for the bilayer chain tillt calculation


Moderated by  lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 5.6.33-0+deb8u1 Page Time: 0.012s Queries: 26 (0.004s) Memory: 0.9320 MB (Peak: 1.0293 MB) Data Comp: Off Server Time: 2020-07-15 08:13:31 UTC
Valid HTML 5 and Valid CSS