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

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

      1  # Details about the tests for AVACF.
      2  #COULD NOT BE TESTED:
      3  #       -projection vector -> bad implementation in nMOLDYN 2.2.5. So, always set to None
      4  #       -differentiation -> bad implementation in nMOLDYN 2.2.5: always the default differentiation order that is considered i.e. 'fast'. So, always set to fast.
      5  #       -massWeighting -> There is no mass weighting in version 2.2.5. So always set to False in 5.0.0.
      6  #       -groups = [{'Protein.0 All': ['*']}] VS parameters['group'] = {0: [['Protein', '', ['all']]]}
      7  #       -> different implementations in nMOLDYN 2.2.5 and 5.0.0. In 2.2.5, this option takes the whole protein as a single unit whereas in version 5.0.0, it
      8  #       splits the protein into a set of residus.
      9  #       -groups = [{'Protein.0 SideChain': ['*']}] VS parameters['group'] = {0: [['Protein', '', ['sidechains']]]}
     10  #       -> different implementations in nMOLDYN 2.2.5 and 5.0.0. In 2.2.5, this option does not take only the residues sidechains but the whole residues whereas in
     11  #       5.0.0 it actually takes only the sidechains.
     12  #       -So, groups = [{'Protein.0 SideChain': ['*']}] can be compared with parameters['group'] = {0: [['Protein', '', ['all']]]} -> test 7.
     13
     14  from tempfile import mktemp
     15  import os
     16  from MMTK import Units
     17
     18  # TEMPLATES FOR REFERENCE AND NEW VERSIONS INPUT FILES.
     19  template = {'REF' : {}, 'NEW' : {}}
     20
     21  template['REF']['title'] = 'Angular Velocity Autocorrelation Function'
     22  template['REF']['trajectory'] = ['../TrajectoryTest1.nc']
     23  template['REF']['log_file'] = 'logfile.log'
     24  template['REF']['output_files'] = {'avacf' : 'test.plot'}
     25  template['REF']['projection_vector'] = None
     26  template['REF']['differentiation'] = 'fast'
     27  template['REF']['time_steps'] = None
     28
     29  template['NEW']['projection'] = None
     30  template['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest1.nc')
     31  template['NEW']['avacf'] = mktemp(suffix = '_AVACF.nc', prefix = 'nMOLDYN_')
     32  template['NEW']['differentiation'] = 1
     33  template['NEW']['stepwiserbt'] = 'No'
     34  template['NEW']['pyroserver'] = 'No'
     35  template['NEW']['analysis'] = 'AngularVelocityAutoCorrelationFunction_serial(self.testParameters)'
     36
     37  test = []
     38
     39  # Test1
     40  test.append({'REF' : {}, 'NEW' : {}})
     41  # PARAMETERS FOR REFERENCE VERSION.
     42  test[-1]['REF']['time_info'] = (0, 19, 1)
     43  test[-1]['REF']['groups'] = [{'Protein.0 BackBone': ['*']}]
     44  test[-1]['REF']['reference'] = [{'Protein.0 BackBone': {'*': None}}]
     45
     46
     47  # PARAMETERS FOR NEW VERSION.
     48  test[-1]['NEW']['timeinfo'] = '1:19:1'
     49  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 misc backbone'
     50  test[-1]['NEW']['referenceframe'] = 1
     51
     52
     53  # Test2
     54  test.append({'REF' : {}, 'NEW' : {}})
     55  # PARAMETERS FOR REFERENCE VERSION.
     56  test[-1]['REF']['time_info'] = (0, 49, 4)
     57  test[-1]['REF']['groups'] = [{'Protein.0 Methyl': ['*']}]
     58  test[-1]['REF']['reference'] = [{'Protein.0 Methyl': {'*': None}}]
     59
     60  # PARAMETERS FOR NEW VERSION.
     61  test[-1]['NEW']['timeinfo'] = '1:49:4'
     62  test[-1]['NEW']['group'] = 'group1 groupinglevel methyl objectname P892 chemfragment methyl'
     63  test[-1]['NEW']['referenceframe'] = 1
     64
     65
     66  # Test3
     67  test.append({'REF' : {}, 'NEW' : {}})
     68  # PARAMETERS FOR REFERENCE VERSION.
     69  test[-1]['REF']['time_info'] = (8, 29, 2)
     70  test[-1]['REF']['groups'] = [{'Protein.0 Methyl': ['*']}]
     71  test[-1]['REF']['reference'] = [{'Protein.0 Methyl': {'*': None}}]
     72
     73  # PARAMETERS FOR NEW VERSION.
     74  test[-1]['NEW']['timeinfo'] = '9:29:2'
     75  test[-1]['NEW']['group'] = 'group1 groupinglevel methyl objectname P892 chemfragment methyl'
     76  test[-1]['NEW']['referenceframe'] = 9
     77
     78
     79  # Test4
     80  test.append({'REF' : {}, 'NEW' : {}})
     81  # PARAMETERS FOR REFERENCE VERSION.
     82  test[-1]['REF']['time_info'] = (16, 39, 4)
     83  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['alanine',\
     84                                                        'glycine',\
     85                                                        'proline',\
     86                                                        'glutamine',\
     87                                                        'arginine',\
     88                                                        'glutamic_acid',\
     89                                                        'leucine',\
     90                                                        'serine',\
     91                                                        'valine',\
     92                                                        'methionine',\
     93                                                        'isoleucine',\
     94                                                        'asparagine',\
     95                                                        'phenylalanine',\
     96                                                        'threonine',\
     97                                                        'tyrosine']}]
     98  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'alanine': None, 'glycine': None, 'proline': None, 'glutamine': None, 'arginine': None, 'glutamic_acid': None, 'leucine': None, 'serine': None, 'valine': None, 'methionine': None, 'isoleucine': None, 'asparagine': None, 'phenylalanine': None, 'threonine': None, 'tyrosine': None}}]
     99
    100  # PARAMETERS FOR NEW VERSION.
    101  test[-1]['NEW']['timeinfo'] = '17:39:4'
    102  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Ala,Gly,Pro,Gln,Arg,Glu,Leu,Ser,Val,Met,Ile,Asn,Phe,Thr,Tyr'
    103  test[-1]['NEW']['referenceframe'] = 17
    104
    105  # Test5
    106  test.append({'REF' : {}, 'NEW' : {}})
    107  # PARAMETERS FOR REFERENCE VERSION.
    108  test[-1]['REF']['time_info'] = (1, 20, 2)
    109  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['aspartic_acid']}]
    110  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'aspartic_acid': None}}]
    111
    112  # PARAMETERS FOR NEW VERSION.
    113  test[-1]['NEW']['timeinfo'] = '2:20:2'
    114  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Asp'
    115  test[-1]['NEW']['referenceframe'] = 2
    116
    117  # Test6
    118  test.append({'REF' : {}, 'NEW' : {}})
    119  # PARAMETERS FOR REFERENCE VERSION.
    120  test[-1]['REF']['time_info'] = (1, 20, 2)
    121  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['aspartic_acid']}]
    122  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'aspartic_acid': None}}]
    123
    124  # PARAMETERS FOR NEW VERSION.
    125  test[-1]['NEW']['timeinfo'] = "2:20:2"
    126  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Asp'
    127  test[-1]['NEW']['referenceframe'] = 2
    128
    129  # Test7
    130  test.append({'REF' : {}, 'NEW' : {}})
    131  # PARAMETERS FOR REFERENCE VERSION.
    132  test[-1]['REF']['time_info'] = (1, 20, 2)
    133  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['valine']}]
    134  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'valine': None}}]
    135
    136  # PARAMETERS FOR NEW VERSION.
    137  test[-1]['NEW']['timeinfo'] = "2:20:2"
    138  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Val'
    139  test[-1]['NEW']['referenceframe'] = 2
    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']['groups'] = [{'Protein.0 SideChain': ['valine']}]
    147  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'valine': None}}]
    148
    149  # PARAMETERS FOR NEW VERSION.
    150  test[-1]['NEW']['timeinfo'] = "2:20:2"
    151  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Val'
    152  test[-1]['NEW']['referenceframe'] = 2
    153
    154
    155  # Test9
    156  test.append({'REF' : {}, 'NEW' : {}})
    157  # PARAMETERS FOR REFERENCE VERSION.
    158  test[-1]['REF']['time_info'] = (1, 28, 2)
    159  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['alanine']}]
    160  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'alanine': None}}]
    161
    162  # PARAMETERS FOR NEW VERSION.
    163  test[-1]['NEW']['timeinfo'] = "2:28:2"
    164  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Ala'
    165  test[-1]['NEW']['referenceframe'] = 2
    166
    167
    168  # Test10
    169  test.append({'REF' : {}, 'NEW' : {}})
    170  # PARAMETERS FOR REFERENCE VERSION.
    171  test[-1]['REF']['time_info'] = (1, 33, 2)
    172  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['proline','glutamine','glutamic_acid']}]
    173  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'proline': None,'glutamine': None,'glutamic_acid': None}}]
    174
    175  # PARAMETERS FOR NEW VERSION.
    176  test[-1]['NEW']['timeinfo'] = "2:33:2"
    177  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Pro,Gln,Glu'
    178  test[-1]['NEW']['referenceframe'] = 2
    179
    180
    181  # Test11
    182  test.append({'REF' : {}, 'NEW' : {}})
    183  # PARAMETERS FOR REFERENCE VERSION.
    184  test[-1]['REF']['time_info'] = (1, 20, 2)
    185  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['lysine','glycine','arginine']}]
    186  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'lysine': None,'glycine': None,'arginine': None}}]
    187
    188  # PARAMETERS FOR NEW VERSION.
    189  test[-1]['NEW']['timeinfo'] = "2:20:2"
    190  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Lys,Gly,Arg'
    191  test[-1]['NEW']['referenceframe'] = 2
    192
    193
    194  # Test12
    195  test.append({'REF' : {}, 'NEW' : {}})
    196  # PARAMETERS FOR REFERENCE VERSION.
    197  test[-1]['REF']['time_info'] = (1, 40, 2)
    198  test[-1]['REF']['groups'] = [{'Protein.0 SideChain': ['leucine','methionine']}]
    199  test[-1]['REF']['reference'] = [{'Protein.0 SideChain': {'leucine': None,'methionine': None}}]
    200
    201  # PARAMETERS FOR NEW VERSION.
    202  test[-1]['NEW']['timeinfo'] = "2:40:2"
    203  test[-1]['NEW']['group'] = 'group1 groupinglevel residue objectname P892 restype Leu,Met'
    204  test[-1]['NEW']['referenceframe'] = 2
    205
    206
    207  # Test13
    208  test.append({'REF' : {}, 'NEW' : {}})
    209  # PARAMETERS FOR REFERENCE VERSION.
    210  test[-1]['REF']['trajectory'] = ['../TrajectoryTest3.nc']
    211  test[-1]['REF']['time_info'] = (3, 20, 2)
    212  test[-1]['REF']['groups'] = [{'Water': ['*']}]
    213  test[-1]['REF']['reference'] = [{'Water': {'*': None}}]
    214
    215  # PARAMETERS FOR NEW VERSION.
    216  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest3.nc')
    217  test[-1]['NEW']['timeinfo'] = "4:20:2"
    218  test[-1]['NEW']['group'] = 'group1 groupinglevel cluster objectname AC3 atomelement *'
    219  test[-1]['NEW']['referenceframe'] = 4
    220
    221
    222  # Test14
    223  test.append({'REF' : {}, 'NEW' : {}})
    224  # PARAMETERS FOR REFERENCE VERSION.
    225  test[-1]['REF']['trajectory'] = ['../TrajectoryTest3.nc']
    226  test[-1]['REF']['time_info'] = (1, 45, 3)
    227  test[-1]['REF']['groups'] = [{'Water': ['*']}]
    228  test[-1]['REF']['reference'] = [{'Water': {'*': None}}]
    229
    230  # PARAMETERS FOR NEW VERSION.
    231  test[-1]['NEW']['trajectory'] = os.path.join(nmoldyn_package_path, 'Tests', 'TrajectoryTest3.nc')
    232  test[-1]['NEW']['timeinfo'] = "2:45:3"
    233  test[-1]['NEW']['group'] = 'group1 groupinglevel cluster objectname AC3 atomelement *'
    234  test[-1]['NEW']['referenceframe'] = 2
    235