3670dd74c58703aa3633eb598c7dd3748e4223cc
[qpalma.git] / scripts / qpalma_pipeline.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 #
5 # This file contains the main interface to the QPalma pipeline.
6 #
7 #
8 #
9
10
11 from optparse import OptionParser
12
13
14 from qpalma.gridtools import *
15
16
17 def create_option_parser():
18 parser = OptionParser()
19
20 #
21 parser.add_option("-ci", "--check_and_init", help="check configuration and initialize directories")
22
23 #
24 parser.add_option("-r", "--run", help="write report to FILE", metavar="FILE")
25
26 #
27 parser.add_option("-xx", "--clear", action="store_false", dest="verbose", help="cleanup directories delete all created data")
28
29 return parser
30
31
32
33
34 class System:
35 """
36 This class wraps the outer loop of the qpalma project
37
38 It is responsible for:
39
40 - loading and checking the config file(s)
41 - setting up the different pipeline modules
42 - run the experiment and report the results
43
44
45 """
46
47 # Before creating a candidate spliced read dataset we have to first filter
48 # the matches from the first seed finding run.
49
50 grid_heuristic()
51
52 # approx_task = ApproximationTask(...)
53 # approx_task.createJobs()
54 # approx_task.submit()
55 # approx_task.checkIfTaskFinished()
56
57 # After filtering combine the filtered matches from the first run and the
58 # found matches from the second run to a full dataset
59
60 createNewDataset
61
62 # pre_task = PreprocessingTask(...)
63 # pre_task.createJobs()
64 # pre_task.submit()
65
66 # Now that we have a dataset we can perform the accurate alignments for this
67 # data
68
69 grid_predict()
70
71 # align_task = AlignmentTask(...)
72 # align_task.createJobs()
73 # align_task.submit()
74
75 # The results of the above alignment step can be converted to a data format
76 # needed for further postprocessing
77
78 grid_alignment()
79
80 # post_task = PostprocessingTask(...)
81 # post_task.createJobs()
82 # post_task.submit()
83
84
85 if __name__ == '__main__':
86 parser = create_option_parser()
87 (options, args) = parser.parse_args()