本文整理汇总了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
示例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()