本文整理汇总了Python中match.Match.get_match_info方法的典型用法代码示例。如果您正苦于以下问题:Python Match.get_match_info方法的具体用法?Python Match.get_match_info怎么用?Python Match.get_match_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类match.Match
的用法示例。
在下文中一共展示了Match.get_match_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_matches_per_spec
# 需要导入模块: from match import Match [as 别名]
# 或者: from match.Match import get_match_info [as 别名]
def get_matches_per_spec(mass, param, index, title):
spec_dict = index.spec_dict
unique_pep = index.unique_pep[0]
# search_index = index.search_index
x_residue = param['x_residue']
index_list = index.get_candidates(title)
spec = spec_dict[title]
matches = []
for i in range(len(index_list)):
index1 = index_list[i][0]
index2 = index_list[i][1]
pep1 = unique_pep[index1]
pep2 = unique_pep[index2]
pep_sorted = sorted([pep1, pep2], key = lambda x : x.seq)
pep1 = pep_sorted[0]
pep2 = pep_sorted[1]
ch = spec_dict[title].ch
mz = spec_dict[title].mz
it = spec_dict[title].it
k_pos1 = []
k_pos2 = []
if param['ntermxlink'] == True:
if pep1.is_nterm == True:
k_pos1.append(0)
if pep2.is_nterm == True:
k_pos2.append(0)
pep_seq1 = pep1.seq
k_pos1.extend(list(zip(*filter(lambda x : x[1] == x_residue, enumerate(pep_seq1[:-1])))[0]))
pep_seq2 = pep2.seq
k_pos2.extend(list(zip(*filter(lambda x : x[1] == x_residue, enumerate(pep_seq2[:-1])))[0]))
for p1 in k_pos1:
for p2 in k_pos2:
pos = [p1, p2]
xl = XLink(pep1, pep2, pos, ch, mass, param)
match = Match(spec, xl, mass, param)
match.match(mass)
matches.append(match.get_match_info(index))
return matches