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

# Source Code for Module nMOLDYN.Tests.DOS.TestsContents

      1  # Details about the tests for DOS.
      2  # COULD NOT BE TESTED:
      3  #       -projection vector -> bad implementation in nMOLDYN 2.2.5
      4  #       -units_length -> bug in nMOLDYN 2.2.5: No length unit conversion on the DOS. So, always set to nm
      5  #       -units_length always set to Units.nm because this is the only length unit available in new version
      6  #       -units_frequency always set to Units.THz because this is the only frequency 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'] = 'Density Of States'
     20  template['REF']['log_file'] = 'logfile.log'
     21  template['REF']['output_files'] = {'dos': 'test.plot'}
     22  template['REF']['projection_vector'] = None
     23  template['REF']['units_length'] = Units.nm
     24  template['REF']['units_frequency'] = 1/Units.ps
     25  template['REF']['frequency_points'] = 1000000
     26
     27  template['NEW']['pyroserver'] = 'NO'
     28  template['NEW']['projection'] = None
     29  template['NEW']['dos'] = mktemp(suffix = '_DOS.nc', prefix = 'nMOLDYN_')
     30  template['NEW']['analysis'] = 'CartesianDensityOfStates_serial(self.testParameters)'
     31
     32  test = []
     33
     34  # Test1
     35  test.append({'REF' : {}, 'NEW' : {}})
     36  # PARAMETERS FOR REFERENCE VERSION.
     37  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
     38  test[-1]['REF']['time_info'] = (0, 49, 1)
     39  test[-1]['REF']['weights'] = "mass"
     40  test[-1]['REF']['atoms_pdb'] = '../TrajectoryTest1_2.pdb'
     41  test[-1]['REF']['deuter'] = None
     42  test[-1]['REF']['ft_window'] = 20.0
     43
     44  # PARAMETERS FOR NEW VERSION.
     45  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
     46  test[-1]['NEW']['timeinfo'] = '1:49:1'
     47  test[-1]['NEW']['weights'] = 'mass'
     48  test[-1]['NEW']['subset'] = 'filename %s' % os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1_2.nms')
     49  test[-1]['NEW']['deuteration'] = None
     50  test[-1]['NEW']['differentiation'] = 0
     51  test[-1]['NEW']['fftwindow'] = 100./20.0
     52
     53
     54  # Test2
     55  test.append({'REF' : {}, 'NEW' : {}})
     56  # PARAMETERS FOR REFERENCE VERSION.
     57  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
     58  test[-1]['REF']['time_info'] = (0, 49, 4)
     59  test[-1]['REF']['weights'] = "none"
     60  test[-1]['REF']['atoms'] = {'Protein.0': ["BackBone"]}
     61  test[-1]['REF']['deuter'] = None
     62  test[-1]['REF']['ft_window'] = 10.0
     63
     64  # PARAMETERS FOR NEW VERSION.
     65  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
     66  test[-1]['NEW']['timeinfo'] = '1:49:4'
     67  test[-1]['NEW']['weights'] = 'equal'
     68  test[-1]['NEW']['subset'] = 'objectname P892 misc backbone'
     69  test[-1]['NEW']['deuteration'] = None
     70  test[-1]['NEW']['differentiation'] = 0
     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']['trajectory'] = ['../TrajectoryTest1.nc']
     78  test[-1]['REF']['time_info'] = (8, 29, 2)
     79  test[-1]['REF']['weights'] = 'none'
     80  test[-1]['REF']['atoms'] = {'Protein.0': ['Methyl']}
     81  test[-1]['REF']['deuter'] = None
     82  test[-1]['REF']['ft_window'] = 5.0
     83
     84  # PARAMETERS FOR NEW VERSION.
     85  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
     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']['fftwindow'] = 100./5.0
     92
     93
     94  # Test4
     95  test.append({'REF' : {}, 'NEW' : {}})
     96  # PARAMETERS FOR REFERENCE VERSION.
     97  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
     98  test[-1]['REF']['time_info'] = (16, 39, 4)
     99  test[-1]['REF']['weights'] = 'none'
    100  test[-1]['REF']['atoms'] = {'Protein.0': ['*']}
    101  test[-1]['REF']['deuter'] = {'Protein.0': ['Methyl']}
    102  test[-1]['REF']['ft_window'] = 20.0
    103
    104  # PARAMETERS FOR NEW VERSION.
    105  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
    106  test[-1]['NEW']['timeinfo'] = '17:39:4'
    107  test[-1]['NEW']['weights'] = 'equal'
    108  test[-1]['NEW']['subset'] = 'objectname P892 chainname *'
    109  test[-1]['NEW']['deuteration'] = 'objectname P892 chemfragment methyl'
    110  test[-1]['NEW']['differentiation'] = 0
    111  test[-1]['NEW']['fftwindow'] = 100./20.0
    112
    113
    114  # Test5
    115  test.append({'REF' : {}, 'NEW' : {}})
    116  # PARAMETERS FOR REFERENCE VERSION.
    117  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
    118  test[-1]['REF']['time_info'] = (1, 20, 2)
    119  test[-1]['REF']['weights'] = 'none'
    120  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen','Nitrogen']}
    121  test[-1]['REF']['deuter'] = None
    122  test[-1]['REF']['ft_window'] = 4.0
    123
    124  # PARAMETERS FOR NEW VERSION.
    125  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
    126  test[-1]['NEW']['timeinfo'] = '2:20:2'
    127  test[-1]['NEW']['weights'] = 'equal'
    128  test[-1]['NEW']['subset'] = 'objectname P892 atomelement oxygen,nitrogen'
    129  test[-1]['NEW']['deuteration'] = None
    130  test[-1]['NEW']['differentiation'] = 0
    131  test[-1]['NEW']['fftwindow'] = 100./4.0
    132
    133
    134  # Test6
    135  test.append({'REF' : {}, 'NEW' : {}})
    136  # PARAMETERS FOR REFERENCE VERSION.
    137  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
    138  test[-1]['REF']['time_info'] = (1, 20, 2)
    139  test[-1]['REF']['weights'] = 'mass'
    140  test[-1]['REF']['atoms'] = {'Protein.0': ['Nitrogen']}
    141  test[-1]['REF']['deuter'] = None
    142  test[-1]['REF']['ft_window'] = 40.0
    143
    144  # PARAMETERS FOR NEW VERSION.
    145  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
    146  test[-1]['NEW']['timeinfo'] = "2:20:2"
    147  test[-1]['NEW']['weights'] = 'mass'
    148  test[-1]['NEW']['subset'] = 'objectname P892 atomelement nitrogen'
    149  test[-1]['NEW']['deuteration'] = None
    150  test[-1]['NEW']['differentiation'] = 0
    151  test[-1]['NEW']['fftwindow'] = 100./40.0
    152
    153
    154  # Test7
    155  test.append({'REF' : {}, 'NEW' : {}})
    156  # PARAMETERS FOR REFERENCE VERSION.
    157  test[-1]['REF']['trajectory'] = ['../TrajectoryTest1.nc']
    158  test[-1]['REF']['time_info'] = (1, 20, 2)
    159  test[-1]['REF']['weights'] = 'none'
    160  test[-1]['REF']['atoms'] = {'Protein.0': ['Carbon']}
    161  test[-1]['REF']['deuter'] = None
    162  test[-1]['REF']['ft_window'] = 20.0
    163
    164  # PARAMETERS FOR NEW VERSION.
    165  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
    166  test[-1]['NEW']['timeinfo'] = "2:20:2"
    167  test[-1]['NEW']['weights'] = 'equal'
    168  test[-1]['NEW']['subset'] = 'objectname P892 atomelement carbon'
    169  test[-1]['NEW']['deuteration'] = None
    170  test[-1]['NEW']['differentiation'] = 0
    171  test[-1]['NEW']['fftwindow'] = 100./20.0
    172
    173
    174  # Test8
    175  test.append({'REF' : {}, 'NEW' : {}})
    176  # PARAMETERS FOR REFERENCE VERSION.
    177  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    178  test[-1]['REF']['time_info'] = (1, 20, 2)
    179  test[-1]['REF']['weights'] = 'mass'
    180  test[-1]['REF']['atoms_pdb'] = '../TrajectoryTest2_1.pdb'
    181  test[-1]['REF']['deuter'] = None
    182  test[-1]['REF']['ft_window'] = 80.0
    183
    184  # PARAMETERS FOR NEW VERSION.
    185  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    186  test[-1]['NEW']['timeinfo'] = "2:20:2"
    187  test[-1]['NEW']['weights'] = 'mass'
    188  test[-1]['NEW']['subset'] = 'filename %s' % os.path.join(nmoldyn_package_path,"Tests",'TrajectoryTest2_1.nms')
    189  test[-1]['NEW']['deuteration'] = None
    190  test[-1]['NEW']['differentiation'] = 1
    191  test[-1]['NEW']['fftwindow'] = 100./80.0
    192
    193
    194  # Test9
    195  test.append({'REF' : {}, 'NEW' : {}})
    196  # PARAMETERS FOR REFERENCE VERSION.
    197  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    198  test[-1]['REF']['time_info'] = (1, 20, 1)
    199  test[-1]['REF']['weights'] = 'none'
    200  test[-1]['REF']['atoms'] = {'Protein.0': ['Hydrogen']}
    201  test[-1]['REF']['deuter'] = None
    202  test[-1]['REF']['ft_window'] = 4.0
    203
    204  # PARAMETERS FOR NEW VERSION.
    205  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    206  test[-1]['NEW']['timeinfo'] = "2:20:1"
    207  test[-1]['NEW']['weights'] = 'equal'
    208  test[-1]['NEW']['subset'] = 'objectname P1960 atomelement hydrogen'
    209  test[-1]['NEW']['deuteration'] = None
    210  test[-1]['NEW']['differentiation'] = 1
    211  test[-1]['NEW']['fftwindow'] = 100./4.0
    212
    213
    214  # Test10
    215  test.append({'REF' : {}, 'NEW' : {}})
    216  # PARAMETERS FOR REFERENCE VERSION.
    217  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    218  test[-1]['REF']['time_info'] = (1, 20, 2)
    219  test[-1]['REF']['weights'] = 'none'
    220  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']}
    221  test[-1]['REF']['deuter'] = {'Protein.0': ['Hydrogen']}
    222  test[-1]['REF']['ft_window'] = 20.0
    223
    224  # PARAMETERS FOR NEW VERSION.
    225  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    226  test[-1]['NEW']['timeinfo'] = "2:20:2"
    227  test[-1]['NEW']['weights'] = 'equal'
    228  test[-1]['NEW']['subset'] = 'objectname P1960 misc sidechains'
    229  test[-1]['NEW']['deuteration'] = 'objectname P1960 atomelement hydrogen'
    230  test[-1]['NEW']['differentiation'] = 1
    231  test[-1]['NEW']['fftwindow'] = 100./20.0
    232
    233
    234  # Test11
    235  test.append({'REF' : {}, 'NEW' : {}})
    236  # PARAMETERS FOR REFERENCE VERSION.
    237  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    238  test[-1]['REF']['time_info'] = (1, 20, 2)
    239  test[-1]['REF']['weights'] = 'none'
    240  test[-1]['REF']['atoms'] = {'Protein.0': ['SideChain']}
    241  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']}
    242  test[-1]['REF']['ft_window'] = 10.0
    243
    244  # PARAMETERS FOR NEW VERSION.
    245  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    246  test[-1]['NEW']['timeinfo'] = "2:20:2"
    247  test[-1]['NEW']['weights'] = 'equal'
    248  test[-1]['NEW']['subset'] = 'objectname P1960 misc sidechains'
    249  test[-1]['NEW']['deuteration'] = 'objectname P1960 misc sidechains'
    250  test[-1]['NEW']['differentiation'] = 1
    251  test[-1]['NEW']['fftwindow'] = 100./10.0
    252
    253
    254  # Test12
    255  test.append({'REF' : {}, 'NEW' : {}})
    256  # PARAMETERS FOR REFERENCE VERSION.
    257  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    258  test[-1]['REF']['time_info'] = (1, 20, 2)
    259  test[-1]['REF']['weights'] = 'none'
    260  test[-1]['REF']['atoms'] = {'Protein.0': ['BackBone','SideChain']}
    261  test[-1]['REF']['deuter'] = {'Protein.0': ['SideChain']}
    262  test[-1]['REF']['ft_window'] = 20.0
    263
    264  # PARAMETERS FOR NEW VERSION.
    265  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    266  test[-1]['NEW']['timeinfo'] = "2:20:2"
    267  test[-1]['NEW']['weights'] = 'equal'
    268  test[-1]['NEW']['subset'] = 'objectname P1960 misc backbone,sidechains'
    269  test[-1]['NEW']['deuteration'] = 'objectname P1960 misc sidechains'
    270  test[-1]['NEW']['differentiation'] = 1
    271  test[-1]['NEW']['fftwindow'] = 100./20.0
    272
    273
    274  # Test13
    275  test.append({'REF' : {}, 'NEW' : {}})
    276  # PARAMETERS FOR REFERENCE VERSION.
    277  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    278  test[-1]['REF']['time_info'] = (1, 20, 2)
    279  test[-1]['REF']['weights'] = 'none'
    280  test[-1]['REF']['atoms'] = {'Protein.0': ['Oxygen', 'Nitrogen', 'Carbon', 'Hydrogen']}
    281  test[-1]['REF']['deuter'] = {'Protein.0': ['BackBone']}
    282  test[-1]['REF']['ft_window'] = 20.0
    283
    284  # PARAMETERS FOR NEW VERSION.
    285  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    286  test[-1]['NEW']['timeinfo'] = "2:20:2"
    287  test[-1]['NEW']['weights'] = 'equal'
    288  test[-1]['NEW']['subset'] = 'objectname P1960 atomelement carbon,nitrogen,oxygen,hydrogen'
    289  test[-1]['NEW']['deuteration'] = 'objectname P1960 misc backbone'
    290  test[-1]['NEW']['differentiation'] = 1
    291  test[-1]['NEW']['fftwindow'] = 100./20.0
    292
    293
    294  # Test14
    295  test.append({'REF' : {}, 'NEW' : {}})
    296  # PARAMETERS FOR REFERENCE VERSION.
    297  test[-1]['REF']['trajectory'] = ['../TrajectoryTest2.nc']
    298  test[-1]['REF']['time_info'] = (1, 40, 2)
    299  test[-1]['REF']['weights'] = 'none'
    300  test[-1]['REF']['atoms'] = {'Protein.0': ['C_alpha']}
    301  test[-1]['REF']['deuter'] = None
    302  test[-1]['REF']['ft_window'] = 12.0
    303
    304  # PARAMETERS FOR NEW VERSION.
    305  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest2.nc')
    306  test[-1]['NEW']['timeinfo'] = "2:40:2"
    307  test[-1]['NEW']['weights'] = 'equal'
    308  test[-1]['NEW']['subset'] = 'objectname P1960 chemfragment c_alphas'
    309  test[-1]['NEW']['deuteration'] = None
    310  test[-1]['NEW']['differentiation'] = 1
    311  test[-1]['NEW']['fftwindow'] = 100./12.0
    312