Skip to content

Commit

Permalink
Merge pull request #1074 from choderalab/modeller
Browse files Browse the repository at this point in the history
Fixing modeller bug for WT case
  • Loading branch information
andrrizzi authored Aug 25, 2018
2 parents da5e152 + a653522 commit 385f0a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions Yank/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@ def apply_mutations_modeller(value):

else:
logger.info('modeller: No mutations will be applied since "WT" specified.')
alignment.append_model(model, align_codes='WT')

process_tool_directive(directives, 'apply_mutations', apply_mutations_modeller, None)

Expand Down
18 changes: 16 additions & 2 deletions Yank/tests/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def test_validation_correct_molecules():
{'filepath': paths['abl'], 'select': 'all', 'pdbfixer': {'replace_nonstandard_residues': True}},
{'filepath': paths['abl'], 'select': 'all', 'pdbfixer': {'apply_mutations': {'chain_id': 'A', 'mutations': 'T85I'}}},
{'filepath': paths['abl'], 'select': 'all', 'modeller': {'apply_mutations': {'chain_id': 'A', 'mutations': 'T85I'}}},
{'filepath': paths['abl'], 'select': 'all', 'modeller': {'apply_mutations': {'chain_id': 'A', 'mutations': 'WT'}}},
{'filepath': paths['abl'], 'select': 'all', 'pdbfixer': {'apply_mutations': {'chain_id': 'A', 'mutations': 'I8A/T9A'}}},
{'filepath': paths['toluene'], 'leap': {'parameters': 'leaprc.gaff'}},
{'filepath': paths['benzene'], 'epik': {'select': 1, 'tautomerize': False}},
Expand Down Expand Up @@ -1335,7 +1336,21 @@ def test_modeller_mutations():
exp_builder._db._setup_molecules(mol_id)
assert not os.path.exists(output_path)

# Now we set the strip_protons options and repeat
# Calling modeller with WT creates a file (although the protein is not mutated).
exp_builder._db.molecules[mol_id]['modeller'] = {
'apply_mutations': {
'chain_id': 'A',
'mutations': 'WT',
}
}
setup_molecule_output_check(exp_builder._db, mol_id, output_path)
os.remove(output_path) # Remove file for next check.


# Reinitialize exp_builder
exp_builder = ExperimentBuilder(yaml_content)

# Now we set the strip_protons options and repeat for the mutant case
exp_builder._db.molecules[mol_id]['modeller'] = {
'apply_mutations': {
'chain_id': 'A',
Expand All @@ -1353,7 +1368,6 @@ def test_modeller_mutations():
break
assert has_mut_residue


def test_pdbfixer_processing():
"""Test that PDB fixer correctly parses and sets up the molecules"""
mol_id = 'Abl'
Expand Down

0 comments on commit 385f0a8

Please sign in to comment.