diff --git a/src/read_sequencing.py b/src/read_sequencing.py index aaec0e9f48c077f7cc5e3c3e2e2cc75f331c9562..f970db373326fed9c580323ae020cec9be9b80c7 100644 --- a/src/read_sequencing.py +++ b/src/read_sequencing.py @@ -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))