Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ This file contains all notable changes to Bambu-Pipe.

### Changed
- Increased the minimum adapter overlap in the `PREPROCESS_FASTQ` adapter re-search from the cutadapt default (3 bp) to 10 bp, reducing the number of valid reads discarded due to short chance matches at read ends
- Shortened the polyT right flank for 3' and Visium chemistries (`flank_seq_config.csv`) from 30 T to 9 T, matching the flexiplex presets; ONT reads rarely call the full 30 T homopolymer, so few reads matched the flank during barcode discovery
- Visium samples (`visium-v*`) are now demultiplexed directly against the spot whitelist, as recommended by flexiplex; barcode discovery and flexiplex-filter are skipped, replacing the `-u 0` knee detection workaround
- Updated the supported chemistry names in the README to the official 10x Genomics assay names, with a link to the 10x Genomics long-read compatibility article

### Removed
- `visium-v4` and `visium-v5` (Visium CytAssist Spatial Gene Expression) chemistries, as these probe-based assays do not produce full-length transcripts

### Fixed
- Corrected the 10x3v3 and 10x3v4 end adapter (`rev_primer_f`/`rev_primer_r` in `adapter_seq_config.csv`) to `CCCATGTACTCTGCGTTGATACCACTGCTT`, matching 10x3v2 and Visium; the previous sequence does not occur in these reads, so the adapter was rarely trimmed
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ sample,path,chemistry,technology

*Supported 10x Library Chemistries*

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:
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 (see 10x Genomics' [long-read compatibility article](https://kb.10xgenomics.com/s/article/10618695456781-Which-10x-Genomics-assays-are-compatible-with-long-read-sequencing-applications)):
- `10x3v2` (Single Cell 3' v2)
- `10x3v3` (Single Cell 3' v3 & Next GEM Single Cell 3' v3.1)
- `10x3v4` (GEM-X Single Cell 3' v4)
- `10x5v2` (Single Cell 5' v2)
- `10x5v3` (GEM-X Single Cell 5' v3)
- `visium-v1` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V1)
- `visium-v2` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V2)
- `visium-v3` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V3)
- `visium-v4` (Visium CytAssist Spatial Gene Expression Slide 6.5 mm; serial prefix V4)
- `visium-v5` (Visium CytAssist Spatial Gene Expression Slide 11 mm; serial prefix V5)
- `10x3v3` (Universal 3' Gene Expression – Single Cell 3' v3 & Next GEM 3' v3.1)
- `10x3v4` (Universal 3' Gene Expression – GEM-X 3' v4)
- `10x5v2` (Universal 5' Gene Expression – Next GEM 5' v2)
- `10x5v3` (Universal 5' Gene Expression – GEM-X 5' v3)
- `visium-v1` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V1)
- `visium-v2` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V2)
- `visium-v3` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V3)

> **Note:** Visium Spatial Gene Expression samples (`visium-v*`) must be run one at a time and require a Loupe manual alignment file. See the [Visium Spatial Gene Expression](#visium-spatial-gene-expression) section for details.

Expand All @@ -117,7 +115,7 @@ If your dataset uses a chemistry not listed above, or if you prefer to handle FA

*Visium HD*

The pipeline also supports Visium HD samples. See the [Visium HD](#visium-hd) section for more details.
The pipeline also supports Visium HD 3' Spatial Gene Expression samples. See the [Visium HD](#visium-hd) section for more details.

**Pipeline Configuration**

Expand Down
2 changes: 0 additions & 2 deletions assets/10x_config/adapter_seq_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ technology,fwd_primer_f,fwd_primer_r,rev_primer_f,rev_primer_r,TSO_f,TSO_r
visium-v1,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
visium-v2,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
visium-v3,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
visium-v4,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
visium-v5,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
2 changes: 0 additions & 2 deletions assets/10x_config/barcode_coordinate_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ technology,barcode_path,spatial_coordinate_path
visium-v1,visium-v1.txt,visium-v1_coordinates.txt
visium-v2,visium-v2.txt,visium-v2_coordinates.txt
visium-v3,visium-v3.txt,visium-v3_coordinates.txt
visium-v4,visium-v4.txt,visium-v4_coordinates.txt
visium-v5,visium-v5.txt,visium-v5_coordinates.txt
14 changes: 6 additions & 8 deletions assets/10x_config/flank_seq_config.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
technology,left_flank,barcode,umi,right_flank
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTT
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
10x5v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTCTTATATGGG
10x5v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTCTTATATGGG
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
visium-v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
visium-v5,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
2 changes: 1 addition & 1 deletion conf/dev.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Development parameters — not intended for end users
params {
bambu_path = null
valid_chemistries = ['10x3v2', '10x3v3', '10x3v4', '10x5v2', '10x5v3', 'visium-v1', 'visium-v2', 'visium-v3', 'visium-v4', 'visium-v5']
valid_chemistries = ['10x3v2', '10x3v3', '10x3v4', '10x5v2', '10x5v3', 'visium-v1', 'visium-v2', 'visium-v3']
Comment thread
ch99l marked this conversation as resolved.
valid_technologies = ['ONT', 'PacBio']
valid_quantification_modes = ['no_quant', 'EM', 'clusteredEM']
save_intermediates = false
Expand Down
16 changes: 8 additions & 8 deletions modules/preprocess_fastq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ process PREPROCESS_FASTQ {
# Store flexiplex search pattern as an array so the '?' wildcards are not expanded as shell globs
flank_seq=(-x "\$left_flank" -b "\$barcode" -u "\$umi" -x "\$right_flank")

# Flexiplex filter (barcode filtering)
# For visium chemistries, search the whole rank curve instead
# (previous runs using the default parameters failed to search the whole rank curve for the inflection point)
# Barcode list for demultiplexing
# For visium chemistries, every whitelisted barcode is a spot on the slide, so demultiplex against the whitelist directly
# For single cell chemistries, discover barcodes, then filter them with the whitelist and inflection point (flexiplex-filter)
if [[ $meta.chemistry == visium-v* ]]; then
max_rank_arg="-u 0"
barcode_list=$whitelist
else
max_rank_arg=""
flexiplex -p $task.cpus "\${flank_seq[@]}" -f 0 ${sample}_chopper_out.fastq
flexiplex-filter -w $whitelist --outfile my_filtered_barcode_list.txt flexiplex_barcodes_counts.txt
barcode_list=my_filtered_barcode_list.txt
fi
flexiplex -p $task.cpus "\${flank_seq[@]}" -f 0 ${sample}_chopper_out.fastq
flexiplex-filter \$max_rank_arg -w $whitelist --outfile my_filtered_barcode_list.txt flexiplex_barcodes_counts.txt

# Chain commands: Flexiplex demultiplexing -> (Optional) Save intermediate file after flexiplex -> Cutadapt trimming of reverse primer -> \
# Cutadapt re-search for all primer and TSO sequences to remove non-standard reads -> Reverse complementation of reads for 3' and visium chemistry -> Compression with pigz
cat ${sample}_chopper_out.fastq |
flexiplex_demux my_filtered_barcode_list.txt |
flexiplex_demux \$barcode_list |
save_intermediate "${sample}_intermediate_flexiplex.fastq.gz" |
cutadapt_trim |
cutadapt_re_search |
Expand Down
Loading