Skip to content
Snippets Groups Projects
Commit 4c9976aa authored by Clara Serger's avatar Clara Serger
Browse files

Merge branch 'sequence_generator' into 'main'

new file:   read_sequencer_package/generate_sequences.py

See merge request !9
parents 96b55041 38af80ac
No related branches found
No related tags found
1 merge request!9new file: read_sequencer_package/generate_sequences.py
import random
def generate_sequences(n, mean, sd):
"""Summary line.
Generates random sequences.
Args:
n (int): Amount of sequences to generate.
mean (int): mean length of sequence (gaussian distribution).
sd (float): standart deviation of length of sequence (gaussian distribution).
Returns:
list: of n sequences
"""
l1 = []
for i in range(n):
seq = ""
nt = ["A", "T", "C", "G"]
for pos in range(round(random.gauss(mean, sd))):
seq = seq + random.choice(nt)
l1.append(seq)
return l1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment