bioluigi.tasks package

Submodules

bioluigi.tasks.bcftools module

bioluigi.tasks.cutadapt module

bioluigi.tasks.fastqc module

bioluigi.tasks.gatk module

bioluigi.tasks.multiqc module

bioluigi.tasks.rsem module

bioluigi.tasks.samtools module

bioluigi.tasks.sratoolkit module

bioluigi.tasks.star module

bioluigi.tasks.utils module

Collection of utilities and mixins for tasks

class bioluigi.tasks.utils.CreateTaskOutputDirectoriesBeforeRunMixin(*args, **kwargs)[source]

Bases: Task

Ensures that output directories exist before running the task.

run()[source]

The task run method, to be overridden in a subclass.

See Task.run

class bioluigi.tasks.utils.DynamicTaskWithOutputMixin(*args, **kwargs)[source]

Bases: Task

Extends a task to forward its dynamic dependencies as output.

output()[source]

The output that this Task produces.

The output of the Task determines if the Task needs to be run–the task is considered finished iff the outputs all exist. Subclasses should override this method to return a single Target or a list of Target instances.

Implementation note

If running multiple workers, the output must be a resource that is accessible by all workers, such as a DFS or database. Otherwise, workers might compute the same output since they don’t see the work done by other workers.

See Task.output

unpack_singleton = True
class bioluigi.tasks.utils.DynamicWrapperTask(*args, **kwargs)[source]

Bases: Task

Similar to luigi.task.WrapperTask but for dynamic dependencies yielded in the body of the run() method.

complete()[source]

If the task has any outputs, return True if all outputs exist. Otherwise, return False.

However, you may freely override this method with custom logic.

class bioluigi.tasks.utils.RemoveTaskOutputOnFailureMixin(*args, **kwargs)[source]

Bases: Task

Remove a task outputs on failure.

This only applies for output that have a defined ‘remove’ method.

on_failure(err)[source]

Override for custom error handling.

This method gets called if an exception is raised in run(). The returned value of this method is json encoded and sent to the scheduler as the expl argument. Its string representation will be used as the body of the error email sent out if any.

Default behavior is to return a string representation of the stack trace.

class bioluigi.tasks.utils.TaskWithMetadataMixin[source]

Bases: object

Mixin that adds an insignificant metadata parameter to a task.

metadata = Insignificant DictParameter (defaults to {})
class bioluigi.tasks.utils.TaskWithOutputMixin(*args, **kwargs)[source]

Bases: Task

Extends a luigi.WrapperTask to forward its dependencies as output.

output()[source]

The output that this Task produces.

The output of the Task determines if the Task needs to be run–the task is considered finished iff the outputs all exist. Subclasses should override this method to return a single Target or a list of Target instances.

Implementation note

If running multiple workers, the output must be a resource that is accessible by all workers, such as a DFS or database. Otherwise, workers might compute the same output since they don’t see the work done by other workers.

See Task.output

bioluigi.tasks.vep module

Module contents