parm ../vacuo.topo
trajin ../ATAT-bw/aggregate.nc 1 last 1
trajin ../ATAT-longhorn/aggregate.nc 1 last 1
trajin ../ATAT-lancium/aggregate.nc 1 last 1

#################################
# Measure distance between A.N7 and T.N3
#################################
distance l3 :3@N7 :34@N3
distance l5 :5@N7 :32@N3
distance l7 :7@N7 :30@N3
distance l9 :9@N7 :28@N3
distance l11 :11@N7 :26@N3
distance l13 :13@N7 :24@N3
distance l15 :15@N7 :22@N3

distance l21 :21@N7 :16@N3
distance l23 :23@N7 :14@N3
distance l25 :25@N7 :12@N3
distance l27 :27@N7 :10@N3
distance l29 :29@N7 :8@N3
distance l31 :31@N7 :6@N3
distance l33 :33@N7 :4@N3

#################################
# Measure distance between A.N6 and T.O4
#################################
distance ll3 :3@N6 :34@O4
distance ll5 :5@N6 :32@O4
distance ll7 :7@N6 :30@O4
distance ll9 :9@N6 :28@O4
distance ll11 :11@N6 :26@O4
distance ll13 :13@N6 :24@O4
distance ll15 :15@N6 :22@O4

distance ll21 :21@N6 :16@O4
distance ll23 :23@N6 :14@O4
distance ll25 :25@N6 :12@O4
distance ll27 :27@N6 :10@O4
distance ll29 :29@N6 :8@O4
distance ll31 :31@N6 :6@O4
distance ll33 :33@N6 :4@O4

#################################
# Measure distance between C1'-C1'
#################################
distance c3 :3@C1' :34@C1'
distance c5 :5@C1' :32@C1'
distance c7 :7@C1' :30@C1'
distance c9 :9@C1' :28@C1'
distance c11 :11@C1' :26@C1'
distance c13 :13@C1' :24@C1'
distance c15 :15@C1' :22@C1'

distance c21 :21@C1' :16@C1'
distance c23 :23@C1' :14@C1'
distance c25 :25@C1' :12@C1'
distance c27 :27@C1' :10@C1'
distance c29 :29@C1' :8@C1'
distance c31 :31@C1' :6@C1'
distance c33 :33@C1' :4@C1'

#################################
# Measure chi
#################################
dihedral d3 :3@O4' :3@C1' :3@N9 :3@C4
hist d3 norm  min -180 max 180 bins 250 out d3.hist
dihedral d5 :5@O4' :5@C1' :5@N9 :5@C4
hist d5 norm  min -180 max 180 bins 250 out d5.hist
dihedral d7 :7@O4' :7@C1' :7@N9 :7@C4
hist d7 norm  min -180 max 180 bins 250 out d7.hist
dihedral d9 :9@O4' :9@C1' :9@N9 :9@C4
hist d9 norm  min -180 max 180 bins 250 out d9.hist
dihedral d11 :11@O4' :11@C1' :11@N9 :11@C4
hist d11 norm  min -180 max 180 bins 250 out d11.hist
dihedral d13 :13@O4' :13@C1' :13@N9 :13@C4
hist d13 norm  min -180 max 180 bins 250 out d13.hist
dihedral d15 :15@O4' :15@C1' :15@N9 :15@C4
hist d15 norm  min -180 max 180 bins 250 out d15.hist

dihedral d21 :21@O4' :21@C1' :21@N9 :21@C4
hist d21 norm  min -180 max 180 bins 250 out d21.hist
dihedral d23 :23@O4' :23@C1' :23@N9 :23@C4
hist d23 norm  min -180 max 180 bins 250 out d23.hist
dihedral d25 :25@O4' :25@C1' :25@N9 :25@C4
hist d25 norm  min -180 max 180 bins 250 out d25.hist
dihedral d27 :27@O4' :27@C1' :27@N9 :27@C4
hist d27 norm  min -180 max 180 bins 250 out d27.hist
dihedral d29 :29@O4' :29@C1' :29@N9 :29@C4
hist d29 norm  min -180 max 180 bins 250 out d29.hist
dihedral d31 :31@O4' :31@C1' :31@N9 :31@C4
hist d31 norm  min -180 max 180 bins 250 out d31.hist
dihedral d33 :33@O4' :33@C1' :33@N9 :33@C4
hist d33 norm  min -180 max 180 bins 250 out d33.hist

run

######################################################################

writedata base3.dat l3 ll3 c3 d3  
writedata base5.dat l5 ll5 c5 d5
writedata base7.dat l7 ll7 c7 d7
writedata base9.dat l9 ll9 c9 d9
writedata base11.dat l11 ll11 c11 d11
writedata base13.dat l13 ll13 c13 d13
writedata base15.dat l15 ll15 c15 d15
			         
writedata base21.dat l21 ll21 c21 d21
writedata base23.dat l23 ll23 c23 d23
writedata base25.dat l25 ll25 c25 d25
writedata base27.dat l27 ll27 c27 d27
writedata base29.dat l29 ll29 c29 d29
writedata base31.dat l31 ll31 c31 d31
writedata base33.dat l33 ll33 c33 d33

outtraj resd3.nc maxmin d3 min 46 max 68
outtraj resd5.nc maxmin d5 min 46 max 68
outtraj resd7.nc maxmin d7 min 46 max 68
outtraj resd9.nc maxmin d9 min 46 max 68
outtraj resd11.nc maxmin d11 min 46 max 68
outtraj resd13.nc maxmin d13 min 46 max 68
outtraj resd15.nc maxmin d15 min 46 max 68

outtraj resd21.nc maxmin d21 min 46 max 68
outtraj resd23.nc maxmin d23 min 46 max 68
outtraj resd25.nc maxmin d25 min 46 max 68
outtraj resd27.nc maxmin d27 min 46 max 68
outtraj resd29.nc maxmin d29 min 46 max 68
outtraj resd31.nc maxmin d31 min 46 max 68
outtraj resd33.nc maxmin d33 min 46 max 68

## Filter by distance
outtraj resl3.nc maxmin l3 min 0 max 4
outtraj resl5.nc maxmin l5 min 0 max 4
outtraj resl7.nc maxmin l7 min 0 max 4
outtraj resl9.nc maxmin l9 min 0 max 4
outtraj resl11.nc maxmin l11 min 0 max 4
outtraj resl13.nc maxmin l13 min 0 max 4
outtraj resl15.nc maxmin l15 min 0 max 4

outtraj resl21.nc maxmin l21 min 0 max 4
outtraj resl23.nc maxmin l23 min 0 max 4
outtraj resl25.nc maxmin l25 min 0 max 4
outtraj resl27.nc maxmin l27 min 0 max 4
outtraj resl29.nc maxmin l29 min 0 max 4
outtraj resl31.nc maxmin l31 min 0 max 4
outtraj resl33.nc maxmin l33 min 0 max 4

## Filter by distance C1'-C1'
outtraj resc3.nc maxmin c3 min 0 max 9.5
outtraj resc5.nc maxmin c5 min 0 max 9.5
outtraj resc7.nc maxmin c7 min 0 max 9.5
outtraj resc9.nc maxmin c9 min 0 max 9.5
outtraj resc11.nc maxmin c11 min 0 max 9.5
outtraj resc13.nc maxmin c13 min 0 max 9.5
outtraj resc15.nc maxmin c15 min 0 max 9.5

outtraj resc21.nc maxmin c21 min 0 max 9.5
outtraj resc23.nc maxmin c23 min 0 max 9.5
outtraj resc25.nc maxmin c25 min 0 max 9.5
outtraj resc27.nc maxmin c27 min 0 max 9.5
outtraj resc29.nc maxmin c29 min 0 max 9.5
outtraj resc31.nc maxmin c31 min 0 max 9.5
outtraj resc33.nc maxmin c33 min 0 max 9.5

run

