From 9eab57efbdb91da6cf5e64ac51050bdc15ba14db Mon Sep 17 00:00:00 2001 From: Sylvain Mareschal Date: Tue, 6 Jun 2023 17:55:17 +0200 Subject: [PATCH] Fix undesirable molecule length randomness in generate_molecules.py --- simulating/generate_molecules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulating/generate_molecules.py b/simulating/generate_molecules.py index 9b14b02..659eae8 100644 --- a/simulating/generate_molecules.py +++ b/simulating/generate_molecules.py @@ -97,7 +97,7 @@ def generate_molecules_from_bed(genome_file_path, chr,pos = get_chr_pos_from_abs_postion(position=random.randint(1,genome_length), lengths=chrom_lengths) gene = 'no_gene' start = pos - math.floor(random.normalvariate(mu=mol_len/2, sigma=15)) - end = pos + mol_len + end = start + mol_len if start <= 0 or end > len(genome[chr]): continue molecules.append((chr, gene, start, end))