Skip to content

Commit f703c36

Browse files
authored
Merge pull request #52 from GoekeLab/devel
Devel
2 parents 3064ffb + f026c26 commit f703c36

7 files changed

Lines changed: 23 additions & 30 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ 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
11+
- Shortened the polyT right flank for 3' and Visium chemistries (`flexiplex_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
1212
- 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
1313
- 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+
- flexiplex flank (`-f`) and barcode (`-e`) edit distances are now set per chemistry in `flexiplex_config.csv` (`flank_max_edit_distance`, `barcode_max_edit_distance`), using the flexiplex preset defaults (`-f 8`, `-e 2`); this replaces the `flexiplex_f_5prime`, `flexiplex_f_3prime` and `flexiplex_e` developer parameters. The previous `-f 13` for 3' and Visium chemistries allowed too many errors for the shortened 9 T flank, causing spurious flank matches that slowed `PREPROCESS_FASTQ` considerably
15+
- Moved the 10x config files out of `assets/10x_config/` into `assets/`, and renamed `adapter_seq_config.csv` to `cutadapt_config.csv` and `flank_seq_config.csv` to `flexiplex_config.csv`
1416

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

1820
### Fixed
19-
- 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
21+
- Corrected the 10x3v3 and 10x3v4 end adapter (`rev_primer_f`/`rev_primer_r` in `cutadapt_config.csv`) to `CCCATGTACTCTGCGTTGATACCACTGCTT`, matching 10x3v2 and Visium; the previous sequence does not occur in these reads, so the adapter was rarely trimmed
2022
- Resolved an edge case where `PREPROCESS_FASTQ` failed if the input FASTQ filename had the same length as the barcode (16) or UMI (10/12) pattern; the unquoted `?` wildcards in the flexiplex pattern were expanded by the shell to match the filename, which was not intended
2123

2224
## [v0.10.2] - 2026-09-23
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
technology,left_flank,barcode,umi,right_flank
2-
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTT
3-
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
4-
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
5-
10x5v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTCTTATATGGG
6-
10x5v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTCTTATATGGG
7-
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
8-
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
9-
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT
1+
technology,left_flank,barcode,umi,right_flank,flank_max_edit_distance,barcode_max_edit_distance
2+
10x3v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTTTTTTT,8,2
3+
10x3v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT,8,2
4+
10x3v4,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT,8,2
5+
10x5v2,CTACACGACGCTCTTCCGATCT,????????????????,??????????,TTTCTTATATGGG,8,2
6+
10x5v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTCTTATATGGG,8,2
7+
visium-v1,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT,8,2
8+
visium-v2,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT,8,2
9+
visium-v3,CTACACGACGCTCTTCCGATCT,????????????????,????????????,TTTTTTTTT,8,2

‎conf/dev.config‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ params {
66
valid_quantification_modes = ['no_quant', 'EM', 'clusteredEM']
77
save_intermediates = false
88
qfilter_threshold = 10
9-
flexiplex_f_5prime = 8
10-
flexiplex_f_3prime = 13
11-
flexiplex_e = 1
129
process_by_chromosome = true
1310
seurat_dim_single = 15
1411
seurat_dim_multi = 30

‎main.nf‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ workflow STANDARD {
6565
def ndrArg = ndr != null ? ndr : 'NULL'
6666

6767
// load config files
68-
ch_barcode_coordinate_config = file("${projectDir}/assets/10x_config/barcode_coordinate_config.csv", checkIfExists: true)
69-
ch_adapter_seq_config = file("${projectDir}/assets/10x_config/adapter_seq_config.csv", checkIfExists: true)
70-
ch_flank_seq_config = file("${projectDir}/assets/10x_config/flank_seq_config.csv", checkIfExists: true)
68+
ch_barcode_coordinate_config = file("${projectDir}/assets/barcode_coordinate_config.csv", checkIfExists: true)
69+
ch_cutadapt_config = file("${projectDir}/assets/cutadapt_config.csv", checkIfExists: true)
70+
ch_flexiplex_config = file("${projectDir}/assets/flexiplex_config.csv", checkIfExists: true)
7171

7272
ch_n_samples = ch_rows.count()
7373

@@ -79,7 +79,7 @@ workflow STANDARD {
7979

8080
// process fastq samples
8181
ch_preprocess_fastq_in = ch_input_fastq.map { sample, path, meta -> [sample, path, meta, meta.barcode] } // add whitelist path to fastq input tuple
82-
PREPROCESS_FASTQ(ch_preprocess_fastq_in, ch_flank_seq_config, ch_adapter_seq_config)
82+
PREPROCESS_FASTQ(ch_preprocess_fastq_in, ch_flexiplex_config, ch_cutadapt_config)
8383
ALIGNMENT(PREPROCESS_FASTQ.out.fastq, ch_genome, ch_annotation)
8484

8585
if (!params.bam_only) {

‎modules/preprocess_fastq.nf‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ process PREPROCESS_FASTQ {
1111

1212
input:
1313
tuple val(sample), path(fastq), val(meta), path(whitelist)
14-
path(flank_seq_config)
15-
path(adapter_seq_config)
14+
path(flexiplex_config)
15+
path(cutadapt_config)
1616

1717
output:
1818
tuple val(sample), path("${sample}_preprocessed_reads.fastq.gz"), val(meta), emit: fastq
@@ -55,16 +55,10 @@ process PREPROCESS_FASTQ {
5555
}
5656
5757
# Demultiplexing with flexiplex
58-
# Arguments: 1=barcode list file generated by flexiplex-filter
58+
# Arguments: 1=barcode list file (flexiplex-filter output, or the whitelist for visium chemistries)
5959
flexiplex_demux() {
6060
local barcode_list=\$1
61-
if [[ $meta.chemistry == 10x5* ]]; then
62-
flexiplex_f=$params.flexiplex_f_5prime
63-
else
64-
flexiplex_f=$params.flexiplex_f_3prime
65-
fi
66-
67-
flexiplex -p $task.cpus -k \$barcode_list "\${flank_seq[@]}" -f \$flexiplex_f -e $params.flexiplex_e
61+
flexiplex -p $task.cpus -k \$barcode_list "\${flank_seq[@]}" -f \$flank_max_edit_distance -e \$barcode_max_edit_distance
6862
}
6963
7064
# Trims reverse primer with cutadapt
@@ -101,8 +95,8 @@ process PREPROCESS_FASTQ {
10195
decompress | chopper_cmd | save_intermediate "${sample}_intermediate_qfilter.fastq.gz" > ${sample}_chopper_out.fastq
10296
10397
# Extract chemistry specfic parameters from config files
104-
IFS=',' read -r _ left_flank barcode umi right_flank < <(awk -F',' -v chem=$meta.chemistry '\$1 == chem' $flank_seq_config)
105-
IFS=',' read -r _ fwd_primer_f fwd_primer_r rev_primer_f rev_primer_r TSO_f TSO_r < <(awk -F',' -v chem=$meta.chemistry '\$1 == chem' $adapter_seq_config)
98+
IFS=',' read -r _ left_flank barcode umi right_flank flank_max_edit_distance barcode_max_edit_distance < <(awk -F',' -v chem=$meta.chemistry '\$1 == chem' $flexiplex_config)
99+
IFS=',' read -r _ fwd_primer_f fwd_primer_r rev_primer_f rev_primer_r TSO_f TSO_r < <(awk -F',' -v chem=$meta.chemistry '\$1 == chem' $cutadapt_config)
106100
# Store flexiplex search pattern as an array so the '?' wildcards are not expanded as shell globs
107101
flank_seq=(-x "\$left_flank" -b "\$barcode" -u "\$umi" -x "\$right_flank")
108102

0 commit comments

Comments
 (0)