Package nMOLDYN :: Package Tests :: Package EISF :: Module TestsContents
[hide private]
[frames] | no frames]

Source Code for Module nMOLDYN.Tests.EISF.TestsContents

  1  #Details about the tests for EISF. 
  2   
  3  #COULD NOT BE TESTED:  
  4  #       -units_q -> selectable via the GUI in 2.2.5 but does nothing actually. So, always set to '1/nm' in 5.0.0. 
  5  #       -atoms_pdb = nMOLDYN/Tests/REFERENCES/ProteinBPTI1.pdb -> NMOLDYN 2.2.5 DOES NOT CONSIDER CA MARKED ATOMS IN A PDB FILE 
  6  #       -atoms = {'Protein.0': ['Oxygen', 'SideChain', 'Nitrogen']} -> NMOLDYN 2.2.5 FINDS 46 ATOMS WHEREAS THE ACTUAL NUMBER IS 662 
  7  #       -atoms = {'Protein.0': ['BackBone', 'C_alpha']} -> NMOLDYN 2.2.5 FINDS 58 ATOMS WHEREAS THE ACTUAL NUMBER IS 347 
  8  #       -atoms = {'Protein.0': ['Methyl', 'SideChain', 'Carbon', 'C_alpha']} -> NMOLDYN 2.2.5 FINDS 286 WHEREAS THE ACTUAL NUMBER IS 661 
  9  from tempfile import mktemp 
 10  import os 
 11  from MMTK import Units 
 12   
 13  # TEMPLATES FOR REFERENCE AND NEW VERSIONS INPUT FILES. 
 14  template = {'REF' : {}, 'NEW' : {}} 
 15   
 16  template['REF']['title'] = 'Elastic Incoherent Scattering Function' 
 17  template['REF']['log_file'] = 'logfile.log' 
 18  template['REF']['output_files'] = {'eisf' : 'test.plot'} 
 19  template['REF']['trajectory'] = ['../TrajectoryTest1.nc'] 
 20  template['REF']['weights'] = 'incoherent' 
 21  template['REF']['units_q'] = 1/Units.nm  
 22   
 23   
 24  template['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc') 
 25  template['NEW']['weights'] = 'incoherent' 
 26  template['NEW']['eisf'] = mktemp(suffix = '_EISF.nc', prefix = 'nMOLDYN_') 
 27  template['NEW']['qVectorsGenerator'] = "3d isotropic" 
 28  template['NEW']['qVectorsDirection'] = None 
 29  template['NEW']['qVectorsPerShell'] = 500 
 30  template['NEW']['pyroserver'] = 'monoprocessor' 
 31  template['NEW']['analysis'] = 'ElasticIncoherentStructureFactor_serial(self.testParameters)' 
 32   
 33  test = [] 
 34   
 35  # Test1 
 36  test.append({'REF' : {}, 'NEW' : {}}) 
 37  # PARAMETERS FOR REFERENCE VERSION. 
 38  test[-1]['REF']['time_info'] = (0, 49, 1) 
 39  test[-1]['REF']['atoms_pdb'] = '../TrajectoryTest1_1.pdb' 
 40  test[-1]['REF']['deuter'] = None 
 41  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], 1.000000, 500, None)  
 42   
 43  # PARAMETERS FOR NEW VERSION. 
 44  test[-1]['NEW']['timeinfo'] = '1:49:1' 
 45  test[-1]['NEW']['subset'] = 'filename %s' % os.path.join(nmoldyn_package_path,"Tests",'TrajectoryTest1_1.nms') 
 46  test[-1]['NEW']['deuteration'] = None 
 47  test[-1]['NEW']['qShellValues'] = "3.:10.:1." 
 48  test[-1]['NEW']['qShellWidth'] = 1.0 
 49   
 50   
 51  # Test2 
 52  test.append({'REF' : {}, 'NEW' : {}}) 
 53  # PARAMETERS FOR REFERENCE VERSION. 
 54  test[-1]['REF']['time_info'] = (0, 19, 1) 
 55  test[-1]['REF']['atoms'] = {'Protein.0': ["BackBone"]} 
 56  test[-1]['REF']['deuter'] = None 
 57  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], 0.800000, 500, None)  
 58   
 59  # PARAMETERS FOR NEW VERSION. 
 60  test[-1]['NEW']['timeinfo'] = '1:19:1' 
 61  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone' 
 62  test[-1]['NEW']['deuteration'] = None 
 63  test[-1]['NEW']['qShellValues'] = "3.:10.:1.0" 
 64  test[-1]['NEW']['qShellWidth'] = 0.8 
 65   
 66   
 67  # Test3 
 68  test.append({'REF' : {}, 'NEW' : {}}) 
 69  # PARAMETERS FOR REFERENCE VERSION. 
 70  test[-1]['REF']['time_info'] = (0, 19, 2) 
 71  test[-1]['REF']['atoms'] = {'Protein.0': ['Methyl']} 
 72  test[-1]['REF']['deuter'] = None 
 73  test[-1]['REF']['q_vector_set'] = ([3.0, 5.0, 7.0, 9.0], 0.800000, 500, None)  
 74   
 75  # PARAMETERS FOR NEW VERSION. 
 76  test[-1]['NEW']['timeinfo'] = '1:19:2' 
 77  test[-1]['NEW']['subset'] = 'objectname P892 chemfragment methyl' 
 78  test[-1]['NEW']['deuteration'] = None 
 79  test[-1]['NEW']['qShellValues'] = "3.:9.:2.0" 
 80  test[-1]['NEW']['qShellWidth'] = 0.8 
 81   
 82   
 83  # Test4 
 84  test.append({'REF' : {}, 'NEW' : {}}) 
 85  # PARAMETERS FOR REFERENCE VERSION. 
 86  test[-1]['REF']['time_info'] = (0, 9, 1) 
 87  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen','Nitrogen']} 
 88  test[-1]['REF']['deuter'] = None 
 89  test[-1]['REF']['q_vector_set'] = ([4.0, 5.0, 6.0, 7.0, 8.0], 1.200000, 500, None)  
 90   
 91  # PARAMETERS FOR NEW VERSION. 
 92  test[-1]['NEW']['timeinfo'] = '1:9:1' 
 93  test[-1]['NEW']['subset'] = 'objectname P892 atomelement nitrogen,oxygen' 
 94  test[-1]['NEW']['deuteration'] = None 
 95  test[-1]['NEW']['qShellValues'] = "4.:8.:1.0" 
 96  test[-1]['NEW']['qShellWidth'] = 1.2 
 97   
 98   
 99  # Test5 
100  test.append({'REF' : {}, 'NEW' : {}}) 
101  # PARAMETERS FOR REFERENCE VERSION. 
102  test[-1]['REF']['time_info'] = (5, 29, 3) 
103  test[-1]['REF']['atoms'] = {'Protein.0': ['Hydrogen']} 
104  test[-1]['REF']['deuter'] = None 
105  test[-1]['REF']['q_vector_set'] = ([4.0, 5.0, 6.0, 7.0, 8.0, 9.0], 0.900000, 500, None)  
106   
107  # PARAMETERS FOR NEW VERSION. 
108  test[-1]['NEW']['timeinfo'] = '6:29:3' 
109  test[-1]['NEW']['subset'] = 'objectname P892 atomelement hydrogen' 
110  test[-1]['NEW']['deuteration'] = None 
111  test[-1]['NEW']['qShellValues'] = "4.:9.:1.0" 
112  test[-1]['NEW']['qShellWidth'] = 0.9 
113   
114   
115  # Test6 
116  test.append({'REF' : {}, 'NEW' : {}}) 
117  # PARAMETERS FOR REFERENCE VERSION. 
118  test[-1]['REF']['time_info'] = (4, 23, 2) 
119  test[-1]['REF']['atoms'] = {'Protein.0': ['*']} 
120  test[-1]['REF']['deuter'] = {'Protein.0': ['Methyl']} 
121  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 6.0, 7.0, 9.0], 1.00000, 500, None)  
122   
123  # PARAMETERS FOR NEW VERSION. 
124  test[-1]['NEW']['timeinfo'] = '5:23:2' 
125  test[-1]['NEW']['subset'] = None 
126  test[-1]['NEW']['deuteration'] = 'objectname P892 chemfragment methyl' 
127  test[-1]['NEW']['qShellValues'] = [3.0, 4.0, 6.0, 7.0, 9.0] 
128  test[-1]['NEW']['qShellWidth'] = 1.0 
129   
130   
131  # Test7 
132  test.append({'REF' : {}, 'NEW' : {}}) 
133  # PARAMETERS FOR REFERENCE VERSION. 
134  test[-1]['REF']['time_info'] = (0, 19, 1) 
135  test[-1]['REF']['atoms'] = {'Protein.0': ['Carbon']} 
136  test[-1]['REF']['deuter'] = None 
137  test[-1]['REF']['q_vector_set'] = ([4.0, 5.0, 6.0, 7.0, 8.0], 0.500000, 500, None)  
138   
139  # PARAMETERS FOR NEW VERSION. 
140  test[-1]['NEW']['timeinfo'] = '1:19:1' 
141  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon' 
142  test[-1]['NEW']['deuteration'] = None 
143  test[-1]['NEW']['qShellValues'] = "4.:8.:1.0" 
144  test[-1]['NEW']['qShellWidth'] = 0.5 
145   
146   
147  # Test8 
148  test.append({'REF' : {}, 'NEW' : {}}) 
149  # PARAMETERS FOR REFERENCE VERSION. 
150  test[-1]['REF']['time_info'] = (3, 39, 4) 
151  test[-1]['REF']['atoms'] = {'Protein.0': ['Sulfur']} 
152  test[-1]['REF']['deuter'] = None 
153  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 5.0, 6.0], 1.800000, 500, None)  
154   
155  # PARAMETERS FOR NEW VERSION. 
156  test[-1]['NEW']['timeinfo'] = '4:39:4' 
157  test[-1]['NEW']['subset'] = 'objectname P892 atomelement sulfur' 
158  test[-1]['NEW']['deuteration'] = None 
159  test[-1]['NEW']['qShellValues'] = "3.:6.:1.0" 
160  test[-1]['NEW']['qShellWidth'] = 1.8 
161   
162   
163  # Test9 
164  test.append({'REF' : {}, 'NEW' : {}}) 
165  # PARAMETERS FOR REFERENCE VERSION. 
166  test[-1]['REF']['time_info'] = (0, 19, 1) 
167  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']} 
168  test[-1]['REF']['deuter'] = {'Protein.0': ['Hydrogen']} 
169  test[-1]['REF']['q_vector_set'] = ([7.5, 8.5, 9.5], 0.800000, 500, None)  
170   
171  # PARAMETERS FOR NEW VERSION. 
172  test[-1]['NEW']['timeinfo'] = '1:19:1' 
173  test[-1]['NEW']['subset'] = 'objectname P892 misc sidechains' 
174  test[-1]['NEW']['deuteration'] = 'objectname P892 atomelement hydrogen' 
175  test[-1]['NEW']['qShellValues'] = "7.5:9.5:1.0" 
176  test[-1]['NEW']['qShellWidth'] = 0.8 
177   
178   
179  # Test10 
180  test.append({'REF' : {}, 'NEW' : {}}) 
181  # PARAMETERS FOR REFERENCE VERSION. 
182  test[-1]['REF']['time_info'] = (3, 30, 3) 
183  test[-1]['REF']['atoms'] = {'Protein.0': ['BackBone','SideChain']} 
184  test[-1]['REF']['deuter'] = None 
185  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 5.0, 6.0, 7.0], 1.500000, 500, None)  
186   
187  # PARAMETERS FOR NEW VERSION. 
188  test[-1]['NEW']['timeinfo'] = '4:30:3' 
189  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone,sidechains' 
190  test[-1]['NEW']['deuteration'] = None 
191  test[-1]['NEW']['qShellValues'] = "3.:7.:1.0" 
192  test[-1]['NEW']['qShellWidth'] = 1.5 
193   
194   
195  # Test11 
196  test.append({'REF' : {}, 'NEW' : {}}) 
197  # PARAMETERS FOR REFERENCE VERSION. 
198  test[-1]['REF']['time_info'] = (5, 19, 2) 
199  test[-1]['REF']['atoms'] = {'Protein.0': ['Hydrogen']} 
200  test[-1]['REF']['deuter'] = None 
201  test[-1]['REF']['q_vector_set'] = ([3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], 1.000000, 500, None)  
202   
203  # PARAMETERS FOR NEW VERSION. 
204  test[-1]['NEW']['timeinfo'] = '6:19:2' 
205  test[-1]['NEW']['subset'] = 'objectname P892 atomelement hydrogen' 
206  test[-1]['NEW']['deuteration'] = None 
207  test[-1]['NEW']['qShellValues'] = "3.:10.:1.0" 
208  test[-1]['NEW']['qShellWidth'] = 1.0 
209   
210   
211  # Test12 
212  test.append({'REF' : {}, 'NEW' : {}}) 
213  # PARAMETERS FOR REFERENCE VERSION. 
214  test[-1]['REF']['time_info'] = (0, 19, 1) 
215  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen', 'Nitrogen', 'Carbon', 'Sulfur', 'Hydrogen']} 
216  test[-1]['REF']['deuter'] = None 
217  test[-1]['REF']['q_vector_set'] = ([3.2, 4.2, 5.6, 6.4, 7.3], 0.600000, 500, None)  
218   
219  # PARAMETERS FOR NEW VERSION. 
220  test[-1]['NEW']['timeinfo'] = '1:19:1' 
221  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon,hydrogen,nitrogen,oxygen,sulfur' 
222  test[-1]['NEW']['deuteration'] = None 
223  test[-1]['NEW']['qShellValues'] = (3.2, 4.2, 5.6, 6.4, 7.3) 
224  test[-1]['NEW']['qShellWidth'] = 0.6 
225