Skip to content

Commit 3064ffb

Browse files
authored
Merge pull request #50 from GoekeLab/devel
v0.10.3: Visium whitelist demultiplexing, 9T polyT flank and chemistr…
2 parents a2f2adb + 5b2a250 commit 3064ffb

7 files changed

Lines changed: 30 additions & 32 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ This file contains all notable changes to Bambu-Pipe.
88

99
### Changed
1010
- 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
11+
- 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
12+
- 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
13+
- 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
14+
15+
### Removed
16+
- `visium-v4` and `visium-v5` (Visium CytAssist Spatial Gene Expression) chemistries, as these probe-based assays do not produce full-length transcripts
1117

1218
### Fixed
1319
- 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

‎README.md‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,15 @@ sample,path,chemistry,technology
9797

9898
*Supported 10x Library Chemistries*
9999

100-
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:
100+
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)):
101101
- `10x3v2` (Single Cell 3' v2)
102-
- `10x3v3` (Single Cell 3' v3 & Next GEM Single Cell 3' v3.1)
103-
- `10x3v4` (GEM-X Single Cell 3' v4)
104-
- `10x5v2` (Single Cell 5' v2)
105-
- `10x5v3` (GEM-X Single Cell 5' v3)
106-
- `visium-v1` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V1)
107-
- `visium-v2` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V2)
108-
- `visium-v3` (Visium Spatial Gene Expression Slide 6.5 mm; serial prefix V3)
109-
- `visium-v4` (Visium CytAssist Spatial Gene Expression Slide 6.5 mm; serial prefix V4)
110-
- `visium-v5` (Visium CytAssist Spatial Gene Expression Slide 11 mm; serial prefix V5)
102+
- `10x3v3` (Universal 3' Gene Expression – Single Cell 3' v3 & Next GEM 3' v3.1)
103+
- `10x3v4` (Universal 3' Gene Expression – GEM-X 3' v4)
104+
- `10x5v2` (Universal 5' Gene Expression – Next GEM 5' v2)
105+
- `10x5v3` (Universal 5' Gene Expression – GEM-X 5' v3)
106+
- `visium-v1` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V1)
107+
- `visium-v2` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V2)
108+
- `visium-v3` (Visium Spatial Gene Expression for Fresh Frozen; slide serial prefix V3)
111109

112110
> **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.
113111
@@ -117,7 +115,7 @@ If your dataset uses a chemistry not listed above, or if you prefer to handle FA
117115

118116
*Visium HD*
119117

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

122120
**Pipeline Configuration**
123121

‎assets/10x_config/adapter_seq_config.csv‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ technology,fwd_primer_f,fwd_primer_r,rev_primer_f,rev_primer_r,TSO_f,TSO_r
77
visium-v1,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
88
visium-v2,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
99
visium-v3,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
10-
visium-v4,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,
11-
visium-v5,CTACACGACGCTCTTCCGATCT,AGATCGGAAGAGCGTCGTGTAG,CCCATGTACTCTGCGTTGATACCACTGCTT,AAGCAGTGGTATCAACGCAGAGTACATGGG,,

‎assets/10x_config/barcode_coordinate_config.csv‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ technology,barcode_path,spatial_coordinate_path
77
visium-v1,visium-v1.txt,visium-v1_coordinates.txt
88
visium-v2,visium-v2.txt,visium-v2_coordinates.txt
99
visium-v3,visium-v3.txt,visium-v3_coordinates.txt
10-
visium-v4,visium-v4.txt,visium-v4_coordinates.txt
11-
visium-v5,visium-v5.txt,visium-v5_coordinates.txt
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
technology,left_flank,barcode,umi,right_flank
2-
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
3-
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
4-
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
2+
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTT
3+
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
4+
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
55
10x5v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTCTTATATGGG
66
10x5v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTCTTATATGGG
7-
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
8-
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
9-
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
10-
visium-v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
11-
visium-v5,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
7+
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
8+
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
9+
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT

‎conf/dev.config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Development parameters — not intended for end users
22
params {
33
bambu_path = null
4-
valid_chemistries = ['10x3v2', '10x3v3', '10x3v4', '10x5v2', '10x5v3', 'visium-v1', 'visium-v2', 'visium-v3', 'visium-v4', 'visium-v5']
4+
valid_chemistries = ['10x3v2', '10x3v3', '10x3v4', '10x5v2', '10x5v3', 'visium-v1', 'visium-v2', 'visium-v3']
55
valid_technologies = ['ONT', 'PacBio']
66
valid_quantification_modes = ['no_quant', 'EM', 'clusteredEM']
77
save_intermediates = false

‎modules/preprocess_fastq.nf‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,21 @@ process PREPROCESS_FASTQ {
106106
# Store flexiplex search pattern as an array so the '?' wildcards are not expanded as shell globs
107107
flank_seq=(-x "\$left_flank" -b "\$barcode" -u "\$umi" -x "\$right_flank")
108108
109-
# Flexiplex filter (barcode filtering)
110-
# For visium chemistries, search the whole rank curve instead
111-
# (previous runs using the default parameters failed to search the whole rank curve for the inflection point)
109+
# Barcode list for demultiplexing
110+
# For visium chemistries, every whitelisted barcode is a spot on the slide, so demultiplex against the whitelist directly
111+
# For single cell chemistries, discover barcodes, then filter them with the whitelist and inflection point (flexiplex-filter)
112112
if [[ $meta.chemistry == visium-v* ]]; then
113-
max_rank_arg="-u 0"
113+
barcode_list=$whitelist
114114
else
115-
max_rank_arg=""
115+
flexiplex -p $task.cpus "\${flank_seq[@]}" -f 0 ${sample}_chopper_out.fastq
116+
flexiplex-filter -w $whitelist --outfile my_filtered_barcode_list.txt flexiplex_barcodes_counts.txt
117+
barcode_list=my_filtered_barcode_list.txt
116118
fi
117-
flexiplex -p $task.cpus "\${flank_seq[@]}" -f 0 ${sample}_chopper_out.fastq
118-
flexiplex-filter \$max_rank_arg -w $whitelist --outfile my_filtered_barcode_list.txt flexiplex_barcodes_counts.txt
119119
120120
# Chain commands: Flexiplex demultiplexing -> (Optional) Save intermediate file after flexiplex -> Cutadapt trimming of reverse primer -> \
121121
# 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
122122
cat ${sample}_chopper_out.fastq |
123-
flexiplex_demux my_filtered_barcode_list.txt |
123+
flexiplex_demux \$barcode_list |
124124
save_intermediate "${sample}_intermediate_flexiplex.fastq.gz" |
125125
cutadapt_trim |
126126
cutadapt_re_search |

0 commit comments

Comments
 (0)