+ added raw framework of workflow
[qpalma.git] / scripts / qpalma_pipeline.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # Written (W) 2008 Fabio De Bona
10 # Copyright (C) 2008 Max-Planck-Society
11
12 #
13 # This file contains the main interface to the QPalma pipeline.
14 #
15 #
16 #
17
18
19 from optparse import OptionParser
20
21 from qpalma.gridtools import ApproximationTask,PreprocessingTask
22 from qpalma.gridtools import AlignmentTask,PostprocessingTask
23
24 def create_option_parser():
25 parser = OptionParser()
26
27 #
28 parser.add_option("-ci", "--check_and_init", help="check configuration and initialize directories")
29
30 #
31 parser.add_option("-r", "--run", help="write report to FILE", metavar="FILE")
32
33 #
34 parser.add_option("-xx", "--clear", action="store_false", dest="verbose", help="cleanup directories delete all created data")
35
36 return parser
37
38
39
40
41 class System:
42 """
43 This class wraps the outer loop of the qpalma project
44
45 It is responsible for:
46
47 - loading and checking the config file(s)
48 - setting up the different pipeline modules
49 - run the experiment and report the results
50
51 """
52
53 def __init__(self):
54 """
55 """
56 parser = create_option_parser()
57 (options, args) = parser.parse_args()
58
59
60 def run(self):
61
62 # Before creating a candidate spliced read dataset we have to first filter
63 # the matches from the first seed finding run.
64
65 grid_heuristic()
66
67 # approx_task = ApproximationTask(...)
68 # approx_task.createJobs()
69 # approx_task.submit()
70 # approx_task.checkIfTaskFinished()
71
72 # After filtering combine the filtered matches from the first run and the
73 # found matches from the second run to a full dataset
74
75 createNewDataset
76
77 # pre_task = PreprocessingTask(...)
78 # pre_task.createJobs()
79 # pre_task.submit()
80
81 # Now that we have a dataset we can perform the accurate alignments for this
82 # data
83
84 grid_predict()
85
86 # align_task = AlignmentTask(...)
87 # align_task.createJobs()
88 # align_task.submit()
89
90 # The results of the above alignment step can be converted to a data format
91 # needed for further postprocessing
92
93 grid_alignment()
94
95 # post_task = PostprocessingTask(...)
96 # post_task.createJobs()
97 # post_task.submit()
98
99
100 if __name__ == '__main__':
101 system_obj = System()
102 system_obj.run()