Skip to content

Conversation

@amjjbonvin
Copy link
Member

@amjjbonvin amjjbonvin commented Dec 19, 2025

You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines.

Checklist

  • Tests added for the new code
  • Documentation added for the code changes
  • Modifications / enhancements are reflected on the haddock3 user-manual
  • CHANGELOG.md is updated to incorporate new changes
  • Does not break licensing
  • Does not add any dependencies, if it does please add a thorough explanation

Summary of the Pull Request

Corrected symmultimer.cns to read custom symmetry restraints when those are defined.

Add an example illustrating CG docking with custom symmetry restraints

Related Issue

#1465

@amjjbonvin amjjbonvin self-assigned this Dec 19, 2025
@amjjbonvin amjjbonvin added bug Something isn't working m|emref emref module m|flexref flexref module m|mdref mdref module m|rigidbody rigidbody sampling examples labels Dec 19, 2025
@rvhonorato
Copy link
Member

rvhonorato commented Dec 29, 2025

Since this PR is trying to solve a bug, please make sure the new changes are covered by tests.

Looking at the file changes I see you are changing 4 modules, each of them have their own integration_tests/test_<module_name>.py. you can just follow the pattern there and create a new test for each module that takes symtbl_fname for example:

def test_rigidbody_custom_symmetry(rigidbody_module):
    sampling = 2
    rigidbody_module.previous_io = MockPreviousIO(path=rigidbody_module.path)

    rigidbody_module.params["ambig_fname"] = f"{golden_data}/ambig_kaiBpassive.tbl"
    rigidbody_module.params["unambig_fname"] = f"{golden_data}/chain-A-unambig.tbl"
    rigidbody_module.params["symtbl_fname"] = f"{golden_data}/custom_sym_restraints.tbl"
    rigidbody_module.params["randremoval"] = False
    rigidbody_module.params["tolerance"] = 5
    rigidbody_module.params["sampling"] = 50
    rigidbody_module.params["rotate180"] = False
    
    # Symmetry restraints
    rigidbody_module.params["sym_on"] = True
    rigidbody_module.params["c6sym_sta1_1"] = 1
    rigidbody_module.params["c6sym_end1_1"] = 106
    rigidbody_module.params["c6sym_seg1_1"] = "B"
    rigidbody_module.params["c6sym_sta2_1"] = 1
    rigidbody_module.params["c6sym_end2_1"] = 106
    rigidbody_module.params["c6sym_seg2_1"] = "C"
    rigidbody_module.params["c6sym_sta3_1"] = 1
    rigidbody_module.params["c6sym_end3_1"] = 106
    rigidbody_module.params["c6sym_seg3_1"] = "D"
    rigidbody_module.params["c6sym_sta4_1"] = 1
    rigidbody_module.params["c6sym_end4_1"] = 106
    rigidbody_module.params["c6sym_seg4_1"] = "E"
    rigidbody_module.params["c6sym_sta5_1"] = 1
    rigidbody_module.params["c6sym_end5_1"] = 106
    rigidbody_module.params["c6sym_seg5_1"] = "F"
    rigidbody_module.params["c6sym_sta6_1"] = 1
    rigidbody_module.params["c6sym_end6_1"] = 106
    rigidbody_module.params["c6sym_seg6_1"] = "G"
    
    rigidbody_module.run()
    for i in range(1, sampling + 1):
        assert Path(rigidbody_module.path, f"rigidbody_{i}.pdb").exists()
        assert not Path(rigidbody_module.path, f"rigidbody_{i}.out.gz").exists()
        assert not Path(rigidbody_module.path, f"rigidbody_{i}.inp").exists()
        assert not Path(rigidbody_module.path, f"rigidbody_{i}.seed").exists()
        assert Path(rigidbody_module.path, f"rigidbody_{i}.pdb").stat().st_size > 0

The simply run it with python integration_tests/test_rigidbody.py::test_rigidbody_custom_symmetry -v

Looking at your "examples" it seems like this is what you are trying to achieve, these "examples" look more like tests to me. if you need a different input than what is in MockPreviousIO you can also just change it to MockPreviousIOCG or MockPreviousIOSymm or whatever and add the test data to the proper paths (just follow the pattern).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working examples m|emref emref module m|flexref flexref module m|mdref mdref module m|rigidbody rigidbody sampling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants