Skip to content

Commit 2587d2b

Browse files
committed
enable custom sample handling and other minor improvements
1 parent cf4ed91 commit 2587d2b

40 files changed

Lines changed: 254 additions & 21386 deletions

.github/workflows/smoke_test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Smoke Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- devel
8+
9+
jobs:
10+
smoke_test:
11+
name: "${{ matrix.profile }} (NF ${{ matrix.nextflow_version }})"
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
nextflow_version: ["25.04.0", "latest-stable"]
16+
profile:
17+
- test_sc_fastq
18+
- test_sc_bam
19+
- test_sc_multi
20+
- test_visium
21+
- test_custom
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: nf-core/setup-nextflow@v2
25+
with:
26+
version: ${{ matrix.nextflow_version }}
27+
- name: Run ${{ matrix.profile }}
28+
run: nextflow run . -profile test_base,${{ matrix.profile }},docker

README.md

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ This pipeline performs context-aware transcript discovery and quantification fro
3434

3535
### **Installation**
3636
Install the following dependencies before running the pipeline:
37-
- [Nextflow](https://www.nextflow.io/docs/latest/install.html)
37+
- [Nextflow](https://www.nextflow.io/docs/latest/install.html) ≥ 25.04
3838
- [Docker](https://docs.docker.com/engine/install/ubuntu/) (or [Singularity](https://docs.sylabs.io/guides/3.0/user-guide/installation.html) if you do not have user permissions for Docker).
3939

40-
The latest version for each dependency is recommended.
41-
4240
### **General Usage**
4341
To run the pipeline, you must provide a samplesheet, reference genome, and reference annotation file as input. The pipeline performs transcript discovery and quantification on either a single sample or multiple samples based on the number of samples specified in the samplesheet. Refer to the [Parameters](#parameters) and Samplesheet (CSV) sections below for more details.
4442

@@ -47,9 +45,9 @@ To run the pipeline, you must provide a samplesheet, reference genome, and refer
4745
Use the command below to run the pipeline on the test data provided in `examples/`
4846
```
4947
nextflow run main.nf \
50-
--input examples/samplesheet_test_fastq.csv \
51-
--genome examples/GRCh38.primary_assembly.genome.chr9_1_1000000.fa \
52-
--annotation examples/gencode.v49.primary_assembly.annotation.chr9_1_1000000.gtf \
48+
--input examples/samplesheet_test_sc_fastq.csv \
49+
--genome examples/GRCh38.primary_assembly.genome.chr21.fa.gz \
50+
--annotation examples/gencode.v49.primary_assembly.annotation.chr21.gtf.gz \
5351
-profile singularity,hpc
5452
```
5553

@@ -85,15 +83,15 @@ sample,path,chemistry,technology
8583
```csv
8684
sample,path,chemistry,technology
8785
10x5v2_ONT_example,examples/10x5v2_ONT_example.fastq.gz,10x5v2,ONT
88-
10x5v2_PacBio_example,examples/10x5v2_PacBio_example_demultiplexed.bam,10x5v2,PacBio
86+
10x5v3_ONT_example,examples/10x5v3_ONT_example_demultiplexed.bam,10x5v3,ONT
8987
```
9088

9189
> **Note:** Example samplesheets are provided in `examples/`. If all samples share the same library chemistry and/or sequencing technology, you may omit the `chemistry` and `technology` columns and use the `--chemistry` and `--technology` flags instead.
9290
9391

9492
*Supported 10x Library Chemistries*
9593

96-
The following single cell and spatial library chemistries are supported. Please specify the sample chemistry in the samplesheet as shown:
94+
For the following chemistries, the pipeline handles the full workflow — FASTQ preprocessing, genome alignment, and transcript discovery and quantification. Please specify the sample chemistry in the samplesheet as shown:
9795
- `10x3v2` (Single Cell 3' v2)
9896
- `10x3v3` (Single Cell 3' v3 & Next GEM Single Cell 3' v3.1)
9997
- `10x3v4` (GEM-X Single Cell 3' v4)
@@ -105,6 +103,12 @@ The following single cell and spatial library chemistries are supported. Please
105103
- `visium-v4` (Visium CytAssist Spatial Gene Expression Slide 6.5 mm; serial prefix V4)
106104
- `visium-v5` (Visium CytAssist Spatial Gene Expression Slide 11mm; serial prefix V5)
107105

106+
> **Note:** Visium samples must be run one sample at a time. Multi-sample runs are not supported for Visium chemistries.
107+
108+
*Custom Chemistry*
109+
110+
If your dataset uses a chemistry not listed above, or if you prefer to handle FASTQ preprocessing and genome alignment manually, provide a pre-processed, demultiplexed BAM file as input. See the [Advanced Usage](#advanced-usage) section for details.
111+
108112
**Pipeline Configuration**
109113

110114
*Nextflow Profiles*
@@ -122,9 +126,9 @@ To configure the executor and container, pass profile types via the `-profile` a
122126
### **Parameters**
123127

124128
**Mandatory**
125-
- `--input` [string]: Path to the samplesheet .csv file
126-
- `--genome` [string]: Path to the reference genome .fa or .fasta file
127-
- `--annotation` [string]: Path to the reference annotation .gtf or .gff file
129+
- `--input` [string]: Path to the samplesheet `.csv` file
130+
- `--genome` [string]: Path to the reference genome `.fa`, `.fasta`, or `.fa.gz` file
131+
- `--annotation` [string]: Path to the reference annotation `.gtf`, `.gff`, `.gtf.gz`, or `.gff.gz` file
128132

129133
**Optional**
130134
- `--output_dir` [string, default: 'output']: Path to the output directory
@@ -221,7 +225,7 @@ The pipeline applies the same processing steps to both single-cell and spatial s
221225

222226
For `visium-v*` samples, `colData` contains the spatial barcode and the corresponding X and Y spatial coordinates.
223227

224-
| Barcode | X coordinate | Y coordinate|
228+
| barcode | x_coordinate | y_coordinate |
225229
|:---|:---|:---|
226230
| AAACAACGAATAGTTC | 17 | 1 |
227231
| AAACAAGTATCTCCCA | 103 | 51 |
@@ -245,32 +249,53 @@ Example data and pre-configured profiles are provided in `examples/` to run the
245249

246250
| Profile | Description |
247251
|---|---|
248-
| `test_fastq` | Single-sample ONT run from raw reads |
249-
| `test_bam` | Single-sample ONT run from demultiplexed BAM |
250-
| `test_multi` | Multi-sample run with ONT and PacBio samples |
252+
| `test_sc_fastq` | Single-cell, single-sample ONT run from raw reads |
253+
| `test_sc_bam` | Single-cell, single-sample ONT run from demultiplexed BAM |
254+
| `test_sc_multi` | Single-cell, multi-sample ONT run across two chemistries (10x5v2 FASTQ + 10x5v3 BAM) |
255+
| `test_visium` | Spatial (Visium), single-sample ONT run from raw reads |
256+
| `test_custom` | Custom chemistry, single-sample ONT run from demultiplexed BAM |
251257

252258
```bash
253-
# Test from FASTQ input
254-
nextflow run . -profile test_base,test_fastq,singularity
259+
# Single-cell: test from FASTQ input
260+
nextflow run . -profile test_base,test_sc_fastq,singularity
255261

256-
# Test from BAM input
257-
nextflow run . -profile test_base,test_bam,singularity
262+
# Single-cell: test from BAM input
263+
nextflow run . -profile test_base,test_sc_bam,singularity
258264

259-
# Test with multiple samples (ONT + PacBio)
260-
nextflow run . -profile test_base,test_multi,singularity
265+
# Single-cell: test with multiple samples (ONT + PacBio)
266+
nextflow run . -profile test_base,test_sc_multi,singularity
267+
268+
# Spatial: test Visium from FASTQ input
269+
nextflow run . -profile test_base,test_visium,singularity
270+
271+
# Custom chemistry: test from demultiplexed BAM
272+
nextflow run . -profile test_base,test_custom,singularity
261273
```
262274

263275
The output files from the smoke tests are written to `.smoke_test/<profile>/output/`.
264276

277+
**Running Pipeline with a Custom Chemistry or Pre-aligned BAM**
278+
279+
If your dataset uses a chemistry not listed under Supported 10x Library Chemistries, or if you prefer to perform FASTQ preprocessing and genome alignment manually, start the pipeline directly from a pre-processed, demultiplexed BAM file. The BAM file must have the barcode and UMI information encoded either in the `CB`/`UB` column, or in the read name using the format `<barcode>_<umi>#<read_id>`.
280+
281+
*Samplesheet (Custom Chemistry)*
282+
283+
For samples with a custom chemistry, set the `chemistry` field in the samplesheet to any descriptive string.
284+
285+
```csv
286+
sample,path,chemistry,technology
287+
custom_example,examples/custom_example.bam,my_custom_chemistry,ONT
288+
```
289+
265290
**Stopping the Pipeline After Alignment**
266291

267292
The `--bam_only` flag stops the pipeline after genome alignment, saving BAM files to `output/bam/`. This is useful when you want to inspect the aligned reads or run downstream steps separately.
268293

269294
```bash
270295
nextflow run main.nf \
271-
--input examples/samplesheet_test_fastq.csv \
272-
--genome examples/GRCh38.primary_assembly.genome.chr9_1_1000000.fa \
273-
--annotation examples/gencode.v49.primary_assembly.annotation.chr9_1_1000000.gtf \
296+
--input examples/samplesheet_test_sc_fastq.csv \
297+
--genome examples/GRCh38.primary_assembly.genome.chr21.fa.gz \
298+
--annotation examples/gencode.v49.primary_assembly.annotation.chr21.gtf.gz \
274299
--bam_only true \
275300
-profile singularity,hpc
276301
```
@@ -286,17 +311,17 @@ sample,path,chemistry,technology
286311

287312
```bash
288313
nextflow run main.nf \
289-
--input examples/samplesheet_test_bam.csv \
290-
--genome examples/GRCh38.primary_assembly.genome.chr9_1_1000000.fa \
291-
--annotation examples/gencode.v49.primary_assembly.annotation.chr9_1_1000000.gtf \
314+
--input examples/samplesheet_test_sc_bam.csv \
315+
--genome examples/GRCh38.primary_assembly.genome.chr21.fa.gz \
316+
--annotation examples/gencode.v49.primary_assembly.annotation.chr21.gtf.gz \
292317
-profile singularity,hpc
293318
```
294319

295320
**Visualising Clustering Results**
296321

297322
The `seurat_obj.rds` output contains PCA embeddings and cluster assignments but does not include a UMAP. The examples below show how to compute UMAP and visualise clusters in R.
298323

299-
> **Note:** These examples use output generated from the smoke tests (`test_fastq` for single sample, `test_multi` for multiple samples), which are not representative of real datasets.
324+
> **Note:** These examples use output generated from the smoke tests (`test_sc_fastq` for single sample, `test_sc_multi` for multiple samples), which are not representative of real datasets.
300325
301326
*Single sample*
302327
```r

conf/smoke_test.config

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,43 @@ profiles {
2020
}
2121
workDir = "${projectDir}/.smoke_test/work"
2222
params {
23-
genome = "${projectDir}/examples/GRCh38.primary_assembly.genome.chr9_1_1000000.fa"
24-
annotation = "${projectDir}/examples/gencode.v49.primary_assembly.annotation.chr9_1_1000000.gtf"
23+
genome = "${projectDir}/examples/GRCh38.primary_assembly.genome.chr21.fa.gz"
24+
annotation = "${projectDir}/examples/gencode.v49.primary_assembly.annotation.chr21.gtf.gz"
2525
}
2626
}
2727

28-
test_fastq {
28+
test_sc_fastq {
2929
params {
30-
input = "${projectDir}/examples/samplesheet_test_fastq.csv"
31-
output_dir = "${projectDir}/.smoke_test/test_fastq/output"
30+
input = "${projectDir}/examples/samplesheet_test_sc_fastq.csv"
31+
output_dir = "${projectDir}/.smoke_test/test_sc_fastq/output"
3232
}
3333
}
3434

35-
test_bam {
35+
test_sc_bam {
3636
params {
37-
input = "${projectDir}/examples/samplesheet_test_bam.csv"
38-
output_dir = "${projectDir}/.smoke_test/test_bam/output"
37+
input = "${projectDir}/examples/samplesheet_test_sc_bam.csv"
38+
output_dir = "${projectDir}/.smoke_test/test_sc_bam/output"
3939
}
4040
}
4141

42-
test_multi {
42+
test_sc_multi {
4343
params {
44-
input = "${projectDir}/examples/samplesheet_test_multi.csv"
45-
output_dir = "${projectDir}/.smoke_test/test_multi/output"
44+
input = "${projectDir}/examples/samplesheet_test_sc_multi.csv"
45+
output_dir = "${projectDir}/.smoke_test/test_sc_multi/output"
46+
}
47+
}
48+
49+
test_visium {
50+
params {
51+
input = "${projectDir}/examples/samplesheet_test_visium.csv"
52+
output_dir = "${projectDir}/.smoke_test/test_visium/output"
53+
}
54+
}
55+
56+
test_custom {
57+
params {
58+
input = "${projectDir}/examples/samplesheet_test_custom.csv"
59+
output_dir = "${projectDir}/.smoke_test/test_custom/output"
4660
}
4761
}
4862

1.88 MB
Binary file not shown.
1.96 MB
Binary file not shown.
-5.91 MB
Binary file not shown.
9.11 MB
Binary file not shown.
4.34 MB
Binary file not shown.
11.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)