Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stub directives to all processes to enable Nextflow's -stub dry-run option #38

Open
nrminor opened this issue Dec 3, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@nrminor
Copy link
Owner

nrminor commented Dec 3, 2024

A user recently requested a Snakemake-like dry run feature to suss out how the pipeline works before supplying large input files. Implementing this in Nextflow is much more involved, as it requires that we write a stub directive for every single process. Fortunately, that will be relatively straightforward if tedious in this pipeline because most processes produce a single output file. Given that, a process that looks like this:

process CLUMP_READS {

    /* */

	tag "${sample_id}"

	errorStrategy { task.attempt < 3 ? 'retry' : 'ignore' }
	maxRetries 2

	cpus 4

	input:
	tuple val(sample_id), path(reads)

	output:
	tuple val(sample_id), path("${sample_id}.merged.fastq.gz")

	script:
	"""
	clumpify.sh in=${reads} out=${sample_id}.merged.fastq.gz t=${task.cpus} reorder
	"""

}

Would become this:

process CLUMP_READS {

    /* */

	tag "${sample_id}"

	errorStrategy { task.attempt < 3 ? 'retry' : 'ignore' }
	maxRetries 2

	cpus 4

	input:
	tuple val(sample_id), path(reads)

	output:
	tuple val(sample_id), path("${sample_id}.merged.fastq.gz")

	script:
	"""
	clumpify.sh in=${reads} out=${sample_id}.merged.fastq.gz t=${task.cpus} reorder
	"""
	
	stub:
	"""
	touch ${sample_id}.merged.fastq.gz
	"""

}
@nrminor nrminor added the enhancement New feature or request label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants