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

Source Code for Module nMOLDYN.Tests.MSD.TestsContents

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