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

Source Code for Module nMOLDYN.Tests.DISF.TestsContents

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