Skip to content

RefTrace

Code analysis for bioinformatics pipelines.

Quick Start Guide

1. Download RefTrace

Terminal window
curl -LO https://github.com/reftrace/reftrace/releases/latest/download/reft-linux-amd64
chmod +x reft-linux-amd64
sudo mv reft-linux-amd64 /usr/local/bin/reft

2. Get a Nextflow pipeline

You probably already have one.
RefTrace works completely offline and collects no data.
If you want to test out RefTrace, you can use the nf-core/rnaseq pipeline:

Terminal window
git clone https://github.com/nf-core/rnaseq.git

3. Create a rules.py file

RefTrace rules are written in Python*. They’re functions that start with rule_ and take a Module object as input. See the API documentation for what you can do.
Here’s a starter rules.py file:

# This file should exist in the root of your pipeline directory
def has_label(directives):
return len(directives.label) > 0
def has_cpus(directives):
return len(directives.cpus) > 0
def rule_has_label_or_cpus(module):
for process in module.processes:
if not (has_label(process.directives) or has_cpus(process.directives)):
fatal("process %s has no label or cpus directive" % process.name)

*Technically Starlark - no while loops or recursion

4. Run RefTrace

Terminal window
reft lint # inside the root of your pipeline directory

5. View the Output

Rule: rule_has_label_or_cpus
Module: ~/rnaseq/modules/local/gtf_filter/main.nf
Error: process GTF_FILTER has no label or cpus directive
Module: ~/rnaseq/modules/local/multiqc_custom_biotype/main.nf
Error: process MULTIQC_CUSTOM_BIOTYPE has no label or cpus directive
Module: ~/rnaseq/modules/local/preprocess_transcripts_fasta_gencode/main.nf
Error: process PREPROCESS_TRANSCRIPTS_FASTA_GENCODE has no label or cpus directive