summaryrefslogtreecommitdiff
path: root/sim/src/tests/amino_acids/CreateTests.py
blob: 1194d799fbc42d9ad82a2721983fe86b87c16f84 (plain)
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
#!/usr/bin/python

import os
import sys
import MmpFile
import XyzFile

damianFiles = ("ala_l_aminoacid.mmp",
               "arg_l_aminoacid.mmp",
               "asn_l_aminoacid.mmp",
               "asp_l_aminoacid.mmp",
               "cys_l_aminoacid.mmp",
               "gln_l_aminoacid.mmp",
               "glu_l_aminoacid.mmp",
               "gly_l_aminoacid.mmp",
               "his_l_aminoacid.mmp",
               "ile_l_aminoacid.mmp",
               "leu_l_aminoacid.mmp",
               "lys_l_aminoacid.mmp",
               "met_l_aminoacid.mmp",
               "phe_l_aminoacid.mmp",
               "pro_l_aminoacid.mmp",
               "ser_l_aminoacid.mmp",
               "thr_l_aminoacid.mmp",
               "tyr_l_aminoacid.mmp",
               "val_l_aminoacid.mmp")

for df in damianFiles:
    prefix = df[:df.index(".")]
    testPrefix = "test_" + prefix
    damianMmp = MmpFile.MmpFile()
    damianMmp.read(df)

    # Generate the xyzcmp file
    xyzcmpFilename = testPrefix + ".xyzcmp"
    outf = open(xyzcmpFilename, "w")
    xyzcmp = damianMmp.convertToXyz()
    xyzcmp.write(df, outf)
    outf.close()

    # Make a perturbed copy of the MMP, use it for test_{foo}.mmp
    dmClone = damianMmp.clone()
    dmClone.perturb()
    testMmpFilename = testPrefix + ".mmp"
    outf = open(testMmpFilename, "w")
    dmClone.write(outf)
    outf.close()

    # Create test_{foo}.test
    testTestFilename = testPrefix + ".test"
    outf = open(testTestFilename, "w")
    outf.write("TYPE struct\n")
    outf.close()

    print "Test input files generated for " + testPrefix