Reusable and maintained Luigi tasks to incorporate in bioinformatics pipelines
Project description
Bioluigi
Reusable and maintained Luigi tasks to incorporate in bioinformatics pipelines
Features
Provides Luigi tasks for various bioinformatics tools and much more!
Provide ScheduledExternalProgramTask as an alternative to ExternalProgramTask from
the external_program contrib module
to make it work on modern scheduler such as Slurm or locally with Luigi resources.
Provides basic resource management for a local scheduler: all tasks are annotated with reasonable default cpus and
memory parameters that can be tuned and constrained via the [resources] configuration. In the case of externally
scheduled tasks, the resource management is deferred.
Provides a command-line interface for interacting more conveniently with Luigi scheduler.
bioluigi list [--status STATUS] [--user USER] [--detailed] TASK_GLOB
bioluigi show TASK_ID
Supported tools
Here's a list of supported tools:
- sratoolkit with
prefetchandfastq-dump - bcftools
- FastQC
- MultiQC
- RSEM
- STAR
- Cell Ranger
- Ensembl VEP
Schedulers
- local
- Slurm
Usage
You must set up a luigi.cfg configuration with some basic stuff such as resources, etc. Refer
to examples.luigi.cfg for some examples.
The most convenient way of using the pre-defined tasks is to yield them dynamically in the body of the run function.
It's also possible to require them since they inherit from luigi.Task.
import luigi
from luigi.util import requires
from bioluigi.tasks import bcftools
class ProduceAnnotations(luigi.ExternalTask):
def output(self):
return luigi.LocalTarget('annotations.vcf')
@requires(ProduceAnnotations)
class AnnotateFile(luigi.Task):
input_file = luigi.Parameter()
def run(self):
yield bcftools.Annotate(input_file=self.input_file,
annotation_file=self.input().path,
output_file=self.output().path,
scheduler='slurm',
cpus=8)
def output(self):
return luigi.LocalTarget('annotated.vcf.gz')
You can define your own scheduled task by implementing the ScheduledExternalProgramTask class. Note that the default
scheduler is local and will use Luigi's [resources] allocation mechanism.
import datetime
from bioluigi.scheduled_external_program import ScheduledExternalProgramTask
class MyScheduledTask(ScheduledExternalProgramTask):
scheduler = 'slurm'
walltime = datetime.timedelta(seconds=10)
cpus = 1
memory = 1
def program_args(self):
return ['sleep', '10']
Examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bioluigi-0.3.0.tar.gz.
File metadata
- Download URL: bioluigi-0.3.0.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
898b76af60fb4d6c9611218a87afbc1e78bf3ef835d829c668dd565addd713df
|
|
| MD5 |
9e9a0147be51d5e29ee5347195fef805
|
|
| BLAKE2b-256 |
0dba802a7ff30ed98768cb9677efbe2c6ca544e0fa33d1e34af47e6cc878e35a
|
File details
Details for the file bioluigi-0.3.0-py3-none-any.whl.
File metadata
- Download URL: bioluigi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695322741b2e38e8e0469fc4e2701c847fa88887c715bd3e58dbc15b6bfed48e
|
|
| MD5 |
c85e6e982ec20b5591c11fb0666af268
|
|
| BLAKE2b-256 |
303993e0cea25c329091c521a1eb7f49b49b7b3d494091269c85e086945779fa
|