def save_circos_GC(ref_fpath, reference_length, gc_fpath): window_size = set_window_size(reference_length) with open(gc_fpath, 'w') as out_f: for name, seq_full in fastaparser.read_fasta(ref_fpath): for i in range(0, len(seq_full), window_size): seq = seq_full[i:i + window_size] GC_percent = get_GC_percent(seq, window_size) out_f.write('\t'.join([name, str(i), str(i + window_size), str(GC_percent) + '\n']))