nextflow-io / nextflow-io/nextflow

Add a variable that resolves to the absolute path to the current file

Open
#6,167 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lang/config stale
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

New feature

Currently, all the paths in configuration files are relative to the nextflow script being executed: baseDir, projectDir and ./ all resolve to the same thing. I'm proposing adding a variable called something like thisDir that would resolve to the directory containing the file of the nextflow config file being read.

Use case

This would decouple config files from the script being ran to a greater extent. When I write a config file, I know where it is and where the paths it refers to are in relation to it. I imagine this is especially true when there are multiple config files being evaluated sequentially as described at the top of https://www.nextflow.io/docs/latest/config.html

My main use case is to allow me to have one nextflow.config in my project root defining the location of assets despite having multiple workflow scripts (I.E. a main workflow and other workflows wrapping subworkflows for testing purposes)

This would solve the issue described here: https://github.com/nextflow-io/nextflow/issues/1858

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Nextflow resolves baseDir, projectDir, and relative paths while reading configuration files. Define the behavior for a variable representing the directory of each config file, including sequentially evaluated configs, and verify that paths resolve relative to the correct config location.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.