Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mm_ws = '\n' + (' ' * 17)
mm_str = mm_ws.join([str(mm) for mm in self.mapped_mods])
summary = textwrap.dedent("""
MappedStatement:
original_stmt: {0}
mapped_mods: {1}
mapped_stmt: {2}
""")
return summary.format(self.original_stmt, mm_str, self.mapped_stmt)
def __repr__(self):
return str(self)
class SiteMapper(ProtMapper):
"""
Use site information to fix modification sites in Statements.
This is a wrapper around the protmapper package's ProtMapper class and adds
all the additional functionality to handle INDRA Statements and Agents.
Parameters
----------
site_map : dict (as returned by :py:func:`load_site_map`)
A dict mapping tuples of the form `(gene, orig_res, orig_pos)` to a
tuple of the form `(correct_res, correct_pos, comment)`, where `gene`
is the string name of the gene (canonicalized to HGNC); `orig_res` and
`orig_pos` are the residue and position to be mapped; `correct_res` and
`correct_pos` are the corrected residue and position, and `comment` is
a string describing the reason for the mapping (species error, isoform
error, wrong residue name, etc.).