예제 #1
0
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']))
예제 #2
0
파일: basic_stats.py 프로젝트: A-Tsai/quast
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']))