|
5 | 5 |
|
6 | 6 | logger = logging.getLogger(__name__) |
7 | 7 |
|
8 | | -class IlluminaFastqHeader: |
9 | | - @classmethod |
10 | | - def parse(cls, s): |
11 | | - pieces = s.split(':') |
12 | | - if len(pieces) == 5: |
13 | | - device, flowcell_lane, tile, x, y = pieces |
14 | | - return cls(device, flowcell_lane=flowcell_lane, tile=tile, x=x, y=y) |
15 | | - elif len(pieces) == 7: |
16 | | - return cls(*pieces) |
17 | | - else: |
18 | | - raise TypeError('Unsupported Illumina FASTQ header format {}.'.format(s)) |
19 | | - |
20 | | - def __init__(self, device, run=None, flowcell=None, flowcell_lane=None, tile=None, x=None, y=None): |
21 | | - self.device = device |
22 | | - self.run = run |
23 | | - self.flowcell = flowcell |
24 | | - self.flowcell_lane = flowcell_lane |
25 | | - self.tile = tile |
26 | | - self.x = x |
27 | | - self.y = y |
28 | | - |
29 | | - @property |
30 | | - def batch_factor(self): |
31 | | - if self.flowcell is None: |
32 | | - return self.device, self.flowcell_lane |
33 | | - return self.device, self.flowcell, self.flowcell_lane |
34 | | - |
35 | | -def parse_illumina_fastq_header(s): |
36 | | - return IlluminaFastqHeader(*s.split(':')) |
37 | | - |
38 | 8 | def max_retry(count): |
39 | 9 | """ |
40 | 10 | Set the maximum number of time a task can be retried before being disabled |
@@ -68,15 +38,6 @@ def run(self): |
68 | 38 | def complete(self): |
69 | 39 | return (not self.rerun or self._has_rerun) and super().complete() |
70 | 40 |
|
71 | | -class CheckAfterCompleteMixin(luigi.Task): |
72 | | - """Ensures that a task is completed after a successful run().""" |
73 | | - |
74 | | - def run(self): |
75 | | - ret = super().run() |
76 | | - if not self.complete(): |
77 | | - raise RuntimeError('{} is not completed after successful run().'.format(repr(self))) |
78 | | - return ret |
79 | | - |
80 | 41 | def remove_task_output(task): |
81 | 42 | logger.info('Cleaning up %s...', repr(task)) |
82 | 43 | for out in flatten_output(task): |
|
0 commit comments