本文整理汇总了Python中RNA.cofold方法的典型用法代码示例。如果您正苦于以下问题:Python RNA.cofold方法的具体用法?Python RNA.cofold怎么用?Python RNA.cofold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RNA
的用法示例。
在下文中一共展示了RNA.cofold方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: score_match
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import cofold [as 别名]
def score_match(query):
motif = 'CCTCCT'
length = len(motif)
score = RNA.cofold(query + '&' + motif)
return score[1]
示例2: score_match
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import cofold [as 别名]
def score_match(query):
motif = 'CCTCCT'
length = len(motif)
co = RNA.cofold(query + '&' + motif)
示例3: range
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import cofold [as 别名]
db_list = database.readlines()
mirna = [] # 2D list store the mirna name & seq
result_xy = [] # 3D list store the mirna pairs with their del G
for i in range(0, len(db_list)-1, 2): # notice the last line is blank
mirna.append([db_list[i][:-1], # -1 in linux, -2 in windows
db_list[i+1][:-1]
]) # mirna:[name,seq]
for i in range(len(mirna)):
for j in range(i, len(mirna)):
result_xy.append([mirna[i][0],
mirna[j][0],
(RNA.cofold(mirna[i][1]+'&'+mirna[j][1]))[1]
])
screened_result_xy = screen(result_xy)
pick_lower(screened_result_xy)
del_tail(screened_result_xy) # result_xy would be edited
sorted_result_xy = sorted(screened_result_xy, key=operator.itemgetter(2)) # sort by element 3
with open("output/free_energy.csv", "w+") as output_sorted_xy:
output_sorted_xy.write('mirna_1'+'\t'+'mirna_2'+'\t'+'free energy/kcal'+'\n')
print_list_csv(sorted_result_xy, output_sorted_xy)
print('Done.Results saved in output/free_energy.csv')