File: RunTest.sh

package info (click to toggle)
cpptraj 5.1.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 138,900 kB
  • sloc: cpp: 145,621; ansic: 34,635; sh: 11,365; f90: 971; makefile: 770; awk: 242
file content (150 lines) | stat: -rwxr-xr-x 3,445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash

. ../MasterTest.sh

CleanFiles ptraj.in out.dipole out.xplor out.dx out.dx.2 test.dx box.dx mask.dx \
           nonortho.dx triclinic.nc nonortho.pdb bounds.dat bounds.mol2 \
           bounds.xplor avg.mol2 nonortho_wrap.dx byres.dx bymol.dx

TESTNAME='Grid tests'
Requires netcdf maxthreads 10
INPUT="ptraj.in"

# dipole
Dipole() {
  TOP="../tz2.ortho.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.ortho.nc
autoimage origin
rms first :1-13
dipole out.dipole 20 0.5 20 0.5 20 0.5 :WAT
EOF
  RunCpptraj "Dipole test"
  DoTest out.dipole.save out.dipole
}

# grid
Grid() {
  TOP="../tz2.truncoct.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.truncoct.nc
autoimage origin
rms first :1-13
average avg.mol2 :1-13 
grid out.xplor 20 0.5 20 0.5 20 0.5 :WAT@O name XPLOR
grid out.dx 20 0.5 20 0.5 20 0.5 :WAT@O
grid out byres.dx 10 1 10 1 10 1 :WAT byres
grid out bymol.dx 10 1 10 1 10 1 :WAT bymol
EOF
  RunCpptraj "Grid test"
  DoTest out.xplor.save out.xplor
  DoTest out.dx.save out.dx
  DoTest byres.dx.save byres.dx
  DoTest byres.dx.save bymol.dx
}

# grid dx read
GridDxRead() {
  TOP="../tz2.truncoct.parm7"
  cat > ptraj.in <<EOF
readdata out.dx.save
trajin ../tz2.truncoct.nc
autoimage origin
rms first :1-13
grid out.dx.2 data out.dx.save @CA opendx  
EOF
  RunCpptraj "OpenDX Grid read test"
  DoTest out.dx.2.save out.dx.2
}

# Specified center
SpecifiedCenter() {
  TOP="../tz2.ortho.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.ortho.nc 1 10
autoimage origin
grid test.dx 34 .5 44 .5 36 .5 gridcenter 1.5 1.0 0.0 :WAT
EOF
  RunCpptraj "Grid with specified center test."
  DoTest test.dx.save test.dx
}

# Box center offset
BoxCenterOffset() {
  TOP="../tz2.ortho.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.ortho.nc 1 10
grid box.dx 30 .5 30 .5 30 .5 box :WAT
EOF
  RunCpptraj "Grid with box center offset test."
  DoTest box.dx.save box.dx
}

# Mask center offset
MaskCenterOffset() {
  TOP="../tz2.ortho.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.ortho.nc 1 10
grid mask.dx 30 .5 30 .5 30 .5 center :1-12@CA :WAT
EOF
  RunCpptraj "Grid with mask center offset test."
  DoTest mask.dx.save mask.dx
}

# Non-orthogonal grid
NonorthogonalGrid() {
  TOP="../tz2.truncoct.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.truncoct.nc
reference ../tz2.truncoct.nc [REF]
autoimage triclinic
grid nonortho.dx boxref [REF] 50 50 50 :WAT@O pdb nonortho.pdb
#trajout triclinic.nc
EOF
  RunCpptraj "Non-orthogonal grid test."
  DoTest nonortho.dx.save nonortho.dx
}

# Non-orthogonal grid, points centered on bins
NonorthoGridBinCenter() {
  TOP="../tz2.truncoct.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.truncoct.nc
reference ../tz2.truncoct.nc [REF]
autoimage triclinic
grid nonortho_wrap.dx boxref [REF] 20 20 20 :WAT@O gridwrap name BC
EOF
  RunCpptraj "Non-orthogonal grid centered on bin center and wrapped test"
  DoTest nonortho_wrap.dx.save nonortho_wrap.dx
}

# Generate grid from bounds
Bounds() {
  TOP="../tz2.ortho.parm7"
  cat > ptraj.in <<EOF
trajin ../tz2.ortho.nc
autoimage
rms first :1-13&!@H= mass
bounds :1-13 dx .5 name MyGrid out bounds.dat
#average bounds.mol2 :1-13
createcrd MyCoords
run
crdaction MyCoords grid bounds.xplor data MyGrid :WAT@O
EOF
  RunCpptraj "Grid generation from 'bounds' test."
  DoTest bounds.dat.save bounds.dat
  DoTest bounds.xplor.save bounds.xplor 
}

Dipole
Grid
GridDxRead
SpecifiedCenter
BoxCenterOffset
MaskCenterOffset
NonorthogonalGrid
NonorthoGridBinCenter
Bounds

EndTest
exit 0