Skip to content

Commit af447b3

Browse files
committed
fix status variable names
1 parent 2d2be42 commit af447b3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

harpy/demultiplex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def demultiplex():
3939

4040
@click.command(no_args_is_help = True, context_settings=dict(allow_interspersed_args=False), epilog = "Documentation: https://pdimens.github.io/harpy/workflows/demultiplex/")
4141
@click.option('-s', '--schema', required = True, type=click.Path(exists=True, dir_okay=False, readable=True), help = 'File of `sample`\\<TAB\\>`barcode`')
42-
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 1, max_open = True), help = 'Number of threads to use')
42+
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 2, max_open = True), help = 'Number of threads to use')
4343
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Demultiplex", show_default=True, help = 'Output directory name')
4444
@click.option('-q', '--qx-rx', is_flag = True, default = False, help = 'Include the `QX:Z` and `RX:Z` tags in the read header')
4545
@click.option('--container', is_flag = True, default = False, help = 'Use a container instead of conda')

harpy/scripts/demultiplex_gen1.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def get_read_codes(index_read, left_segment, right_segment):
9393
open(snakemake.output.bx_info, 'w') as BC_log
9494
):
9595
for r1_rec, r2_rec, i1_rec, i2_rec in zip(R1, R2, I1, I2):
96-
segments['A'], segments['C'], statusR1 = get_read_codes(i1_rec.sequence, "C", "A")
97-
segments['B'], segments['D'], statusR2 = get_read_codes(i2_rec.sequence, "D", "B")
96+
segments['A'], segments['C'], R1_status = get_read_codes(i1_rec.sequence, "C", "A")
97+
segments['B'], segments['D'], R2_status = get_read_codes(i2_rec.sequence, "D", "B")
9898
if segments[id_letter] not in id_segments:
9999
continue
100-
statuses = [status_R1, statusR2]
100+
statuses = [R1_status, R2_status]
101101
BX_code = segments['A'] + segments['C'] + segments['B']+ segments['D']
102102
bc_tags = f"BX:Z:{BX_code}"
103103
if qxrx:
@@ -107,6 +107,7 @@ def get_read_codes(index_read, left_segment, right_segment):
107107
R1_out.write(f"{r1_rec}\n")
108108
R2_out.write(f"{r2_rec}\n")
109109

110+
# logging barcode identification
110111
if "unclear" in statuses:
111112
if BX_code in unclear_read_map:
112113
unclear_read_map[BX_code] += 1

0 commit comments

Comments
 (0)