Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pipelines/nf-atacseq/.github/.dockstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1.2
workflows:
- subclass: nfl
primaryDescriptorPath: /pipelines/nf-atacseq/main.nf
publish: true
29 changes: 29 additions & 0 deletions pipelines/nf-atacseq/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing to nf-atacseq

## Getting help

For questions, bugs, or feature requests, please open an issue on [GitHub](https://github.com/mcvickerlab/WASP2/issues).

## Development workflow

1. Fork the repository
2. Create a feature branch from `dev`
3. Make your changes
4. Run `nf-core pipelines lint` to verify compliance
5. Submit a pull request to `dev`

## Code style

- Follow nf-core module conventions for new modules
- Use `tuple val(meta), path(...)` for all process inputs/outputs
- Include `stub:` blocks in all processes
- Add `versions.yml` output to all processes
- Write `meta.yml` documentation for new modules

## Testing

Run the test profile before submitting changes:

```bash
nextflow run main.nf -profile test,docker --outdir test_results
```
5 changes: 5 additions & 0 deletions pipelines/nf-atacseq/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: WASP2 Documentation
url: https://wasp2.readthedocs.io
about: Check the documentation for usage help
19 changes: 19 additions & 0 deletions pipelines/nf-atacseq/.github/actions/get-shards/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Get test shards
description: Get nf-test shards for parallel execution
inputs:
test-path:
description: Path to test files
required: false
default: tests
outputs:
shards:
description: JSON array of test shards
value: ${{ steps.get-shards.outputs.shards }}
runs:
using: composite
steps:
- id: get-shards
shell: bash
run: |
shards=$(find ${{ inputs.test-path }} -name "*.nf.test" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "shards=$shards" >> $GITHUB_OUTPUT
15 changes: 15 additions & 0 deletions pipelines/nf-atacseq/.github/actions/nf-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Run nf-test
description: Run nf-test for a specific test file
inputs:
test-file:
description: Path to the nf-test file
required: true
profile:
description: Nextflow profile to use
required: false
default: test,docker
runs:
using: composite
steps:
- shell: bash
run: nf-test test ${{ inputs.test-file }} --profile ${{ inputs.profile }}
13 changes: 13 additions & 0 deletions pipelines/nf-atacseq/.github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: nf-core branch protection
on:
pull_request_target:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check PRs
if: github.repository == 'mcvickerlab/WASP2'
run: |
{ [[ ${{github.event.pull_request.head.repo.full_name}} == mcvickerlab/WASP2 ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || echo "This PR is not from dev. It will be reviewed manually."
13 changes: 13 additions & 0 deletions pipelines/nf-atacseq/.github/workflows/linting_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: nf-core linting comment
on:
workflow_run:
workflows: ["nf-core linting"]
types: [completed]

jobs:
linting-comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Post linting comment
run: echo "Linting workflow completed"
40 changes: 40 additions & 0 deletions pipelines/nf-atacseq/.github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run nf-test
on:
pull_request:
branches: [dev, master]
release:
types: [published]
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
NXF_ANSI_LOG: false
NFT_VER: "0.9.2"

jobs:
nf-test:
name: "nf-test | NXF ${{ matrix.NXF_VER }}"
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
steps:
- uses: actions/checkout@v4

- uses: nf-core/setup-nextflow@v2
with:
version: "${{ matrix.NXF_VER }}"

- name: Install nf-test
run: |
wget -qO- https://code.askimed.com/install/nf-test | bash
sudo mv nf-test /usr/local/bin/

- name: Run nf-test
run: nf-test test --profile test,docker
26 changes: 23 additions & 3 deletions pipelines/nf-atacseq/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nf-atacseq

[![nf-atacseq Tests](https://github.com/your-org/WASP2/actions/workflows/nf-atacseq-tests.yml/badge.svg)](https://github.com/your-org/WASP2/actions/workflows/nf-atacseq-tests.yml)
[![nf-atacseq CI](https://github.com/mcvickerlab/WASP2/actions/workflows/ci.yml/badge.svg)](https://github.com/mcvickerlab/WASP2/actions/workflows/ci.yml)

ATAC-seq Allelic Imbalance (AI) Pipeline with WASP2 mapping bias correction.

Expand Down Expand Up @@ -60,6 +60,12 @@ nextflow run pipelines/nf-atacseq -profile test,docker
nextflow run pipelines/nf-atacseq -profile test,docker -stub-run # Workflow validation only
```

### Local Test (chr21 data)

```bash
nextflow run pipelines/nf-atacseq -profile test_local,docker
```

## Samplesheet Format

```csv
Expand Down Expand Up @@ -112,6 +118,19 @@ results/

See [docs/output.md](docs/output.md) for detailed output descriptions.

## Validation with chr21 1000 Genomes Data

Run a quick validation using chr21 data from the 1000 Genomes Project:

```bash
# Uses pre-configured chr21 test data (NA12878, HG00096)
nextflow run pipelines/nf-atacseq -profile test_local,docker

# Expect: ~2-5 min runtime, allele counts at chr21 het SNPs
```

This profile uses downsampled chr21 FASTQ reads and a chr21-only VCF, providing a fast end-to-end validation without downloading full genomes.

## Testing

### Run nf-test Suite
Expand Down Expand Up @@ -148,6 +167,7 @@ nextflow run . -profile test -stub-run
| `singularity` | Run with Singularity containers |
| `conda` | Run with Conda environments |
| `test` | Minimal test configuration |
| `test_local` | Local test with chr21 1000 Genomes data |
| `test_full` | Full test with real data |

## Pipeline DAG
Expand All @@ -168,7 +188,7 @@ FASTQ → FastQC → Fastp → BWA/Bowtie2 → Samtools → Picard → MACS2 →

If you use nf-atacseq, please cite:

- **WASP2**: [GitHub Repository](https://github.com/your-org/WASP2)
- **WASP2**: [GitHub Repository](https://github.com/mcvickerlab/WASP2)
- **Nextflow**: Di Tommaso, P., et al. (2017). Nextflow enables reproducible computational workflows. *Nature Biotechnology*.

## License
Expand All @@ -177,5 +197,5 @@ MIT License - see [LICENSE](../../LICENSE) for details.

## Support

- [Issues](https://github.com/your-org/WASP2/issues)
- [Issues](https://github.com/mcvickerlab/WASP2/issues)
- [Documentation](docs/)
48 changes: 48 additions & 0 deletions pipelines/nf-atacseq/assets/email_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${workflow.manifest.name} Pipeline Report</title>
</head>
<body>
<div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto;">

<img src="cid:nfcorepipelinelogo">

<h1>${workflow.manifest.name} v${workflow.manifest.version}</h1>
<h2>Run Name: $runName</h2>

<% if (!success) { %>
<div style="color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
<h4 style="color: inherit; margin-top: 0;">⚠️ ${workflow.manifest.name} execution completed unsuccessfully!</h4>
<p>The exit status of the task that caused the workflow execution to fail was: <code>$exitStatus</code>.</p>
<p>The full error message was:</p>
<pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0;">${errorReport}</pre>
</div>
<% } else { %>
<div style="color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
${workflow.manifest.name} execution completed successfully!
</div>
<% } %>

<p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
<p>The command used to launch the workflow was as follows:</p>
<pre style="white-space: pre-wrap; overflow: visible;">$commandLine</pre>

<h3>Pipeline Configuration:</h3>
<table cellpadding="5" style="width:100%; max-width:600px; border-collapse: collapse;">
<tr><td>Nextflow Version</td><td>$nextflowVersion</td></tr>
<tr><td>Run Name</td><td>$runName</td></tr>
<tr><td>Session ID</td><td>$sessionId</td></tr>
<% if (summary.size() > 0) { %>
<% for (e in summary) { %><tr><td>${e.key}</td><td>${e.value}</td></tr>
<% } %>
<% } %>
</table>

<p>--- <em>${workflow.manifest.name}</em></p>

</div>
</body>
</html>
34 changes: 34 additions & 0 deletions pipelines/nf-atacseq/assets/email_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
----------------------------------------------------
${workflow.manifest.name} v${workflow.manifest.version}
----------------------------------------------------
Run Name: $runName

<% if (success) {
out << "## ${workflow.manifest.name} execution completed successfully! ##"
} else {
out << """####################################################
## ${workflow.manifest.name} execution completed unsuccessfully! ##
####################################################
The exit status of the task that caused the workflow execution to fail was: $exitStatus.
The full error message was:

${errorReport}
"""
} %>


The workflow was completed at $dateComplete (duration: $duration)

The command used to launch the workflow was as follows:

$commandLine



Pipeline Configuration:
-----------------------
<% for (e in summary) { %> ${e.key.padRight(30)}: ${e.value}
<% } %>

--
${workflow.manifest.name}
11 changes: 7 additions & 4 deletions pipelines/nf-atacseq/assets/multiqc_config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# MultiQC configuration for nf-atacseq

report_comment: >
This report has been generated by the <a href="https://github.com/your-org/WASP2" target="_blank">nf-atacseq</a>
pipeline. It summarizes QC metrics from ATAC-seq allelic imbalance analysis with WASP2.
This report has been generated by the <a href="https://github.com/nf-core/nf-atacseq/releases/tag/1.0.0" target="_blank">nf-core/nf-atacseq</a>
analysis pipeline. For information about how to interpret these results, please see the
<a href="https://nf-co.re/nf-atacseq/1.0.0/docs/output" target="_blank">documentation</a>.

report_section_order:
software_versions:
order: -1000
nf-atacseq-methods-description:
order: -1000
software_versions:
order: -1001
wasp2-nf-atacseq-summary:
order: -1002

export_plots: true

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion pipelines/nf-atacseq/conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ process {
//
withName: 'BWA_MEM' {
ext.args = '-M'
ext.args2 = '-bhS'
publishDir = [
path: { "${params.outdir}/alignment" },
mode: params.publish_dir_mode,
Expand All @@ -63,6 +62,10 @@ process {
]
}

withName: 'SAMTOOLS_SORT' {
ext.prefix = { "${meta.id}.sorted" }
}

withName: 'SAMTOOLS_INDEX' {
publishDir = [
path: { "${params.outdir}/alignment" },
Expand Down
9 changes: 9 additions & 0 deletions pipelines/nf-atacseq/conf/test_local.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ params {
wasp_min_count = 1
wasp_pseudocount = 1
}

// Override base.config resourceLimits so local workstations don't OOM
process {
resourceLimits = [
cpus: 2,
memory: 6.GB,
time: 1.h
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions pipelines/nf-atacseq/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
# Conda environment for nf-atacseq local Python/WASP2 modules
# (wasp2_make_reads, wasp2_filter_remapped, wasp2_count_variants, wasp2_find_imbalance)
channels:
- conda-forge
- bioconda
dependencies:
- python>=3.10
- numpy>=1.21,<2.0
- pandas>=2.0
- polars>=0.19
- scipy>=1.10
- pysam
- pybedtools
- samtools
- bcftools
- bedtools
- typer
- rich
- pip
- pip:
- wasp2==1.2.1
Loading
Loading