def split_by_fixed_size_onefile(infile, outfile, chunk_size, tolerance, skip_if_all_Ns=False):
seq_reader = sequences.file_reader(infile)<EOL>f_out = utils.open_file_write(outfile)<EOL>for seq in seq_reader:<EOL><INDENT>for i in range(<NUM_LIT:0>, len(seq), chunk_size):<EOL><INDENT>if i + chunk_size + tolerance >= len(seq):<EOL><INDENT>end = len(seq)<EOL><DEDENT>else:<EOL><INDENT>end = i + chunk_size<EOL><DEDENT>subseq = seq.subseq(i, end)<EOL>if not (skip_if_all_Ns and subseq.is_all_Ns()):<EOL><INDENT>subseq.id += '<STR_LIT:.>' + str(i+<NUM_LIT:1>) + '<STR_LIT:_>' + str(end)<EOL>print(subseq, file=f_out)<EOL><DEDENT>if end == len(seq):<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>utils.close(f_out)<EOL>
Splits each sequence in infile into chunks of fixed size, last chunk can be up to
       (chunk_size + tolerance) in length