Skip to main content

Lint Nextflow pipelines in Python

Project description

RefTrace

GitHub release Discord chat

Lint Nextflow pipelines in Python.

pip install reftrace

Features

  • Write custom linting rules in Python.
  • Avoid parsing the Nextflow DSL.
  • Access the Nextflow DSL from Python.

Example Rule

@rule
def no_labels(module: Module, results: LintResults):
    for process in module.processes:
        if not process.labels:
            results.warnings.append(
                ModuleWarning(
                    line=process.line,
                    warning=f"process '{process.name}' has no labels"
                )
            )

Getting Started

Run in your pipeline directory:

reftrace generate  # Create rules.py starter rules
reftrace lint

You'll get output like this:

Module: /home/andrew/nf-core/rnaseq/modules/nf-core/preseq/lcextrap/main.nf
  Warning on line 1: process 'PRESEQ_LCEXTRAP' has non-standard labels: ['error_ignore']

Module: /home/andrew/nf-core/rnaseq/modules/nf-core/hisat2/build/main.nf
  Warning on line 1: process 'HISAT2_BUILD' has conflicting labels: ['process_high', 'process_high_memory']

RefTrace automatically runs the linting rules in rules.py on all modules in the pipeline.

Access Nextflow from Python

from reftrace import Module

module = Module("path/to/nextflow.nf")

Limitations

  • Not all parts of the Nextflow DSL are yet exposed. Specifically, only processes are handled. Only directives, process inputs, and process outputs are exposed to linting rules.

  • The parser is not perfect. It doesn't seek to handle all of Groovy, but enough to work in practice. Even so, test coverage could be better. If you encounter a parsing bug, please open an issue.

Acknowledgements

We would like to express our gratitude to the following:

  • The Apache Groovy project.
  • The ANTLR project, for providing the parser generator used in this tool.
  • The Go programming language and its standard library.
  • The Nextflow project and community, for being so welcoming and helpful.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

reftrace-0.4.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.4.8-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

reftrace-0.4.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.4.8-cp311-cp311-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

reftrace-0.4.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.4.8-cp310-cp310-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

reftrace-0.4.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

reftrace-0.4.8-cp39-cp39-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file reftrace-0.4.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 157200808d1383f38a33478d064f4dac6680136da98675f069af85eeaf0ea2ba
MD5 b8062823cfcb854e1893ee20c8f0db1c
BLAKE2b-256 d47c48e4cac74ccb243d83a92ef648c7f65afe5c1bf9247b3cba1e2d9921d33e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc113f101f9c12e2922fa79d2545ac9c4bc2df293b99fd7cab0878ef6020a160
MD5 a5a51d75ddcd8bcd54d59b78e7d60250
BLAKE2b-256 61beb32e9d59e5416f389cdb73485a7722fec37dce1f140c52bff8d6dede9494

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e257129fd1ac3ab858b1051b006e39de071ce9b3c9197adc037306ebc1284532
MD5 6887b3494a3dff5497328ec8abcf3c98
BLAKE2b-256 05159ac1330453c848b53665263dd731b05485594b80600f5555246e1d147c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c259358e977b1ba37d9b210d47d6a8b26f710e98f841e254fbbd811b39b1d6a
MD5 6fd6fe1334db16f06ec9c71413930755
BLAKE2b-256 943b7e25d0a88c96564e80359c94a6f30b6748925c337bcf0312d4a0dbc7f0df

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fbe4a879d88101079b974cb83a2054febb31948fbaff0e898122d4867e997fc2
MD5 5fa84420fbf4d6b22055481eac67acab
BLAKE2b-256 2ef53fb53c51da033e4aa5dd0b6e47831517ead84236f617fd92ff1a84173ad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3dae137e6f29a83935ff981e5fee66a950b5a4ea4bb4530fe8dc81cf1bf148d3
MD5 777cce4d05bb638236c24bf52b94e531
BLAKE2b-256 b42a77729b7c9f5fd71d0fdb176c43c7bd6278f8ed67bee82bd24e4c6362ab88

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb25697b0c3312ad8d4c7290016a1433ca500cf5f5d5678813d0bd258d97172a
MD5 2cf625ce491c700c3bd7c886f9878d4c
BLAKE2b-256 c7b012c8f9d55eb9d218d5acf83c944d224aa93272f42da98acb011f96958b5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reftrace-0.4.8-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for reftrace-0.4.8-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8651d166e2578abc1f3f859629d75d9803d3d7cafbf305c92a40e6f5d34bfa87
MD5 56ad59022e67b73d7d1f6c8cf957e428
BLAKE2b-256 d36980be42482a8dee8010eb3c53775bf634593ecfcb3f3c464b9a523310b048

See more details on using hashes here.

Provenance

The following attestation bundles were made for reftrace-0.4.8-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build.yml on RefTrace/RefTrace

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page