コード例 #1
0
 def test_defaults(self):
     expected = dict(scenario=[
         {'type': 'phase1', 'steps': '2'},
         {'type': 'phase2', 'steps': '1'}
     ],
         ionisation_mode=1,
         ms_data_format='mzxml',
         ms_data_area='',
         ms_intensity_cutoff=0.0,
         msms_intensity_cutoff=5,
         mz_precision=5.0,
         mz_precision_abs=0.001,
         abs_peak_cutoff=5000,
         max_ms_level=10,
         precursor_mz_precision=0.005,
         max_broken_bonds=3,
         max_water_losses=1,
     )
     self.assertDictEqual(expected, JobQuery.defaults())
コード例 #2
0
 def test_defaults_example(self):
     example_tree = [
         '353.087494: 69989984 (',
         '    191.055756: 54674544 (',
         '        85.029587: 2596121,',
         '        93.034615: 1720164,',
         '        109.029442: 917026,',
         '        111.045067: 1104891 (',
         '            81.034691: 28070,',
         '            83.014069: 7618,',
         '            83.050339: 25471,',
         '            93.034599: 36300,',
         '            96.021790: 8453',
         '            ),',
         '        127.039917: 2890439 (',
         '            57.034718: 16911,',
         '            81.034706: 41459,',
         '            83.050301: 35131,',
         '            85.029533: 236887,',
         '            99.045074: 73742,',
         '            109.029404: 78094',
         '            ),',
         '        171.029587: 905226,',
         '        173.045212: 2285841 (',
         '            71.013992: 27805,',
         '            93.034569: 393710,',
         '            111.008629: 26219,',
         '            111.045029: 339595,',
         '            137.024292: 27668,',
         '            155.034653: 145773',
         '            ),',
         '        191.055725: 17000514',
         '        ),',
         '    353.087097: 4146696',
         '    )'
     ]
     expected = dict(ms_data="\n".join(example_tree),
                     ms_data_format='mass_tree',
                     ionisation_mode=-1,
                     )
     self.assertDictEqual(expected, JobQuery.defaults('example'))
コード例 #3
0
 def test_defaults_example2(self):
     example_tree = [
         'C16H17O9: 69989984 (',
         '    C7H11O6: 54674544 (',
         '        C4H5O2: 2596121,',
         '        C6H5O: 1720164,',
         '        C6H5O2: 917026,',
         '        C6H7O2: 1104891 (',
         '            C5H5O: 28070,',
         '            C4H3O2: 7618,',
         '            C5H7O: 25471,',
         '            C6H5O: 36300,',
         '            C5H4O2: 8453',
         '            ),',
         '        C6H7O3: 2890439 (',
         '            C3H5O: 16911,',
         '            C5H5O: 41459,',
         '            C5H7O: 35131,',
         '            C4H5O2: 236887,',
         '            C5H7O2: 73742,',
         '            C6H5O2: 78094',
         '            ),',
         '        C7H7O5: 905226,',
         '        C7H9O5: 2285841 (',
         '            C3H3O2: 27805,',
         '            C6H5O: 393710,',
         '            C5H3O3: 26219,',
         '            C6H7O2: 339595,',
         '            C7H5O3: 27668,',
         '            C7H7O4: 145773',
         '            ),',
         '        C7H11O6: 17000514',
         '        ),',
         '    C16H17O9: 4146696',
         '    )',
     ]
     expected = dict(ms_data="\n".join(example_tree),
                     ms_data_format='form_tree',
                     ionisation_mode=-1,
                     )
     self.assertDictEqual(expected, JobQuery.defaults('example2'))
コード例 #4
0
 def defaults(self):
     """Returns defaults settings to run a job"""
     selection = self.request.params.get('selection')
     return {'success': True, 'data': JobQuery.defaults(selection)}
コード例 #5
0
 def defaults(self):
     """Returns defaults settings to run a job"""
     selection = self.request.params.get('selection')
     return {'success': True,
             'data': JobQuery.defaults(selection)}