From 8d3c47339679b16ebe8f107bb73a4a18b6750077 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Wed, 31 Jul 2024 10:54:46 +0200 Subject: [PATCH] fix random choices --- src/bd_rhapsody/bd_rhapsody_sequence_analysis/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bd_rhapsody/bd_rhapsody_sequence_analysis/test.py b/src/bd_rhapsody/bd_rhapsody_sequence_analysis/test.py index 81395680..409cfd43 100644 --- a/src/bd_rhapsody/bd_rhapsody_sequence_analysis/test.py +++ b/src/bd_rhapsody/bd_rhapsody_sequence_analysis/test.py @@ -185,7 +185,8 @@ def generate_bd_read( # generate r1 (cls1 + link + cls2 + link + cls3 + umi) assert cell_index >= 0 and cell_index < 384 * 384 * 384 cell_label = index_to_sequence(cell_index + 1, bead_version=bead_version) - umi = ''.join(random.choice(["A", "C", "G", "T"], size=umi_length, replace=True)) + # sample random umi + umi = "".join(random.choices("ACGT", k=umi_length)) quality_r1 = "I" * (len(cell_label) + len(umi)) r1 = f"{meta_r1}\n{cell_label}{umi}\n+\n{quality_r1}\n"