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
|
#!/bin/bash
. ../MasterTest.sh
CleanFiles ptraj.in cpptraj.nc mop.trr temp.crd total?.out
TESTNAME='GROMACS TRR tests'
Requires maxthreads 10
INPUT="-i ptraj.in"
GmxTrrRead() {
UNITNAME='TRR force/velocity read -> NetCDF write test'
CheckFor maxthreads 2 netcdf pnetcdf
if [ $? -eq 0 ] ; then
cat > ptraj.in <<EOF
parm nvt.protein.mol2
trajin nvt.2frame.trr
trajout cpptraj.nc
EOF
RunCpptraj "$UNITNAME"
NcTest cpptraj.nc.save cpptraj.nc
fi
UNITNAME='TRR force/velocity read -> TRR write test'
CheckFor maxthreads 2
if [ $? -eq 0 ] ; then
cat > ptraj.in <<EOF
parm nvt.protein.mol2
trajin nvt.2frame.trr
trajout cpptraj.trr
EOF
RunCpptraj "$UNITNAME"
DoTest nvt.2frame.trr cpptraj.trr
fi
}
GmxTrrWrite() {
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin ../tz2.truncoct.crd
trajout mop.trr trr
EOF
RunCpptraj "CRD => TRR"
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
#trajin temp.trr
trajin mop.trr
trajout temp.crd title "trajectory generated by ptraj"
EOF
RunCpptraj "TRR => CRD"
DoTest ../tz2.truncoct.crd temp.crd
}
# Gromacs TRR append
GmxTrrAppend() {
UNITNAME='GMX TRR append test'
CheckFor notparallel
if [ $? -eq 0 ] ; then
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin ../tz2.truncoct.crd 1 5
trajout mop.trr trr
EOF
RunCpptraj "CRD(1-5) => TRR"
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin ../tz2.truncoct.crd 6 10
trajout mop.trr trr append
EOF
RunCpptraj "CRD(6-10) => TRR"
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin mop.trr
trajout temp.crd title "trajectory generated by ptraj"
EOF
RunCpptraj "TRR (appended) => CRD"
DoTest ../tz2.truncoct.crd temp.crd
fi
}
# Gromacs TRR with offsets
GmxOffset() {
UNITNAME='GMX offset test'
CheckFor maxthreads 5
if [ $? -eq 0 ] ; then
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin ../tz2.truncoct.crd 2 10 2
trajout total1.out title "offset test"
EOF
RunCpptraj "GMX: CRD with offset"
cat > ptraj.in <<EOF
parm ../tz2.truncoct.parm7
trajin mop.trr 2 10 2
trajout total2.out title "offset test"
EOF
RunCpptraj "GMX: TRR with offset"
DoTest total1.out total2.out
fi
}
GmxTrrRead
GmxTrrWrite
GmxTrrAppend
GmxOffset
EndTest
exit 0
|