Skip to content
Snippets Groups Projects
Commit b2f1355c authored by U-STI\morika's avatar U-STI\morika
Browse files

fixed ranges to correct # of reads

parent fec9404e
No related branches found
No related tags found
1 merge request!17Issue 7
Pipeline #13676 failed
......@@ -40,7 +40,10 @@ def read_sequencing(frag_file_name, output_file_name, num_reads, read_len, num_s
while frag_line != "":
# To stop when the end of file is reached
if frag_line.startswith('>'):
# Determine if this is the first fragment in the file
# Ignore the description line (starting with >) of the first fragment
if not (len(frag_list) == 0 and frag_str == ""):
# Not the first fragment. Append to list.
frag_list.append(frag_str)
frag_str = ""
else:
......@@ -60,7 +63,7 @@ def read_sequencing(frag_file_name, output_file_name, num_reads, read_len, num_s
sum_frags = sum(map(len, frag_list))
# Repeat the read process for given number of cycles
for j in range(1, num_seq_cyc):
for j in range(0, num_seq_cyc):
# Loop through fasta fragments that start with 5'
for frag in frag_list:
......@@ -70,7 +73,7 @@ def read_sequencing(frag_file_name, output_file_name, num_reads, read_len, num_s
# TODO resolve this issue
num_frag_reads = round((len(frag)/sum_frags) * num_reads)
for i in range(1, num_frag_reads):
for i in range(0, num_frag_reads):
# Obtain random first position for the read on the fragment
rand_start = randrange(0, len(frag))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment