当前位置: 首页>>代码示例>>Python>>正文


Python SeqFeature.qualifiers["translation"]方法代码示例

本文整理汇总了Python中Bio.SeqFeature.SeqFeature.qualifiers["translation"]方法的典型用法代码示例。如果您正苦于以下问题:Python SeqFeature.qualifiers["translation"]方法的具体用法?Python SeqFeature.qualifiers["translation"]怎么用?Python SeqFeature.qualifiers["translation"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bio.SeqFeature.SeqFeature的用法示例。


在下文中一共展示了SeqFeature.qualifiers["translation"]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: makeNewGene

# 需要导入模块: from Bio.SeqFeature import SeqFeature [as 别名]
# 或者: from Bio.SeqFeature.SeqFeature import qualifiers["translation"] [as 别名]
def makeNewGene(length, protein, frame1, frame2, frame3, gene, seq):
    locusTag = "LG_{}".format(gene["locus_tag"])
    counter = 0
    while counter < 3:
        if counter == 0:
            start = frame1.find(protein)
            if start != -1:
                break
            else:
                counter += 1
        elif counter == 1:
            start = frame2.find(protein)
            if start != -1:
                break
            else:
                counter += 1
        elif counter == 2:
            start = frame3.find(protein)
            if start != -1:
                break
            else:
                counter += 1
    if start != -1:
        nucStart = counter + 3 * start
        nucEnd = nucStart + 3 * length
        if gene["rev_comp"] == 1:
            geneSeq = seq[nucStart:nucEnd]
            geneSeq = geneSeq.reverse_complement()
            seq = seq.reverse_complement()
            nucStart = seq.find(geneSeq)
            nucEnd = nucStart + 3 * length
            newFeature = SeqFeature(FeatureLocation(nucStart, nucEnd, strand = -1), type = "CDS")
            newFeature.qualifiers["locus_tag"] = locusTag
            newFeature.qualifiers["translation"] = protein
        else:
            newFeature = SeqFeature(FeatureLocation(nucStart, nucEnd, strand = 1), type = "CDS")
            newFeature.qualifiers["locus_tag"] = locusTag
            newFeature.qualifiers["translation"] = protein
    return newFeature
开发者ID:pjtatlow,项目名称:geneysis,代码行数:41,代码来源:functions.py

示例2: map

# 需要导入模块: from Bio.SeqFeature import SeqFeature [as 别名]
# 或者: from Bio.SeqFeature.SeqFeature import qualifiers["translation"] [as 别名]
    count = 0;
    for line in orf_tb_file:
        count += 1;
        cds_num = map(int, line.split('\t'))
        cds_seq = seq_record.seq[cds_num[1] - 1:cds_num[2]]
        std = 1
        if cds_num[0] < 0:
            cds_seq = cds_seq.reverse_complement()
            std = -1
            
        cds_translate = str(cds_seq.translate())
        cds_translate = cds_translate[0:len(cds_translate)-1]
        cds_feature = SeqFeature(FeatureLocation(cds_num[1] - 1, cds_num[2], strand = std), type = "CDS")
        cds_feature.qualifiers["locus_tag"] = ['BSNPV' + str(count).zfill(3)]
        cds_feature.qualifiers["codon_start"] = ['1']
        cds_feature.qualifiers["product"] = ['unknown']
        cds_feature.qualifiers["note"] = ['unknown']
        cds_feature.qualifiers["db_xref"] = ['GI:100000' + str(count).zfill(3)]
        cds_feature.qualifiers["translation"] = [cds_translate]
        cds_feature.qualifiers["protein_id"] = ['LP_100000' + str(count).zfill(3)]
        
        seq_record.features.append(cds_feature)
        
    gb_record.append(seq_record)
    
SeqIO.write(gb_record, gb_gn_file, "genbank")

fas_gn_file.close()
orf_tb_file.close()
gb_gn_file.close()  
        
开发者ID:lijax,项目名称:bioscript,代码行数:32,代码来源:fas_orf2fake_gb.py


注:本文中的Bio.SeqFeature.SeqFeature.qualifiers["translation"]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。