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

Source Code for Module nMOLDYN.Tests.ARA.TestsContents

  1  # Details about the tests for ARA. 
  2  # COULD NOT BE TESTED: 
  3  #       -projection vector -> bad implementation in nMOLDYN 2.2.5 
  4  #       -time_steps -> bug in nMOLDYN 2.2.5 in vacf-vel case. So, always set to trajectory length. 
  5  #       -units_length -> bug in nMOLDYN 2.2.5: No length unit conversion on the VACF. So, always set to nm 
  6  #       -units_length always set to Units.nm because this is the only length unit available in new version  
  7  #       -atoms_pdb = nMOLDYN/Tests/REFERENCES/ProteinBPTI1.pdb -> NMOLDYN 2.2.5 DOES NOT CONSIDER CA MARKED ATOMS IN A PDB FILE 
  8  #       -atoms = {'Protein.0': ['Oxygen', 'SideChain', 'Nitrogen']} -> NMOLDYN 2.2.5 FINDS 46 ATOMS WHEREAS THE ACTUAL NUMBER IS 662 
  9  #       -atoms = {'Protein.0': ['BackBone', 'C_alpha']} -> NMOLDYN 2.2.5 FINDS 58 ATOMS WHEREAS THE ACTUAL NUMBER IS 347 
 10  #       -atoms = {'Protein.0': ['Methyl', 'SideChain', 'Carbon', 'C_alpha']} -> NMOLDYN 2.2.5 FINDS 286 WHEREAS THE ACTUAL NUMBER IS 661 
 11  #       -weights: when some deuteration is done the mass weighting scheme of nMOLDYN2.2.5 do not take into account the mass of the deuterium. 
 12  from tempfile import mktemp 
 13  import os 
 14  from MMTK import Units 
 15   
 16  # TEMPLATES FOR REFERENCE AND NEW VERSIONS INPUT FILES. 
 17  template = {'REF' : {}, 'NEW' : {}} 
 18   
 19  template['REF']['title'] = 'Autoregressive Model' 
 20  template['REF']['trajectory'] = ['../TrajectoryTest1.nc'] 
 21  template['REF']['log_file'] = 'logfile.log' 
 22  template['REF']['output_files'] = {'dos': 'testDOS.plot','msd' : 'testMSD.plot', 'vacf' : 'testVACF.plot', 'parameters' : 'testPARAMETERS.plot', 'memory' : 'testMEMORY.plot'} 
 23  template['REF']['projection_vector'] = None 
 24  template['REF']['ar_precision'] = None 
 25  template['REF']['units_length'] = Units.nm 
 26  template['REF']['units_frequency'] = 1/Units.ps 
 27  template['REF']['time_steps'] = None 
 28  template['REF']['frequency_points'] = None 
 29   
 30  template['NEW']['projection'] = None 
 31  template['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc') 
 32  template['NEW']['ara'] = mktemp(suffix = '_ARA.nc', prefix = 'nMOLDYN_') 
 33  template['NEW']['pyroserver'] = 'No' 
 34  template['NEW']['analysis'] = 'AutoRegressiveAnalysis_serial(self.testParameters)' 
 35   
 36  test = [] 
 37   
 38  # Test1 
 39  test.append({'REF' : {}, 'NEW' : {}}) 
 40   
 41  # PARAMETERS FOR REFERENCE VERSION. 
 42  test[-1]['REF']['time_info'] = (0, 19, 1) 
 43  test[-1]['REF']['weights'] = "mass" 
 44  test[-1]['REF']['atoms_pdb'] = '../TrajectoryTest1_2.pdb' 
 45  test[-1]['REF']['deuter'] = None 
 46  test[-1]['REF']['ar_order'] = 10 
 47   
 48   
 49  # PARAMETERS FOR NEW VERSION. 
 50  test[-1]['NEW']['timeinfo'] = '1:19:1' 
 51  test[-1]['NEW']['weights'] = 'mass' 
 52  test[-1]['NEW']['subset'] = 'filename %s' % os.path.join(nmoldyn_package_path,"Tests",'TrajectoryTest1_2.nms') 
 53  test[-1]['NEW']['deuteration'] = None 
 54  test[-1]['NEW']['differentiation'] = 0 
 55  test[-1]['NEW']['armodelorder'] = 10 
 56   
 57   
 58  # Test2 
 59  test.append({'REF' : {}, 'NEW' : {}}) 
 60  # PARAMETERS FOR REFERENCE VERSION. 
 61  test[-1]['REF']['time_info'] = (0, 49, 4) 
 62  test[-1]['REF']['weights'] = "none" 
 63  test[-1]['REF']['atoms'] = {'Protein.0': ["BackBone"]} 
 64  test[-1]['REF']['deuter'] = None 
 65  test[-1]['REF']['ar_order'] = 10 
 66   
 67  # PARAMETERS FOR NEW VERSION. 
 68  test[-1]['NEW']['timeinfo'] = '1:49:4' 
 69  test[-1]['NEW']['weights'] = 'equal' 
 70  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone' 
 71  test[-1]['NEW']['deuteration'] = None 
 72  test[-1]['NEW']['differentiation'] = 0 
 73  test[-1]['NEW']['armodelorder'] = 10 
 74   
 75   
 76  # Test3 
 77  test.append({'REF' : {}, 'NEW' : {}}) 
 78  # PARAMETERS FOR REFERENCE VERSION. 
 79  test[-1]['REF']['time_info'] = (8, 29, 2) 
 80  test[-1]['REF']['weights'] = 'none'  
 81  test[-1]['REF']['atoms'] = {'Protein.0': ['Methyl']} 
 82  test[-1]['REF']['deuter'] = None 
 83  test[-1]['REF']['ar_order'] = 6 
 84   
 85  # PARAMETERS FOR NEW VERSION. 
 86  test[-1]['NEW']['timeinfo'] = '9:29:2' 
 87  test[-1]['NEW']['weights'] = 'equal' 
 88  test[-1]['NEW']['subset'] = 'objectname P892 chemfragment methyl' 
 89  test[-1]['NEW']['deuteration'] = None 
 90  test[-1]['NEW']['differentiation'] = 0 
 91  test[-1]['NEW']['armodelorder'] = 6 
 92   
 93  # Test4 
 94  test.append({'REF' : {}, 'NEW' : {}}) 
 95  # PARAMETERS FOR REFERENCE VERSION. 
 96  test[-1]['REF']['time_info'] = (16, 39, 4) 
 97  test[-1]['REF']['weights'] = 'none'  
 98  test[-1]['REF']['atoms'] = {'Protein.0': ['*']} 
 99  test[-1]['REF']['deuter'] = {'Protein.0': ['Methyl']} 
100  test[-1]['REF']['ar_order'] = 5 
101   
102  # PARAMETERS FOR NEW VERSION. 
103  test[-1]['NEW']['timeinfo'] = '17:39:4' 
104  test[-1]['NEW']['weights'] = 'equal' 
105  test[-1]['NEW']['subset'] = 'objectname P892 chainname *' 
106  test[-1]['NEW']['deuteration'] = 'objectname P892 chemfragment methyl' 
107  test[-1]['NEW']['differentiation'] = 0 
108  test[-1]['NEW']['armodelorder'] = 5 
109   
110   
111  # Test5 
112  test.append({'REF' : {}, 'NEW' : {}}) 
113  # PARAMETERS FOR REFERENCE VERSION. 
114  test[-1]['REF']['time_info'] = (1, 20, 2) 
115  test[-1]['REF']['weights'] = 'none'  
116  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen','Nitrogen']} 
117  test[-1]['REF']['deuter'] = None 
118  test[-1]['REF']['ar_order'] = 8 
119   
120  # PARAMETERS FOR NEW VERSION. 
121  test[-1]['NEW']['timeinfo'] = '2:20:2' 
122  test[-1]['NEW']['weights'] = 'equal' 
123  test[-1]['NEW']['subset'] = 'objectname P892 atomelement oxygen,nitrogen' 
124  test[-1]['NEW']['deuteration'] = None 
125  test[-1]['NEW']['differentiation'] = 0 
126  test[-1]['NEW']['armodelorder'] = 8 
127   
128   
129  # Test6 
130  test.append({'REF' : {}, 'NEW' : {}}) 
131  # PARAMETERS FOR REFERENCE VERSION. 
132  test[-1]['REF']['time_info'] = (1, 20, 2) 
133  test[-1]['REF']['weights'] = 'mass'  
134  test[-1]['REF']['atoms'] = {'Protein.0': ['Nitrogen']} 
135  test[-1]['REF']['deuter'] = None 
136  test[-1]['REF']['ar_order'] = 7 
137   
138  # PARAMETERS FOR NEW VERSION. 
139  test[-1]['NEW']['timeinfo'] = "2:20:2" 
140  test[-1]['NEW']['weights'] = 'mass' 
141  test[-1]['NEW']['subset'] = 'objectname P892 atomelement nitrogen' 
142  test[-1]['NEW']['deuteration'] = None 
143  test[-1]['NEW']['differentiation'] = 0 
144  test[-1]['NEW']['armodelorder'] = 7 
145   
146   
147  # Test7 
148  test.append({'REF' : {}, 'NEW' : {}}) 
149  # PARAMETERS FOR REFERENCE VERSION. 
150  test[-1]['REF']['time_info'] = (1, 20, 2) 
151  test[-1]['REF']['weights'] = 'none'  
152  test[-1]['REF']['atoms'] = {'Protein.0': ['Carbon']} 
153  test[-1]['REF']['deuter'] = None 
154  test[-1]['REF']['ar_order'] = 5 
155   
156  # PARAMETERS FOR NEW VERSION. 
157  test[-1]['NEW']['timeinfo'] = "2:20:2" 
158  test[-1]['NEW']['weights'] = 'equal' 
159  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon' 
160  test[-1]['NEW']['deuteration'] = None 
161  test[-1]['NEW']['differentiation'] = 0 
162  test[-1]['NEW']['armodelorder'] = 5 
163   
164   
165  # Test8 
166  test.append({'REF' : {}, 'NEW' : {}}) 
167  # PARAMETERS FOR REFERENCE VERSION. 
168  test[-1]['REF']['time_info'] = (1, 20, 2) 
169  test[-1]['REF']['weights'] = 'mass'  
170  test[-1]['REF']['atoms'] = {'Protein.0': ['Sulfur']} 
171  test[-1]['REF']['deuter'] = None 
172  test[-1]['REF']['ar_order'] = 2 
173   
174  # PARAMETERS FOR NEW VERSION. 
175  test[-1]['NEW']['timeinfo'] = "2:20:2" 
176  test[-1]['NEW']['weights'] = 'mass' 
177  test[-1]['NEW']['subset'] = 'objectname P892 atomelement sulfur' 
178  test[-1]['NEW']['deuteration'] = None 
179  test[-1]['NEW']['differentiation'] = 1 
180  test[-1]['NEW']['armodelorder'] = 2 
181   
182   
183  # Test9 
184  test.append({'REF' : {}, 'NEW' : {}}) 
185  # PARAMETERS FOR REFERENCE VERSION. 
186  test[-1]['REF']['time_info'] = (1, 28, 2) 
187  test[-1]['REF']['weights'] = 'none'  
188  test[-1]['REF']['atoms'] = {'Protein.0': ['Hydrogen']} 
189  test[-1]['REF']['deuter'] = None 
190  test[-1]['REF']['ar_order'] = 11 
191   
192  # PARAMETERS FOR NEW VERSION. 
193  test[-1]['NEW']['timeinfo'] = "2:28:2" 
194  test[-1]['NEW']['weights'] = 'equal' 
195  test[-1]['NEW']['subset'] = 'objectname P892 atomelement hydrogen' 
196  test[-1]['NEW']['deuteration'] = None 
197  test[-1]['NEW']['differentiation'] = 1 
198  test[-1]['NEW']['armodelorder'] = 11 
199   
200   
201  # Test10 
202  test.append({'REF' : {}, 'NEW' : {}}) 
203  # PARAMETERS FOR REFERENCE VERSION. 
204  test[-1]['REF']['time_info'] = (1, 33, 2) 
205  test[-1]['REF']['weights'] = 'none'  
206  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']} 
207  test[-1]['REF']['deuter'] = {'Protein.0': ['Hydrogen']} 
208  test[-1]['REF']['ar_order'] = 12 
209   
210  # PARAMETERS FOR NEW VERSION. 
211  test[-1]['NEW']['timeinfo'] = "2:33:2" 
212  test[-1]['NEW']['weights'] = 'equal' 
213  test[-1]['NEW']['subset'] = 'objectname P892 misc sidechains' 
214  test[-1]['NEW']['deuteration'] = 'objectname P892 atomelement hydrogen' 
215  test[-1]['NEW']['differentiation'] = 1 
216  test[-1]['NEW']['armodelorder'] = 12 
217   
218   
219  # Test11 
220  test.append({'REF' : {}, 'NEW' : {}}) 
221  # PARAMETERS FOR REFERENCE VERSION. 
222  test[-1]['REF']['time_info'] = (1, 20, 2) 
223  test[-1]['REF']['weights'] = 'none'  
224  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']} 
225  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']} 
226  test[-1]['REF']['ar_order'] = 9 
227   
228  # PARAMETERS FOR NEW VERSION. 
229  test[-1]['NEW']['timeinfo'] = "2:20:2" 
230  test[-1]['NEW']['weights'] = 'equal' 
231  test[-1]['NEW']['subset'] = 'objectname P892 misc sidechains' 
232  test[-1]['NEW']['deuteration'] = 'objectname P892 misc sidechains' 
233  test[-1]['NEW']['differentiation'] = 1 
234  test[-1]['NEW']['armodelorder'] = 9 
235   
236   
237  # Test12 
238  test.append({'REF' : {}, 'NEW' : {}}) 
239  # PARAMETERS FOR REFERENCE VERSION. 
240  test[-1]['REF']['time_info'] = (1, 40, 2) 
241  test[-1]['REF']['weights'] = 'none'  
242  test[-1]['REF']['atoms'] = {'Protein.0': ['BackBone','SideChain']} 
243  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']} 
244  test[-1]['REF']['ar_order'] = 17 
245   
246  # PARAMETERS FOR NEW VERSION. 
247  test[-1]['NEW']['timeinfo'] = "2:40:2" 
248  test[-1]['NEW']['weights'] = 'equal' 
249  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone,sidechains' 
250  test[-1]['NEW']['deuteration'] = 'objectname P892 misc sidechains' 
251  test[-1]['NEW']['differentiation'] = 1 
252  test[-1]['NEW']['armodelorder'] = 17 
253   
254   
255  # Test13 
256  test.append({'REF' : {}, 'NEW' : {}}) 
257  # PARAMETERS FOR REFERENCE VERSION. 
258  test[-1]['REF']['trajectory'] = ['../TrajectoryTest3.nc'] 
259  test[-1]['REF']['time_info'] = (3, 20, 2) 
260  test[-1]['REF']['weights'] = 'none'  
261  test[-1]['REF']['atoms'] = {'Water': ['Oxygen', 'Hydrogen']} 
262  test[-1]['REF']['deuter'] = {'Water': ['Hydrogen']} 
263  test[-1]['REF']['ar_order'] = 4 
264   
265  # PARAMETERS FOR NEW VERSION. 
266  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest3.nc') 
267  test[-1]['NEW']['timeinfo'] = "4:20:2" 
268  test[-1]['NEW']['weights'] = 'equal' 
269  test[-1]['NEW']['subset'] = 'objectname AC3 atomelement oxygen,hydrogen' 
270  test[-1]['NEW']['deuteration'] = 'objectname AC3 atomelement hydrogen' 
271  test[-1]['NEW']['differentiation'] = 1 
272  test[-1]['NEW']['armodelorder'] = 4 
273   
274   
275  # Test14 
276  test.append({'REF' : {}, 'NEW' : {}}) 
277  # PARAMETERS FOR REFERENCE VERSION. 
278  test[-1]['REF']['trajectory'] = ['../TrajectoryTest3.nc'] 
279  test[-1]['REF']['time_info'] = (1, 45, 3) 
280  test[-1]['REF']['weights'] = 'none'  
281  test[-1]['REF']['atoms'] = {'Water': ['Oxygen']} 
282  test[-1]['REF']['deuter'] = None 
283  test[-1]['REF']['ar_order'] = 13 
284   
285  # PARAMETERS FOR NEW VERSION. 
286  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest3.nc') 
287  test[-1]['NEW']['timeinfo'] = "2:45:3" 
288  test[-1]['NEW']['weights'] = 'equal' 
289  test[-1]['NEW']['subset'] = 'objectname AC3 atomelement oxygen' 
290  test[-1]['NEW']['deuteration'] = None 
291  test[-1]['NEW']['differentiation'] = 1 
292  test[-1]['NEW']['armodelorder'] = 13 
293