Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple mutate fixes #565

Merged
merged 25 commits into from
Apr 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
70c3b27
fixed the system error
csbrasnett Dec 13, 2023
d4c886e
Fixed edge case and tests
csbrasnett Dec 14, 2023
597f64a
moved loop into its own function
csbrasnett Apr 5, 2024
32b2ad9
found a new quote
csbrasnett Apr 5, 2024
f07e228
minor formatting changes
csbrasnett Apr 5, 2024
319ede6
made changes and fixed annotation test
csbrasnett Apr 5, 2024
eab5a1f
Merge branch 'marrink-lab:master' into mutate-fix
csbrasnett Apr 8, 2024
84ba9f5
Update codecov action
pckroon Apr 8, 2024
bc7e724
Don't fail deploy on minor issues
pckroon Apr 8, 2024
2c681be
added and clarified tests
csbrasnett Apr 8, 2024
6988702
Merge branch 'mutate-fix' of https://github.com/csbrasnett/vermouth-m…
csbrasnett Apr 8, 2024
2129a4d
added resid tests
csbrasnett Apr 8, 2024
da16846
added mut/mod examples to help
csbrasnett Apr 8, 2024
0a52393
fixed resid specification and added tests
csbrasnett Apr 8, 2024
311704e
Adapt mutmod warning test to run on System
pckroon Apr 10, 2024
6af9f66
Merge branch 'marrink-lab:master' into mutate-fix
csbrasnett Apr 11, 2024
047b98b
updated mutmod annotating and appropriate tests
csbrasnett Apr 11, 2024
6680cbe
added more conditions and corrected tests
csbrasnett Apr 11, 2024
2933079
changed comments
csbrasnett Apr 11, 2024
5fb2b3c
added more tests to increase coverage
csbrasnett Apr 11, 2024
c4c72f0
removed a degenerate condition
csbrasnett Apr 11, 2024
3e1c5c1
simplified annotation function
csbrasnett Apr 16, 2024
643b7e5
addressed comments
csbrasnett Apr 22, 2024
7224854
removed unnecessary conditions
csbrasnett Apr 23, 2024
431b322
added info to docstring
csbrasnett Apr 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 9 additions & 36 deletions vermouth/processors/annotate_mut_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,19 @@ def annotate_modifications(molecule, modifications, mutations, resspec_counts):
# Ie. the target residue is chain or residue specific
condition0 = ((resspec.get('chain') is not None) and (resspec.get('chain') == chain))
condition1 = ((resspec.get('chain') is None) and (resspec.get('resid') is not None))
if condition0 or condition1:
#if the whole chain is being targeted
condition2 = (resspec.get(chain) == None)
if condition0 or condition1 or condition2:
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
mod_found = _resiter(mod, residue_graph, resspec, library, key, molecule)
if not mod_found:
#if no mod found, return that there's a problem
resspec_counts.append({'status': True,
'condition0': condition0,
'condition1': condition1,
resspec_counts.append({'status': 0,
'mutmod': _format_resname(resspec),
'post': mod,
'current_chain': chain})
'post': mod,})
extra = True
# If every residue on a particular chain is being targeted, go for all of them without concern
elif (resspec.get(chain) is None):
_resiter(mod, residue_graph, resspec, library, key, molecule)
#return that everything's fine by default
if not extra:
resspec_counts.append({'status': False})
resspec_counts.append({'status': 1})
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved

class AnnotateMutMod(Processor):
"""
Expand Down Expand Up @@ -303,30 +299,7 @@ def run_molecule(self, molecule):
return molecule
def run_system(self, system):
super().run_system(system)
_any = any([i['status'] for i in self.resspec_counts])
_all = all([i['status'] for i in self.resspec_counts])
#if the mut/mod hasn't been found anywhere, raise a warning
if _all:
LOGGER.warning('Residue specified by "{}" for mutation "{}" not found anywhere',
_exit = sum([i['status'] for i in self.resspec_counts])
if _exit==0:
csbrasnett marked this conversation as resolved.
Show resolved Hide resolved
LOGGER.warning('Residue specified by "{}" for mutation "{}" not found',
self.resspec_counts[0]['mutmod'], self.resspec_counts[0]['post'])
#if it's been found in some places log it appropriately
if _any and not _all:
for l in self.resspec_counts:
if l['status']==True:
'''
if both conditions were met, then a specific target for both chain and resid
has been failed
'''
if l['condition0'] and l['condition1']:
LOGGER.warning('Residue specified by "{}" for mutation "{}" not found in chain {}',
l['mutmod'], l['post'], l['current_chain'])
#if only condition0 was met, then a chain-wide target has been failed, eg. A-SER:ALA
elif l['condition0'] and not l['condition1']:
LOGGER.warning('Residue specified by "{}" for mutation "{}" not found in chain {}',
l['mutmod'], l['post'], l['current_chain'])
#if only condition1 was met, something like SER2:ALA hasn't been found on a particular chain
#but because _any is True, it has been found elsewhere.
elif l['condition1'] and not l['condition0']:
LOGGER.info('Residue specified by "{}" for mutation "{}" not found on chain {}'
' but found elsewhere',
l['mutmod'], l['post'], l['current_chain'])
Loading