control_enrichment.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:MIRA 作者: comprna 项目源码 文件源码
def get_fasta_seq_dictonary(fa_file):
    #returns fasta files dictonary for length and gc content

    dict_fa = {}

    for seq_record in SeqIO.parse(fa_file, "fasta"):
        fa_id = seq_record.id
        faseq = seq_record.seq
        gc_count = GC(faseq)
        seq_len = len(faseq)

        #calculate gc content distribution to nearest 10
        gc_content_decimal_distribution = math.floor(gc_count / 10) * 10 #10-bin window
        #gc_content_decimal_distribution = gc_count/seq_len

        dict_fa[fa_id] = [faseq, seq_len, gc_content_decimal_distribution]


    return dict_fa
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号