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

Source Code for Module nMOLDYN.Tests.VACF.TestsContents

  1  # Details about the tests for VACF. 
  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'] = 'Velocity Auto-Correlation Function' 
 20  template['REF']['trajectory'] = ['../TrajectoryTest1.nc'] 
 21  template['REF']['log_file'] = 'logfile.log' 
 22  template['REF']['output_files'] = {'vacf': 'test.plot'} 
 23  template['REF']['projection_vector'] = None 
 24  template['REF']['units_length'] = Units.nm 
 25   
 26  template['NEW']['projection'] = None 
 27  template['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc') 
 28  template['NEW']['vacf'] = mktemp(suffix = '_VACF.nc', prefix = 'nMOLDYN_') 
 29  template['NEW']['normalize'] = 'No' 
 30  template['NEW']['pyroserver'] = 'No' 
 31  template['NEW']['analysis'] = 'CartesianVelocityAutoCorrelationFunction_serial(self.testParameters)' 
 32   
 33  test = [] 
 34   
 35  # Test1 
 36  test.append({'REF' : {}, 'NEW' : {}}) 
 37   
 38  # PARAMETERS FOR REFERENCE VERSION. 
 39  test[-1]['REF']['time_info'] = (0, 49, 1) 
 40  test[-1]['REF']['weights'] = "mass" 
 41  test[-1]['REF']['atoms_pdb'] = '../TrajectoryTest1_2.pdb' 
 42  test[-1]['REF']['deuter'] = None 
 43   
 44  # PARAMETERS FOR NEW VERSION. 
 45  test[-1]['NEW']['timeinfo'] = '1:49:1' 
 46  test[-1]['NEW']['weights'] = 'mass' 
 47  test[-1]['NEW']['subset'] = 'filename %s' % os.path.join(nmoldyn_package_path,"Tests",'TrajectoryTest1_2.nms') 
 48  test[-1]['NEW']['deuteration'] = None 
 49  test[-1]['NEW']['differentiation'] = 0 
 50   
 51   
 52  # Test2 
 53  test.append({'REF' : {}, 'NEW' : {}}) 
 54  # PARAMETERS FOR REFERENCE VERSION. 
 55  test[-1]['REF']['time_info'] = (0, 49, 4) 
 56  test[-1]['REF']['weights'] = "none" 
 57  test[-1]['REF']['atoms'] = {'Protein.0': ["BackBone"]} 
 58  test[-1]['REF']['deuter'] = None 
 59   
 60  # PARAMETERS FOR NEW VERSION. 
 61  test[-1]['NEW']['timeinfo'] = '1:49:4' 
 62  test[-1]['NEW']['weights'] = 'equal' 
 63  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone' 
 64  test[-1]['NEW']['deuteration'] = None 
 65  test[-1]['NEW']['differentiation'] = 0 
 66   
 67   
 68  # Test3 
 69  test.append({'REF' : {}, 'NEW' : {}}) 
 70  # PARAMETERS FOR REFERENCE VERSION. 
 71  test[-1]['REF']['time_info'] = (8, 29, 2) 
 72  test[-1]['REF']['weights'] = 'none'  
 73  test[-1]['REF']['atoms'] = {'Protein.0': ['Methyl']} 
 74  test[-1]['REF']['deuter'] = None 
 75   
 76  # PARAMETERS FOR NEW VERSION. 
 77  test[-1]['NEW']['timeinfo'] = '9:29:2' 
 78  test[-1]['NEW']['weights'] = 'equal' 
 79  test[-1]['NEW']['subset'] = 'objectname P892 chemfragment methyl' 
 80  test[-1]['NEW']['deuteration'] = None 
 81  test[-1]['NEW']['differentiation'] = 0 
 82   
 83   
 84  # Test4 
 85  test.append({'REF' : {}, 'NEW' : {}}) 
 86  # PARAMETERS FOR REFERENCE VERSION. 
 87  test[-1]['REF']['time_info'] = (16, 39, 4) 
 88  test[-1]['REF']['weights'] = 'none'  
 89  test[-1]['REF']['atoms'] = {'Protein.0': ['*']} 
 90  test[-1]['REF']['deuter'] = {'Protein.0': ['Methyl']} 
 91   
 92  # PARAMETERS FOR NEW VERSION. 
 93  test[-1]['NEW']['timeinfo'] = '17:39:4' 
 94  test[-1]['NEW']['weights'] = 'equal' 
 95  test[-1]['NEW']['subset'] = 'objectname P892 chainname *' 
 96  test[-1]['NEW']['deuteration'] = 'objectname P892 chemfragment methyl' 
 97  test[-1]['NEW']['differentiation'] = 0 
 98   
 99   
100  # Test5 
101  test.append({'REF' : {}, 'NEW' : {}}) 
102  # PARAMETERS FOR REFERENCE VERSION. 
103  test[-1]['REF']['time_info'] = (1, 20, 2) 
104  test[-1]['REF']['weights'] = 'none'  
105  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen','Nitrogen']} 
106  test[-1]['REF']['deuter'] = None 
107   
108  # PARAMETERS FOR NEW VERSION. 
109  test[-1]['NEW']['timeinfo'] = '2:20:2' 
110  test[-1]['NEW']['weights'] = 'equal' 
111  test[-1]['NEW']['subset'] = 'objectname P892 atomelement oxygen,nitrogen' 
112  test[-1]['NEW']['deuteration'] = None 
113  test[-1]['NEW']['differentiation'] = 0 
114   
115   
116  # Test6 
117  test.append({'REF' : {}, 'NEW' : {}}) 
118  # PARAMETERS FOR REFERENCE VERSION. 
119  test[-1]['REF']['time_info'] = (1, 20, 2) 
120  test[-1]['REF']['weights'] = 'mass'  
121  test[-1]['REF']['atoms'] = {'Protein.0': ['Nitrogen']} 
122  test[-1]['REF']['deuter'] = None 
123   
124  # PARAMETERS FOR NEW VERSION. 
125  test[-1]['NEW']['timeinfo'] = "2:20:2" 
126  test[-1]['NEW']['weights'] = 'mass' 
127  test[-1]['NEW']['subset'] = 'objectname P892 atomelement nitrogen' 
128  test[-1]['NEW']['deuteration'] = None 
129  test[-1]['NEW']['differentiation'] = 0 
130   
131   
132  # Test7 
133  test.append({'REF' : {}, 'NEW' : {}}) 
134  # PARAMETERS FOR REFERENCE VERSION. 
135  test[-1]['REF']['time_info'] = (1, 20, 2) 
136  test[-1]['REF']['weights'] = 'none'  
137  test[-1]['REF']['atoms'] = {'Protein.0': ['Carbon']} 
138  test[-1]['REF']['deuter'] = None 
139   
140  # PARAMETERS FOR NEW VERSION. 
141  test[-1]['NEW']['timeinfo'] = "2:20:2" 
142  test[-1]['NEW']['weights'] = 'equal' 
143  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon' 
144  test[-1]['NEW']['deuteration'] = None 
145  test[-1]['NEW']['differentiation'] = 0 
146   
147   
148  # Test8 
149  test.append({'REF' : {}, 'NEW' : {}}) 
150  # PARAMETERS FOR REFERENCE VERSION. 
151  test[-1]['REF']['time_info'] = (1, 20, 2) 
152  test[-1]['REF']['weights'] = 'mass'  
153  test[-1]['REF']['atoms'] = {'Protein.0': ['Sulfur']} 
154  test[-1]['REF']['deuter'] = None 
155   
156  # PARAMETERS FOR NEW VERSION. 
157  test[-1]['NEW']['timeinfo'] = "2:20:2" 
158  test[-1]['NEW']['weights'] = 'mass' 
159  test[-1]['NEW']['subset'] = 'objectname P892 atomelement sulfur' 
160  test[-1]['NEW']['deuteration'] = None 
161  test[-1]['NEW']['differentiation'] = 1 
162   
163   
164  # Test9 
165  test.append({'REF' : {}, 'NEW' : {}}) 
166  # PARAMETERS FOR REFERENCE VERSION. 
167  test[-1]['REF']['time_info'] = (1, 20, 2) 
168  test[-1]['REF']['weights'] = 'none'  
169  test[-1]['REF']['atoms'] = {'Protein.0': ['Hydrogen']} 
170  test[-1]['REF']['deuter'] = None 
171   
172  # PARAMETERS FOR NEW VERSION. 
173  test[-1]['NEW']['timeinfo'] = "2:20:2" 
174  test[-1]['NEW']['weights'] = 'equal' 
175  test[-1]['NEW']['subset'] = 'objectname P892 atomelement hydrogen' 
176  test[-1]['NEW']['deuteration'] = None 
177  test[-1]['NEW']['differentiation'] = 1 
178   
179   
180  # Test10 
181  test.append({'REF' : {}, 'NEW' : {}}) 
182  # PARAMETERS FOR REFERENCE VERSION. 
183  test[-1]['REF']['time_info'] = (1, 20, 2) 
184  test[-1]['REF']['weights'] = 'none'  
185  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']} 
186  test[-1]['REF']['deuter'] = {'Protein.0': ['Hydrogen']} 
187   
188  # PARAMETERS FOR NEW VERSION. 
189  test[-1]['NEW']['timeinfo'] = "2:20:2" 
190  test[-1]['NEW']['weights'] = 'equal' 
191  test[-1]['NEW']['subset'] = 'objectname P892 misc sidechains' 
192  test[-1]['NEW']['deuteration'] = 'objectname P892 atomelement hydrogen' 
193  test[-1]['NEW']['differentiation'] = 1 
194   
195   
196  # Test11 
197  test.append({'REF' : {}, 'NEW' : {}}) 
198  # PARAMETERS FOR REFERENCE VERSION. 
199  test[-1]['REF']['time_info'] = (1, 20, 2) 
200  test[-1]['REF']['weights'] = 'none'  
201  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']} 
202  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']} 
203   
204  # PARAMETERS FOR NEW VERSION. 
205  test[-1]['NEW']['timeinfo'] = "2:20:2" 
206  test[-1]['NEW']['weights'] = 'equal' 
207  test[-1]['NEW']['subset'] = 'objectname P892 misc sidechains' 
208  test[-1]['NEW']['deuteration'] = 'objectname P892 misc sidechains' 
209  test[-1]['NEW']['differentiation'] = 1 
210   
211   
212  # Test12 
213  test.append({'REF' : {}, 'NEW' : {}}) 
214  # PARAMETERS FOR REFERENCE VERSION. 
215  test[-1]['REF']['time_info'] = (1, 20, 2) 
216  test[-1]['REF']['weights'] = 'none'  
217  test[-1]['REF']['atoms'] = {'Protein.0': ['BackBone','SideChain']} 
218  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']} 
219   
220  # PARAMETERS FOR NEW VERSION. 
221  test[-1]['NEW']['timeinfo'] = "2:20:2" 
222  test[-1]['NEW']['weights'] = 'equal' 
223  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone,sidechains' 
224  test[-1]['NEW']['deuteration'] = 'objectname P892 misc sidechains' 
225  test[-1]['NEW']['differentiation'] = 1 
226   
227   
228  # Test13 
229  test.append({'REF' : {}, 'NEW' : {}}) 
230  # PARAMETERS FOR REFERENCE VERSION. 
231  test[-1]['REF']['time_info'] = (1, 20, 2) 
232  test[-1]['REF']['weights'] = 'none'  
233  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen', 'Nitrogen', 'Carbon', 'Sulfur', 'Hydrogen']} 
234  test[-1]['REF']['deuter'] = {'Protein.0': ['BackBone']} 
235   
236  # PARAMETERS FOR NEW VERSION. 
237  test[-1]['NEW']['timeinfo'] = "2:20:2" 
238  test[-1]['NEW']['weights'] = 'equal' 
239  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon,nitrogen,oxygen,sulfur,hydrogen' 
240  test[-1]['NEW']['deuteration'] = 'objectname P892 misc backbone' 
241  test[-1]['NEW']['differentiation'] = 1 
242   
243   
244  # Test14 
245  test.append({'REF' : {}, 'NEW' : {}}) 
246  # PARAMETERS FOR REFERENCE VERSION. 
247  test[-1]['REF']['time_info'] = (1, 40, 2) 
248  test[-1]['REF']['weights'] = 'none'  
249  test[-1]['REF']['atoms'] = {'Protein.0': ['C_alpha']} 
250  test[-1]['REF']['deuter'] = None 
251   
252  # PARAMETERS FOR NEW VERSION. 
253  test[-1]['NEW']['timeinfo'] = "2:40:2" 
254  test[-1]['NEW']['weights'] = 'equal' 
255  test[-1]['NEW']['subset'] = 'objectname P892 chemfragment c_alphas' 
256  test[-1]['NEW']['deuteration'] = None 
257  test[-1]['NEW']['differentiation'] = 1 
258