def split_genome(genome, chunk_size=<NUM_LIT>):
chunks = []<EOL>from Bio import SeqIO<EOL>with open(genome) as handle:<EOL><INDENT>for record in SeqIO.parse(handle, "<STR_LIT>"):<EOL><INDENT>sequence = record.seq<EOL>n = len(sequence)<EOL>chunks += [str(sequence[i:min(i + chunk_size, n)])<EOL>for i in range(<NUM_LIT:0>, n, chunk_size)]<EOL><DEDENT><DEDENT>return np.array(chunks)<EOL>
Split genome into chunks of fixed size (save the last one).