本文整理汇总了Python中Bio.SeqFeature.SeqFeature.qualifiers['method']方法的典型用法代码示例。如果您正苦于以下问题:Python SeqFeature.qualifiers['method']方法的具体用法?Python SeqFeature.qualifiers['method']怎么用?Python SeqFeature.qualifiers['method']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.SeqFeature.SeqFeature
的用法示例。
在下文中一共展示了SeqFeature.qualifiers['method']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: populateFeatures
# 需要导入模块: from Bio.SeqFeature import SeqFeature [as 别名]
# 或者: from Bio.SeqFeature.SeqFeature import qualifiers['method'] [as 别名]
def populateFeatures(tab_file, method):
# read tab FT file
"""
FT CDS complement(<1..174)
FT /colour=4
FT /method="PRODIGAL"
"""
f_input = open (tab_file, 'r')
cds_count = 0
for line in f_input:
values = line.strip().split()
if len(values) == 3:
if values[0] == 'FT' and values[1] == 'CDS':
location = values[2].split('..')
start = location[0]
end = location[1]
strand = 1
if start[0:10] == 'complement':
start = start.split('(')[1]
end = end[:-1]
strand = -1
if start[0] == '>':
start_position = AfterPosition(int(start[1:])-1)
elif start[0] == '<':
start_position = BeforePosition(int(start[1:])-1)
else:
start_position = ExactPosition(int(start)-1)
if end[0] == '>':
end_position = AfterPosition(int(end[1:]))
elif end[0] == '<':
end_position = BeforePosition(int(end[1:]))
else:
end_position = ExactPosition(int(end))
cds_count += 1
cds_feature = SeqFeature(FeatureLocation(start_position, end_position), strand=strand, type="CDS")
cds_feature.qualifiers['method'] = [method]
features.append(cds_feature)
f_input.close()
print "INFO: %s CDS features added from %s" % (cds_count, method)
示例2: populateFeatures
# 需要导入模块: from Bio.SeqFeature import SeqFeature [as 别名]
# 或者: from Bio.SeqFeature.SeqFeature import qualifiers['method'] [as 别名]
def populateFeatures(tab_file):
# read tab FT file
"""
FT rRNA 1436971..1437083
FT /note="5s_rRNA"
FT /method="RNAmmer-1.2"
FT tRNA 1614340..1614416
FT /note="tRNA-Arg(TCT) Cove Score 86.86"
FT /colour=4
FT /method="tRNAscan-SE"
FT misc_feature 695000..700000
FT /colour=255 244 244
FT /algorithm="alien_hunter"
FT /note="threshold: 12.888"
FT /score=14.794
"""
f_input = open (tab_file, 'r')
ft_count = 0
for line in f_input:
values = line.strip().split()
print values
if values[0] == 'FT':
if len(values) == 3:
ft_type = values[1]
print values[2]
location = values[2].split('..')
start = location[0]
end = location[1]
strand = 1
if start[0:10] == 'complement':
start = start.split('(')[1]
end = end[:-1]
strand = -1
if start[0] == '>':
start_position = AfterPosition(int(start[1:])-1)
elif start[0] == '<':
start_position = BeforePosition(int(start[1:])-1)
else:
start_position = ExactPosition(int(start)-1)
if end[0] == '>':
end_position = AfterPosition(int(end[1:]))
elif end[0] == '<':
end_position = BeforePosition(int(end[1:]))
else:
end_position = ExactPosition(int(end))
ft_count += 1
feature = SeqFeature(FeatureLocation(start_position, end_position), strand=strand, type=ft_type)
features.append(feature)
if len(values) == 2:
if values[1].startswith('/note'):
note = values[1].split('"')[1]
feature.qualifiers['note'] = [note]
if values[1].startswith('/method'):
method = values[1].split('"')[1]
feature.qualifiers['method'] = [method]
if values[1].startswith('/algorithm'):
method = values[1].split('"')[1]
feature.qualifiers['method'] = [method]
f_input.close()
print "INFO: %s features added from %s" % (ft_count, method)