Skip to content

Commit d4c9ef2

Browse files
authored
Added brackets around sample barcode regex (#21)
For more complicated sample barcode regex other than the simple "A[0-9][0-9]" format, brackets are necessary for defining the correct barcode pattern
1 parent 2db91be commit d4c9ef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shareseq.smk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ rule atac_split_samples:
280280
output:
281281
fragments = temp('ATAC/sublibraries/{sublibrary}/{sample}.tsv.zst'),
282282
params:
283-
barcode_pattern = lambda w: f"\t{config['samples'][w.sample]}\\+",
283+
barcode_pattern = lambda w: f"\t({config['samples'][w.sample]})\\+",
284284
sublibrary_id = lambda w: w.sublibrary
285285
threads: 4
286286
shell: "zstd -dc {input.fragments} | "
@@ -540,7 +540,7 @@ rule rna_unique_cells_sample:
540540
output:
541541
cells = 'RNA/samples/{sample}.barcodes.tsv.gz'
542542
params:
543-
barcode_pattern = lambda w: f"_{config['samples'][w.sample]}\\+"
543+
barcode_pattern = lambda w: f"_({config['samples'][w.sample]})\\+"
544544
shell: "gzip -dc {input.cells} | "
545545
"grep -E '{params.barcode_pattern}' | "
546546
"sort --unique | gzip > {output.cells}"
@@ -573,7 +573,7 @@ rule rna_mtx_chunk_sample:
573573
script = srcdir("scripts/shareseq/mtx_from_counts.py"),
574574
memory = "4G",
575575
sublibrary_id = lambda w: w.sublibrary,
576-
barcode_pattern = lambda w: f"\t{config['samples'][w.sample]}\\+"
576+
barcode_pattern = lambda w: f"\t({config['samples'][w.sample]})\\+"
577577
threads: 4
578578
shell: "zstd -dc {input.counts} | "
579579
"grep -E '{params.barcode_pattern}' | " # Filter to sample

0 commit comments

Comments
 (0)