Commit b2b22a4f authored by Fabrice  ALLAIN's avatar Fabrice ALLAIN
Browse files

Bug revision: conservation score ignored if missing field

parent 5db6b922
......@@ -89,11 +89,15 @@ class SsList(object):
self.read_indextableplus(filename)
else:
self.read_psipred(filename)
LOG.debug("Secondary structure matrix:\n%s\n"
# TODO: since Protein.set_sec_struct call seq_sublist, should remove
# line below
# if sequence:
# self.seq_sublist(sequence)
LOG.debug("Secondary structure list:\n%s\n"
"Secondary structure dict:\n%s", self.ss_matrix,
self.ssdict)
if sequence:
self.seq_sublist(sequence)
def read_psipred(self, filename):
"""
......@@ -236,6 +240,7 @@ class SsList(object):
:param sequence: input amino acid sequence (one letter format)
:return:
"""
LOG.debug("Adjust sslist related to sequence %s", str(sequence))
tableplus_inv = zip(*self.ss_matrix)
# Get amino acid sequence related to secondary structure prediction
tableplus_seq = "".join(tableplus_inv[1])
......
......@@ -1305,13 +1305,15 @@ class MapFilter(object):
contact_list = mapdict["contactmap"].contact_list()
if sec_struct.filetype != "indextableplus":
LOG.warning("Conservation filter only works with indextableplus "
"files !")
LOG.info("Conservation filter only works with indextableplus "
"files !")
return {'clash': None, 'desc': None}
# parcours la liste de paires dans la matrice struct secondaire
for index, reslist in enumerate(sec_struct.ss_matrix):
if int(reslist[5]) > self.settings["conservation_treshold"] \
# TODO: Initialize conservation score if other value than int
cons_score = int(reslist[5]) if reslist[5] != "-" else 0
if cons_score > self.settings["conservation_treshold"] \
and reslist[1] != 'C':
cons_res.append(index)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment