本文整理汇总了Python中Bio.SeqFeature.SeqFeature.qualifiers['organism']方法的典型用法代码示例。如果您正苦于以下问题:Python SeqFeature.qualifiers['organism']方法的具体用法?Python SeqFeature.qualifiers['organism']怎么用?Python SeqFeature.qualifiers['organism']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.SeqFeature.SeqFeature
的用法示例。
在下文中一共展示了SeqFeature.qualifiers['organism']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doConvert
# 需要导入模块: from Bio.SeqFeature import SeqFeature [as 别名]
# 或者: from Bio.SeqFeature.SeqFeature import qualifiers['organism'] [as 别名]
#.........这里部分代码省略.........
# TODO - Cope with a sequence which ends with N
if seq[-1] != "N":
print "WARNING: sequence ends with N"
for i in range(len(seq)):
if seq[i] == 'N' and not in_N:
start_N = i
in_N = True
if in_N and not seq[i+1] == 'N':
end_N = i + 1
length = end_N - start_N
assert length > 0
assert str(seq[start_N:end_N]) == "N"*length
# do not create FT for 1bp gap
if length > 1:
gap_feature = SeqFeature(FeatureLocation(start_N,end_N), strand=1, type="gap")
gap_feature.qualifiers['estimated_length'] = [length]
gap_features.append(gap_feature)
in_N = False
# ----------------------------------------
# OTHER FEATURE (only with clean option)
# ----------------------------------------
new_features = []
first_source = True
has_source = False
removed_cds = 0
for i in range(len(record.features)):
feature = record.features[i]
# Add strain into FT source
if feature.type == 'source' and first_source:
has_source = True
feature.location.end.position = len(record.seq)
feature.qualifiers['organism'] = ["%s %s" % (organism_name, strain)]
feature.qualifiers['strain'] = [strain]
# Remove qualifier /note & /translation
if clean:
if 'note' in feature.qualifiers.keys():
del feature.qualifiers['note']
#if 'translation' in feature.qualifiers.keys():
# del feature.qualifiers['translation']
# Rename locus_tag
if clean:
if 'locus_tag' in feature.qualifiers.keys():
feature.qualifiers['locus_tag'] = [getLocusTag(feature.qualifiers['locus_tag'][0], locus_tag, feature.type)]
# Check /EC_number="5.3.1.25" or /EC_number="1.1.2.-"
if clean:
if 'EC_number' in feature.qualifiers.keys():
for i in range(len(feature.qualifiers['EC_number'])):
feature.qualifiers['EC_number'][i] = getEcNumber(feature.qualifiers['EC_number'][i])
# Remove (EC 2.1.2.3) in /product and /function
if 'product' in feature.qualifiers.keys():
for i in range(len(feature.qualifiers['product'])):
(feature.qualifiers['product'][i], ec_list) = getValueWithoutEc(feature.qualifiers['product'][i], feature)
if ec_list:
for ec in ec_list:
if 'EC_number' not in feature.qualifiers.keys():
feature.qualifiers['EC_number'] = [ec]
else:
feature.qualifiers['EC_number'].append(ec)
# Remove tRNA /product (not only when containing ???)
if clean: