【5.4.2.6】cai

五、我的案例

5.1 下载参考基因组

CHO codon usage:

数据库需要处理一下密码子

sed -i 's/GWK/GAT/g' GCA_000448345.1_Cgr1.0_cds_from_genomic.fasta
sed -i 's/ASA/ACA/g' GCA_000448345.1_Cgr1.0_cds_from_genomic.fasta

5.2 生成基因组的condon index

import json
from Bio.SeqUtils.CodonUsage import CodonAdaptationIndex

def get_condon_frequence(ref_genome='/data/user/sam/project/codon_optimization/db/GCA_000448345.1_Cgr1.0_cds_from_genomic_2.fasta'):
    condon = CodonAdaptationIndex()
    condon.generate_index(ref_genome)
    print(condon.print_index())

5.3 计算CAI

cho_cai_index = '/data/user/sam/project/BPKit/data/codon_usage/cho_index.json'
with open(cho_cai_index,'r') as mm:
    cho_cai_index = json.load(mm)

def cal_cai(seq,MyIndex=cho_cai_index):
    condon = CodonAdaptationIndex()
    condon.set_cai_index(MyIndex)
    cai_score = condon.cai_for_gene(seq) *100
    return '%.2f' % cai_score
    # print(cai_score)

参考资料

这里是一个广告位,,感兴趣的都可以发邮件聊聊:tiehan@sina.cn
个人公众号,比较懒,很少更新,可以在上面提问题,如果回复不及时,可发邮件给我: tiehan@sina.cn