MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / main

Function main

src/pyOpenMS/pyTOPP/pyTOPPExample.py:10–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def main():
11
12 # register command line arguments
13 model = CTDModel(
14 name='NameOfThePyTOPPTool', # required
15 version='1.0', # required
16 description='This is an example tool how to write pyTOPP tools compatible with the OpenMS workflow ecosystem.',
17 manual='RTF',
18 docurl='http://dummy.url/docurl.html',
19 category='Example',
20 executableName='exampletool',
21 executablePath='/path/to/exec/exampletool-1.0/exampletool'
22 )
23
24 # Register in / out etc. with CTDModel
25 model.add(
26 'input',
27 required=True,
28 type='input-file',
29 is_list=False,
30 file_formats=['mzML'], # filename restrictions
31 description='Input file'
32 )
33
34 model.add(
35 'output',
36 required=True,
37 type='output-file',
38 is_list=False,
39 file_formats=['mzML'], # filename restrictions
40 description='Output file'
41 )
42
43 defaults = pms.PeakPickerHiRes().getDefaults()
44
45 # expose algorithm parameters in command line options
46 addParamToCTDopts(defaults, model)
47
48 # parse command line
49 # if -write_ini is provided, store model in CTD file, exit with error code 0
50 # if -ini is provided, load CTD file into defaults Param object and return new model with paraneters set as defaults
51 arg_dict, openms_params = parseCTDCommandLine(sys.argv, model, defaults);
52
53 # data processing
54 fh = pms.MzMLFile()
55 fh.setLogType(pms.LogType.CMD)
56 input_map = pms.MSExperiment()
57
58 fh.load(arg_dict["input"], input_map)
59
60 pp = pms.PeakPickerHiRes()
61 pp.setParameters(openms_params)
62 out_map = pms.MSExperiment()
63 pp.pickExperiment(input_map, out_map)
64
65 out_map = addDataProcessing(out_map, openms_params, pms.DataProcessing.ProcessingAction.PEAK_PICKING)
66 fh = pms.FileHandler()
67 fh.storeExperiment(arg_dict["output"], out_map)

Callers 1

pyTOPPExample.pyFile · 0.70

Calls 13

pickExperimentMethod · 0.95
storeExperimentMethod · 0.95
addDataProcessingFunction · 0.90
addParamToCTDoptsFunction · 0.85
parseCTDCommandLineFunction · 0.85
getDefaultsMethod · 0.80
PeakPickerHiResMethod · 0.80
MzMLFileMethod · 0.80
setLogTypeMethod · 0.80
MSExperimentMethod · 0.80
setParametersMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected