Skip to content

Commit

Permalink
Merge pull request #49 from maressyl/fix-molLength
Browse files Browse the repository at this point in the history
Fix undesirable molecule length randomness in generate_molecules.py
  • Loading branch information
baraaorabi authored Jun 6, 2023
2 parents 1d544aa + 9eab57e commit aa3cb9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simulating/generate_molecules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit aa3cb9a

Please sign in to comment.