From dc43e8efe87f863e54a2b8e1a34df8298a26ec6f Mon Sep 17 00:00:00 2001 From: VGPReys Date: Wed, 14 Aug 2024 12:13:38 +0200 Subject: [PATCH 01/13] on the fly computation of nfle --- src/haddock/gear/expandable_parameters.py | 29 ++++++++---- src/haddock/gear/prepare_run.py | 47 +++++++++++++------ .../modules/refinement/emref/defaults.yaml | 2 +- .../modules/refinement/flexref/defaults.yaml | 2 +- .../modules/refinement/mdref/defaults.yaml | 2 +- 5 files changed, 55 insertions(+), 27 deletions(-) diff --git a/src/haddock/gear/expandable_parameters.py b/src/haddock/gear/expandable_parameters.py index 71d6e9765..0fddcab5c 100644 --- a/src/haddock/gear/expandable_parameters.py +++ b/src/haddock/gear/expandable_parameters.py @@ -109,8 +109,9 @@ # common error messages _emsg_num_differ = ( "The parameter block {!r} expects " - "{} parameters, but {} are present " - "in the user configuration file: {}." + "{} parameters ({}), but {} are present " + "in the user configuration file: {}. " + "Parameter(s) {} are missing." ) @@ -249,7 +250,7 @@ def _read_groups_in_user_config( extract_params: Callable[..., set[str]], _emsg_no_group: str = "Parameter block is not a valid expandable group", _emsg_unexpected_params: str = "Unexpected params for group", -) -> set[str]: +) -> tuple[set[str], dict[str, int]]: """ Read groups in user config. @@ -279,15 +280,18 @@ def _read_groups_in_user_config( Returns ------- - set + new : set[str] A set with the new parameters in the user configuration file that are acceptable according to the expandable rules. + param_name_counts : dict[str, int] + Count of expendable parameter parameter name """ # minimum=1 is used to capture groups with missing parameters user_groups = get_user_groups(user_config, minimum=1, reference=False) default_group_names = set(group[0] for group in default_groups) new: set[str] = set() + param_name_counts: dict[str, int] = {} for (param_name, group_idx), params in user_groups.items(): if param_name not in default_group_names: emsg = _emsg_no_group.format(param_name, group_idx) @@ -311,35 +315,40 @@ def _read_groups_in_user_config( # when num_found > num_expected the error about in `diff` is # triggered instead if num_found != num_expected: + expected_missings = set(expected_params).difference(params) emsg = _emsg_num_differ.format( param_name, num_expected, + ", ".join(expected_params), num_found, ", ".join(params), + ", ".join([f"`{p}`" for p in expected_missings]), ) raise ConfigurationError(emsg) related_params = extract_params(user_config, param_name, group_idx) + # Increment counts for this parameter + if related_params: + param_name_counts.setdefault(param_name, 0) + param_name_counts[param_name] = int(group_idx) new.update(related_params) - - return new + return new, param_name_counts def read_simplest_expandable( - expparams: Iterable[str], config: Iterable[str] + config: Iterable[str], expparams: Iterable[str], ) -> set[str]: """ Read expandable parameters from config file of the type `param_1`. Parameters ---------- + config : dict, dict.keys, set, or alike + The user configuration file. expparams : dict, dict.keys, set, or alike The parameter names that should be considered as expandable. Usually, this is a module subdictionary of `type_simplest_ep`. - config : dict, dict.keys, set, or alike - The user configuration file. - Returns ------- set of str diff --git a/src/haddock/gear/prepare_run.py b/src/haddock/gear/prepare_run.py index 075d2e548..9fcbdc119 100644 --- a/src/haddock/gear/prepare_run.py +++ b/src/haddock/gear/prepare_run.py @@ -1017,25 +1017,44 @@ def get_expandable_parameters( def _get_expandable( user_config: ParamMap, defaults: ParamMap, module_name: str, max_mols: int ) -> set[str]: - type_1 = get_single_index_groups(defaults) - type_2 = get_multiple_index_groups(defaults) - type_4 = get_mol_parameters(defaults) - + # Set parsing vars allowed_params: set[str] = set() - allowed_params.update( - read_single_idx_groups_user_config(user_config, type_1) - ) # noqa: E501 - allowed_params.update( - read_multiple_idx_groups_user_config(user_config, type_2) - ) # noqa: E501 + all_counts: dict[str, int] = {} + # Read single indexed groups (terminating by `_X`) + news_t1, counts_t1 = read_single_idx_groups_user_config( + user_config, + get_single_index_groups(defaults), + ) + allowed_params.update(news_t1) + all_counts.update(counts_t1) + # Read multiple indexed groups (terminating by `_X_Y`) + news_t2, counts_t2 = read_multiple_idx_groups_user_config( + user_config, + get_multiple_index_groups(defaults), + ) + allowed_params.update(news_t2) + all_counts.update(counts_t2) with suppress(KeyError): - type_3 = type_simplest_ep[get_module_name(module_name)] - allowed_params.update(read_simplest_expandable(type_3, user_config)) - - _ = read_mol_parameters(user_config, type_4, max_mols=max_mols) + news_t3 = read_simplest_expandable( + user_config, + type_simplest_ep[get_module_name(module_name)], + ) + allowed_params.update(news_t3) + # Read molecule paramters (starting by `mol_`) + _ = read_mol_parameters( + user_config, + get_mol_parameters(defaults), + max_mols=max_mols, + ) allowed_params.update(_) + # Add counted parameters to hidden user parameters + for param, count in all_counts.items(): + count_param_name = f"n{param}" + if count_param_name in defaults.keys(): + user_config[count_param_name] = count + # Return new set of allowed parameters return allowed_params diff --git a/src/haddock/modules/refinement/emref/defaults.yaml b/src/haddock/modules/refinement/emref/defaults.yaml index db7c386c8..f22d107c0 100644 --- a/src/haddock/modules/refinement/emref/defaults.yaml +++ b/src/haddock/modules/refinement/emref/defaults.yaml @@ -2096,7 +2096,7 @@ nfle: If >=1 then those must be defined manually with starting and end residue numbers in the fle_sta_* and fle_end_* variables and segment ID (segid) in the fle_seg_* variable. group: 'flexibility' - explevel: expert + explevel: hidden fle_sta_1: default: .nan type: integer diff --git a/src/haddock/modules/refinement/flexref/defaults.yaml b/src/haddock/modules/refinement/flexref/defaults.yaml index 7989eaa44..f0e1d54fd 100644 --- a/src/haddock/modules/refinement/flexref/defaults.yaml +++ b/src/haddock/modules/refinement/flexref/defaults.yaml @@ -2639,7 +2639,7 @@ nfle: If >=1 then those must be defined manually with starting and end residue numbers in the fle_sta_* and fle_end_* variables and segment ID (segid) in the fle_seg_* variable. group: 'flexibility' - explevel: expert + explevel: hidden fle_sta_1: default: .nan type: integer diff --git a/src/haddock/modules/refinement/mdref/defaults.yaml b/src/haddock/modules/refinement/mdref/defaults.yaml index 8714a22b5..cd2d255d6 100644 --- a/src/haddock/modules/refinement/mdref/defaults.yaml +++ b/src/haddock/modules/refinement/mdref/defaults.yaml @@ -2195,7 +2195,7 @@ nfle: If >=1 then those must be defined manually with starting and end residue numbers in the fle_sta_* and fle_end_* variables and segment ID (segid) in the fle_seg_* variable. group: 'flexibility' - explevel: expert + explevel: hidden fle_sta_1: default: .nan type: integer From 2a4100db9085a31c2f51e1784996a695ffc2e68e Mon Sep 17 00:00:00 2001 From: VGPReys Date: Wed, 14 Aug 2024 12:16:39 +0200 Subject: [PATCH 02/13] removing nfle parameter from examples --- .../docking-flexref-protein-glycan-full.cfg | 1 - .../docking-flexref-protein-glycan-test.cfg | 1 - .../docking-protein-peptide-cltsel-full.cfg | 2 -- .../docking-protein-peptide/docking-protein-peptide-full.cfg | 2 -- .../docking-protein-peptide-mdref-full.cfg | 2 -- .../docking-protein-peptide-mdref-test.cfg | 2 -- .../docking-protein-peptide/docking-protein-peptide-test.cfg | 5 +++-- 7 files changed, 3 insertions(+), 12 deletions(-) diff --git a/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg b/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg index 446b65d7e..e2db10af4 100644 --- a/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg +++ b/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg @@ -43,7 +43,6 @@ mdsteps_cool2 = 10000 mdsteps_cool3 = 10000 ambig_fname = "data/ambig.tbl" # give full flexibilit to the glycan -nfle = 1 fle_sta_1 = 1 fle_end_1 = 4 fle_seg_1 = "B" diff --git a/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg b/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg index 7fc02c3ff..9900453b2 100644 --- a/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg +++ b/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg @@ -39,7 +39,6 @@ mdsteps_cool2 = 10000 mdsteps_cool3 = 10000 ambig_fname = "data/ambig.tbl" # give full flexibilit to the glycan -nfle = 1 fle_sta_1 = 1 fle_end_1 = 4 fle_seg_1 = "B" diff --git a/examples/docking-protein-peptide/docking-protein-peptide-cltsel-full.cfg b/examples/docking-protein-peptide/docking-protein-peptide-cltsel-full.cfg index 3e6f2e3f6..0fe0e8f6d 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-cltsel-full.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-cltsel-full.cfg @@ -51,7 +51,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" @@ -72,7 +71,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" diff --git a/examples/docking-protein-peptide/docking-protein-peptide-full.cfg b/examples/docking-protein-peptide/docking-protein-peptide-full.cfg index 08e0c49de..45b23459a 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-full.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-full.cfg @@ -45,7 +45,6 @@ select = 400 tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" @@ -65,7 +64,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" diff --git a/examples/docking-protein-peptide/docking-protein-peptide-mdref-full.cfg b/examples/docking-protein-peptide/docking-protein-peptide-mdref-full.cfg index ce095acbe..064d8363f 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-mdref-full.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-mdref-full.cfg @@ -45,7 +45,6 @@ select = 400 tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" @@ -65,7 +64,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 5 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" diff --git a/examples/docking-protein-peptide/docking-protein-peptide-mdref-test.cfg b/examples/docking-protein-peptide/docking-protein-peptide-mdref-test.cfg index 4da16060b..7571f8fb5 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-mdref-test.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-mdref-test.cfg @@ -39,7 +39,6 @@ select = 5 tolerance = 20 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" @@ -60,7 +59,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 20 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" diff --git a/examples/docking-protein-peptide/docking-protein-peptide-test.cfg b/examples/docking-protein-peptide/docking-protein-peptide-test.cfg index 6c819ee2e..9b1b8a80b 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-test.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-test.cfg @@ -39,13 +39,15 @@ select = 5 tolerance = 20 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 2 fle_sta_1 = 1 fle_end_1 = 5 fle_seg_1 = "B" fle_sta_2 = 6 fle_end_2 = 11 fle_seg_2 = "B" +#nseg1 = 2 +#seg_sta_1_1 = 1 +#seg_end_1_1 = 5 # Define automatically dihedral restraints # for alpha and beta secondary structure elements ssdihed = "alphabeta" @@ -63,7 +65,6 @@ reference_fname = "data/1nx1_refe.pdb" tolerance = 20 ambig_fname = "data/ambig.tbl" # Define peptide as fully flexible -nfle = 1 fle_sta_1 = 1 fle_end_1 = 11 fle_seg_1 = "B" From f95161b4675ef34c43c71a0602018c262e642dc7 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Wed, 14 Aug 2024 12:19:58 +0200 Subject: [PATCH 03/13] removing commented lines --- .../docking-protein-peptide/docking-protein-peptide-test.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/docking-protein-peptide/docking-protein-peptide-test.cfg b/examples/docking-protein-peptide/docking-protein-peptide-test.cfg index 9b1b8a80b..672ae43ba 100644 --- a/examples/docking-protein-peptide/docking-protein-peptide-test.cfg +++ b/examples/docking-protein-peptide/docking-protein-peptide-test.cfg @@ -45,9 +45,6 @@ fle_seg_1 = "B" fle_sta_2 = 6 fle_end_2 = 11 fle_seg_2 = "B" -#nseg1 = 2 -#seg_sta_1_1 = 1 -#seg_end_1_1 = 5 # Define automatically dihedral restraints # for alpha and beta secondary structure elements ssdihed = "alphabeta" From 48582b0734f0141b3201e48e96d9203871b25182 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 09:53:21 +0200 Subject: [PATCH 04/13] add new tests for counts checks --- src/haddock/gear/expandable_parameters.py | 2 +- tests/test_gear_expandable_parameters.py | 117 ++++++++++++++++++---- 2 files changed, 101 insertions(+), 18 deletions(-) diff --git a/src/haddock/gear/expandable_parameters.py b/src/haddock/gear/expandable_parameters.py index 0fddcab5c..db41380ad 100644 --- a/src/haddock/gear/expandable_parameters.py +++ b/src/haddock/gear/expandable_parameters.py @@ -330,7 +330,7 @@ def _read_groups_in_user_config( # Increment counts for this parameter if related_params: param_name_counts.setdefault(param_name, 0) - param_name_counts[param_name] = int(group_idx) + param_name_counts[param_name] += 1 new.update(related_params) return new, param_name_counts diff --git a/tests/test_gear_expandable_parameters.py b/tests/test_gear_expandable_parameters.py index 559f83c77..be3173ca9 100644 --- a/tests/test_gear_expandable_parameters.py +++ b/tests/test_gear_expandable_parameters.py @@ -1,6 +1,6 @@ """Test expandable parameter modules.""" -import importlib +import importlib import pytest from haddock.core.exceptions import ConfigurationError @@ -423,7 +423,7 @@ def test_read_single_idx_groups_user_config( expected, ): """Test read single index groups in user config.""" - result = read_single_idx_groups_user_config(user_config, default_groups) + result, _ = read_single_idx_groups_user_config(user_config, default_groups) assert result == expected @@ -431,32 +431,115 @@ def test_read_single_idx_groups_user_config( "user_config,default_groups,expected", [ ( - {"param_other_1", "param_else_1", - "param_other_2", "param_else_2", - "param_1", - "param_sam_1_1", "param_frodo_1_1", - "param_sam_1_2", "param_frodo_1_2", - "param_sam_2_1", "param_frodo_2_1", - }, - {("param1", "1"): {"sam", "frodo"}, - ("param2", "1"): {"sam", "frodo"}}, - {"param_frodo_1_1", "param_sam_1_1", - "param_frodo_1_2", "param_sam_1_2", - "param_sam_2_1", "param_frodo_2_1", - }, + # user_config + { + "param_other_1", "param_else_1", # param 1 + "param_other_2", "param_else_2", # param 2 + "param_1", # not a single index group + "param_other_1_1", # multiple index group + }, + # default_groups + { + ("param", "1"): {"other", "else"}, + }, + # expected + { + "param": 2, + }, ), ] ) -def test_read_multiple_idx_groups_user_config( +def test_read_single_idx_groups_user_config_count( user_config, default_groups, expected, ): """Test read single index groups in user config.""" - result = read_multiple_idx_groups_user_config(user_config, default_groups) + _, counts = read_single_idx_groups_user_config(user_config, default_groups) + assert counts == expected + + +@pytest.mark.parametrize( + "user_config,default_groups,expected", + [ + ( + # user_config + { + # single index ones should NOT be considered + "param_other_1", "param_else_1", + "param_other_2", "param_else_2", + "param_1", + # multiple index ones should be considered + "param_sam_1_1", "param_frodo_1_1", + "param_sam_1_2", "param_frodo_1_2", + "param_sam_2_1", "param_frodo_2_1", + }, + # default_groups + { + ("param1", "1"): {"sam", "frodo"}, + ("param2", "1"): {"sam", "frodo"}, + }, + # expected + { + "param_frodo_1_1", "param_sam_1_1", + "param_frodo_1_2", "param_sam_1_2", + "param_sam_2_1", "param_frodo_2_1", + }, + ), + ] + ) +def test_read_multiple_idx_groups_user_config( + user_config, + default_groups, + expected, + ): + """Test read multiple index groups in user config.""" + result, _ = read_multiple_idx_groups_user_config( + user_config, default_groups, + ) assert result == expected +@pytest.mark.parametrize( + "user_config,default_groups,expected", + [ + ( + # user_config + { + # single index ones should NOT be considered + "param_other_1", "param_else_1", + "param_other_2", "param_else_2", + "param_1", + # multiple index ones should be considered + "param_sam_1_1", "param_frodo_1_1", # param1 1 + "param_sam_1_2", "param_frodo_1_2", # param1 2 + "param_sam_2_1", "param_frodo_2_1", # param2 1 + }, + # default_groups + { + ("param1", "1"): {"sam", "frodo"}, + ("param2", "1"): {"sam", "frodo"}, + }, + # expected counts + { + "param1": 2, + "param2": 1, + }, + ), + ] + ) +def test_read_multiple_idx_groups_user_config_counts( + user_config, + default_groups, + expected, + ): + """Test counts multiple index groups in user config.""" + _, counts = read_multiple_idx_groups_user_config( + user_config, default_groups, + ) + assert counts == expected + + @pytest.mark.parametrize( "user_config,default_groups", [ From 6e7e60ebf89a1287df77d1afea024e33fa0da708 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 11:10:27 +0200 Subject: [PATCH 05/13] also update symmetry parameters / cns code --- .../docking-protein-homotrimer-full.cfg | 6 ---- .../docking-protein-homotrimer-test.cfg | 8 +----- .../modules/refinement/emref/cns/emref.cns | 12 ++++---- .../refinement/emref/cns/symmultimer.cns | 12 ++++---- .../modules/refinement/emref/defaults.yaml | 28 +++++++++---------- .../refinement/flexref/cns/check-homomers.cns | 12 ++++---- .../refinement/flexref/cns/flexref.cns | 12 ++++---- .../refinement/flexref/cns/symmultimer.cns | 12 ++++---- .../modules/refinement/flexref/defaults.yaml | 28 +++++++++---------- .../modules/refinement/mdref/cns/mdref.cns | 12 ++++---- .../refinement/mdref/cns/symmultimer.cns | 12 ++++---- .../modules/refinement/mdref/defaults.yaml | 28 +++++++++---------- .../sampling/rigidbody/cns/check-homomers.cns | 12 ++++---- .../sampling/rigidbody/cns/randomairs.cns | 4 +-- .../sampling/rigidbody/cns/rigidbody.cns | 24 ++++++++-------- .../sampling/rigidbody/cns/symmultimer.cns | 12 ++++---- .../modules/sampling/rigidbody/defaults.yaml | 16 +++++------ 17 files changed, 119 insertions(+), 131 deletions(-) diff --git a/examples/docking-protein-homotrimer/docking-protein-homotrimer-full.cfg b/examples/docking-protein-homotrimer/docking-protein-homotrimer-full.cfg index cb519bef4..511f316cb 100644 --- a/examples/docking-protein-homotrimer/docking-protein-homotrimer-full.cfg +++ b/examples/docking-protein-homotrimer/docking-protein-homotrimer-full.cfg @@ -41,7 +41,6 @@ ambig_fname = "data/1qu9_whiscy_air.tbl" sampling = 2000 # Define CNS restraints between molecules ncs_on = true -numncs = 2 ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" @@ -56,7 +55,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" @@ -79,7 +77,6 @@ tolerance = 5 ambig_fname = "data/1qu9_whiscy_air.tbl" # Define NCS restraints between molecules ncs_on = true -numncs = 2 ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" @@ -94,7 +91,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" @@ -113,7 +109,6 @@ tolerance = 5 ambig_fname = "data/1qu9_whiscy_air.tbl" # Define NCS restraints between molecules ncs_on = true -numncs = 2 ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" @@ -128,7 +123,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" diff --git a/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg b/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg index 2be4416c8..33980d886 100644 --- a/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg +++ b/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg @@ -36,8 +36,7 @@ ambig_fname = "data/1qu9_whiscy_air.tbl" sampling = 20 # Define NCS restraints between molecules ncs_on = true -numncs = 2 -ncs_sta1_1=2 +ncs_sta1_1=1 ncs_end1_1=128 ncs_seg1_1="A" ncs_sta2_1=2 @@ -51,7 +50,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" @@ -74,7 +72,6 @@ tolerance = 20 ambig_fname = "data/1qu9_whiscy_air.tbl" # Define NCS restraints between molecules ncs_on = true -numncs = 2 ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" @@ -89,7 +86,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" @@ -108,7 +104,6 @@ tolerance = 20 ambig_fname = "data/1qu9_whiscy_air.tbl" # Define NCS restraints between molecules ncs_on = true -numncs = 2 ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" @@ -123,7 +118,6 @@ ncs_end2_2=128 ncs_seg2_2="C" # Define C3 symmetry restraints sym_on = true -numc3sym = 1 c3sym_sta1_1=2 c3sym_end1_1=128 c3sym_seg1_1="A" diff --git a/src/haddock/modules/refinement/emref/cns/emref.cns b/src/haddock/modules/refinement/emref/cns/emref.cns index 60f72c296..76006e293 100644 --- a/src/haddock/modules/refinement/emref/cns/emref.cns +++ b/src/haddock/modules/refinement/emref/cns/emref.cns @@ -64,12 +64,12 @@ evaluate ($data.numncs = $numncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) evaluate ($Data.flags.sym = $sym_on) -evaluate ($data.numc2sym = $numc2sym) -evaluate ($data.numc3sym = $numc3sym) -evaluate ($data.nums3sym = $nums3sym) -evaluate ($data.numc4sym = $numc4sym) -evaluate ($data.numc5sym = $numc5sym) -evaluate ($data.numc6sym = $numc6sym) +evaluate ($data.nc2sym = $nc2sym) +evaluate ($data.nc3sym = $nc3sym) +evaluate ($data.ns3sym = $ns3sym) +evaluate ($data.nc4sym = $nc4sym) +evaluate ($data.nc5sym = $nc5sym) +evaluate ($data.nc6sym = $nc6sym) !Dihedral angle energy term: evaluate ($data.flags.dihed = true) diff --git a/src/haddock/modules/refinement/emref/cns/symmultimer.cns b/src/haddock/modules/refinement/emref/cns/symmultimer.cns index 662bfa630..4bc582995 100644 --- a/src/haddock/modules/refinement/emref/cns/symmultimer.cns +++ b/src/haddock/modules/refinement/emref/cns/symmultimer.cns @@ -18,7 +18,7 @@ if ($Data.flags.sym eq true) then ! Define C2 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc2sym) loop c2symloop + while ($ncount < $data.nc2sym) loop c2symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c2sym_sta1_$ncount) @@ -65,7 +65,7 @@ if ($Data.flags.sym eq true) then ! Define C3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc3sym) loop c3symloop + while ($ncount < $data.nc3sym) loop c3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c3sym_sta1_$ncount) @@ -142,7 +142,7 @@ if ($Data.flags.sym eq true) then ! Define S3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.nums3sym) loop s3symloop + while ($ncount < $data.ns3sym) loop s3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $s3sym_sta1_$ncount) @@ -218,7 +218,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc4sym) loop c4symloop + while ($ncount < $data.nc4sym) loop c4symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c4sym_sta1_$ncount) @@ -369,7 +369,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 4) eval ($ncount = 0) - while ($ncount < $data.numc5sym) loop c5symloop + while ($ncount < $data.nc5sym) loop c5symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c5sym_sta1_$ncount) @@ -482,7 +482,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc6sym) loop c6symloop + while ($ncount < $data.nc6sym) loop c6symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c6sym_sta1_$ncount) diff --git a/src/haddock/modules/refinement/emref/defaults.yaml b/src/haddock/modules/refinement/emref/defaults.yaml index fdf506336..2b191a935 100644 --- a/src/haddock/modules/refinement/emref/defaults.yaml +++ b/src/haddock/modules/refinement/emref/defaults.yaml @@ -237,7 +237,7 @@ symtbl_fname: long: Filename of the custom symmetry restraints file. group: 'symmetry' explevel: expert -numc2sym: +nc2sym: default: 0 type: integer min: 0 @@ -248,7 +248,7 @@ numc2sym: For each, a pair of segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c2sym_sta1_1: default: .nan type: integer @@ -309,7 +309,7 @@ c2sym_seg2_1: long: Segment ID of second C2 segment group: 'symmetry' explevel: expert -numc3sym: +nc3sym: default: 0 type: integer min: 0 @@ -320,7 +320,7 @@ numc3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c3sym_sta1_1: default: .nan type: integer @@ -411,7 +411,7 @@ c3sym_seg3_1: long: Segment ID of third C3 segment group: 'symmetry' explevel: expert -numc4sym: +nc4sym: default: 0 type: integer min: 0 @@ -422,7 +422,7 @@ numc4sym: For each, four segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c4sym_sta1_1: default: .nan type: integer @@ -543,7 +543,7 @@ c4sym_seg4_1: long: Segment ID of fourth C4 segment group: 'symmetry' explevel: expert -numc5sym: +nc5sym: default: 0 type: integer min: 0 @@ -554,7 +554,7 @@ numc5sym: For each, five segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c5sym_sta1_1: default: .nan type: integer @@ -705,7 +705,7 @@ c5sym_seg5_1: long: Segment ID of fifth C5 segment group: 'symmetry' explevel: expert -numc6sym: +nc6sym: default: 0 type: integer min: 0 @@ -716,7 +716,7 @@ numc6sym: For each, six segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c6sym_sta1_1: default: .nan type: integer @@ -897,7 +897,7 @@ c6sym_seg6_1: long: Segment ID of sixth C6 segment group: 'symmetry' explevel: expert -nums3sym: +ns3sym: default: 0 type: integer min: 0 @@ -908,7 +908,7 @@ nums3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden s3sym_sta1_1: default: .nan type: integer @@ -1019,7 +1019,7 @@ kncs: long: Force constant for non-crystallographic restraints group: 'symmetry' explevel: expert -numncs: +nncs: default: 0 type: integer min: 0 @@ -1029,7 +1029,7 @@ numncs: long: Number of non-crystallographic symmetry restraints. For each pairs of segments will have to be defined. Note that those must contain exactly the same residues/atom combinations. group: 'symmetry' - explevel: expert + explevel: hidden ncs_sta1_1: default: .nan type: integer diff --git a/src/haddock/modules/refinement/flexref/cns/check-homomers.cns b/src/haddock/modules/refinement/flexref/cns/check-homomers.cns index 00a359955..7faf7a4c9 100644 --- a/src/haddock/modules/refinement/flexref/cns/check-homomers.cns +++ b/src/haddock/modules/refinement/flexref/cns/check-homomers.cns @@ -22,32 +22,32 @@ while ($ncount < $data.ncomponents) loop checkmol end loop checkmol if ($data.flags.sym eq true) then - if ($data.numc2sym > 0) then + if ($data.nc2sym > 0) then if ($n_moving_mol = 2) then evaluate ($homosymmetry = true) end if end if - if ($data.numc2sym = 6) then + if ($data.nc2sym = 6) then if ($n_moving_mol = 4) then evaluate ($homosymmetry = true) end if end if - if ($data.numc3sym > 0) then + if ($data.nc3sym > 0) then if ($n_moving_mol = 3) then evaluate ($homosymmetry = true) end if end if - if ($data.numc4sym > 0) then + if ($data.nc4sym > 0) then if ($n_moving_mol = 4) then evaluate ($homosymmetry = true) end if end if - if ($data.numc5sym > 0) then + if ($data.nc5sym > 0) then if ($n_moving_mol = 5) then evaluate ($homosymmetry = true) end if end if - if ($data.numc6sym > 0) then + if ($data.nc6sym > 0) then if ($n_moving_mol = 6) then evaluate ($homosymmetry = true) end if diff --git a/src/haddock/modules/refinement/flexref/cns/flexref.cns b/src/haddock/modules/refinement/flexref/cns/flexref.cns index f5959d7c9..58680ecb6 100644 --- a/src/haddock/modules/refinement/flexref/cns/flexref.cns +++ b/src/haddock/modules/refinement/flexref/cns/flexref.cns @@ -123,12 +123,12 @@ evaluate ($data.numncs = $numncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) evaluate ($Data.flags.sym = $sym_on) -evaluate ($data.numc2sym = $numc2sym) -evaluate ($data.numc3sym = $numc3sym) -evaluate ($data.nums3sym = $nums3sym) -evaluate ($data.numc4sym = $numc4sym) -evaluate ($data.numc5sym = $numc5sym) -evaluate ($data.numc6sym = $numc6sym) +evaluate ($data.nc2sym = $nc2sym) +evaluate ($data.nc3sym = $nc3sym) +evaluate ($data.ns3sym = $ns3sym) +evaluate ($data.nc4sym = $nc4sym) +evaluate ($data.nc5sym = $nc5sym) +evaluate ($data.nc6sym = $nc6sym) !Electrostatics: evaluate ($Data.flags.dihed =$dihedflag) diff --git a/src/haddock/modules/refinement/flexref/cns/symmultimer.cns b/src/haddock/modules/refinement/flexref/cns/symmultimer.cns index 662bfa630..4bc582995 100644 --- a/src/haddock/modules/refinement/flexref/cns/symmultimer.cns +++ b/src/haddock/modules/refinement/flexref/cns/symmultimer.cns @@ -18,7 +18,7 @@ if ($Data.flags.sym eq true) then ! Define C2 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc2sym) loop c2symloop + while ($ncount < $data.nc2sym) loop c2symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c2sym_sta1_$ncount) @@ -65,7 +65,7 @@ if ($Data.flags.sym eq true) then ! Define C3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc3sym) loop c3symloop + while ($ncount < $data.nc3sym) loop c3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c3sym_sta1_$ncount) @@ -142,7 +142,7 @@ if ($Data.flags.sym eq true) then ! Define S3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.nums3sym) loop s3symloop + while ($ncount < $data.ns3sym) loop s3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $s3sym_sta1_$ncount) @@ -218,7 +218,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc4sym) loop c4symloop + while ($ncount < $data.nc4sym) loop c4symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c4sym_sta1_$ncount) @@ -369,7 +369,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 4) eval ($ncount = 0) - while ($ncount < $data.numc5sym) loop c5symloop + while ($ncount < $data.nc5sym) loop c5symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c5sym_sta1_$ncount) @@ -482,7 +482,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc6sym) loop c6symloop + while ($ncount < $data.nc6sym) loop c6symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c6sym_sta1_$ncount) diff --git a/src/haddock/modules/refinement/flexref/defaults.yaml b/src/haddock/modules/refinement/flexref/defaults.yaml index 592412d5d..a4a2fbbf5 100644 --- a/src/haddock/modules/refinement/flexref/defaults.yaml +++ b/src/haddock/modules/refinement/flexref/defaults.yaml @@ -574,7 +574,7 @@ symtbl_fname: long: Filename of the custom symmetry restraints file. group: 'symmetry' explevel: expert -numc2sym: +nc2sym: default: 0 type: integer min: 0 @@ -585,7 +585,7 @@ numc2sym: For each, a pair of segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c2sym_sta1_1: default: .nan type: integer @@ -646,7 +646,7 @@ c2sym_seg2_1: long: Segment ID of second C2 segment group: 'symmetry' explevel: expert -numc3sym: +nc3sym: default: 0 type: integer min: 0 @@ -657,7 +657,7 @@ numc3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c3sym_sta1_1: default: .nan type: integer @@ -748,7 +748,7 @@ c3sym_seg3_1: long: Segment ID of third C3 segment group: 'symmetry' explevel: expert -numc4sym: +nc4sym: default: 0 type: integer min: 0 @@ -759,7 +759,7 @@ numc4sym: For each, four segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c4sym_sta1_1: default: .nan type: integer @@ -880,7 +880,7 @@ c4sym_seg4_1: long: Segment ID of fourth C4 segment group: 'symmetry' explevel: expert -numc5sym: +nc5sym: default: 0 type: integer min: 0 @@ -891,7 +891,7 @@ numc5sym: For each, five segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c5sym_sta1_1: default: .nan type: integer @@ -1042,7 +1042,7 @@ c5sym_seg5_1: long: Segment ID of fifth C5 segment group: 'symmetry' explevel: expert -numc6sym: +nc6sym: default: 0 type: integer min: 0 @@ -1053,7 +1053,7 @@ numc6sym: For each, six segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c6sym_sta1_1: default: .nan type: integer @@ -1234,7 +1234,7 @@ c6sym_seg6_1: long: Segment ID of sixth C6 segment group: 'symmetry' explevel: expert -nums3sym: +ns3sym: default: 0 type: integer min: 0 @@ -1245,7 +1245,7 @@ nums3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden s3sym_sta1_1: default: .nan type: integer @@ -1356,7 +1356,7 @@ kncs: long: Force constant for non-crystallographic restraints group: 'symmetry' explevel: expert -numncs: +nncs: default: 0 type: integer min: 0 @@ -1366,7 +1366,7 @@ numncs: long: Number of non-crystallographic symmetry restraints. For each pairs of segments will have to be defined. Note that those must contain exactly the same residues/atom combinations. group: 'symmetry' - explevel: expert + explevel: hidden ncs_sta1_1: default: .nan type: integer diff --git a/src/haddock/modules/refinement/mdref/cns/mdref.cns b/src/haddock/modules/refinement/mdref/cns/mdref.cns index 0419ac3cf..f6e023011 100644 --- a/src/haddock/modules/refinement/mdref/cns/mdref.cns +++ b/src/haddock/modules/refinement/mdref/cns/mdref.cns @@ -72,12 +72,12 @@ evaluate ($data.numncs = $numncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) evaluate ($Data.flags.sym = $sym_on) -evaluate ($data.numc2sym = $numc2sym) -evaluate ($data.numc3sym = $numc3sym) -evaluate ($data.nums3sym = $nums3sym) -evaluate ($data.numc4sym = $numc4sym) -evaluate ($data.numc5sym = $numc5sym) -evaluate ($data.numc6sym = $numc6sym) +evaluate ($data.nc2sym = $nc2sym) +evaluate ($data.nc3sym = $nc3sym) +evaluate ($data.ns3sym = $ns3sym) +evaluate ($data.nc4sym = $nc4sym) +evaluate ($data.nc5sym = $nc5sym) +evaluate ($data.nc6sym = $nc6sym) !Electrostatics: evaluate ($Data.flags.dihed =$dihedflag) diff --git a/src/haddock/modules/refinement/mdref/cns/symmultimer.cns b/src/haddock/modules/refinement/mdref/cns/symmultimer.cns index 662bfa630..4bc582995 100644 --- a/src/haddock/modules/refinement/mdref/cns/symmultimer.cns +++ b/src/haddock/modules/refinement/mdref/cns/symmultimer.cns @@ -18,7 +18,7 @@ if ($Data.flags.sym eq true) then ! Define C2 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc2sym) loop c2symloop + while ($ncount < $data.nc2sym) loop c2symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c2sym_sta1_$ncount) @@ -65,7 +65,7 @@ if ($Data.flags.sym eq true) then ! Define C3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc3sym) loop c3symloop + while ($ncount < $data.nc3sym) loop c3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c3sym_sta1_$ncount) @@ -142,7 +142,7 @@ if ($Data.flags.sym eq true) then ! Define S3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.nums3sym) loop s3symloop + while ($ncount < $data.ns3sym) loop s3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $s3sym_sta1_$ncount) @@ -218,7 +218,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc4sym) loop c4symloop + while ($ncount < $data.nc4sym) loop c4symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c4sym_sta1_$ncount) @@ -369,7 +369,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 4) eval ($ncount = 0) - while ($ncount < $data.numc5sym) loop c5symloop + while ($ncount < $data.nc5sym) loop c5symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c5sym_sta1_$ncount) @@ -482,7 +482,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc6sym) loop c6symloop + while ($ncount < $data.nc6sym) loop c6symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c6sym_sta1_$ncount) diff --git a/src/haddock/modules/refinement/mdref/defaults.yaml b/src/haddock/modules/refinement/mdref/defaults.yaml index 18f27a8fb..2cb795de7 100644 --- a/src/haddock/modules/refinement/mdref/defaults.yaml +++ b/src/haddock/modules/refinement/mdref/defaults.yaml @@ -276,7 +276,7 @@ symtbl_fname: long: Filename of the custom symmetry restraints file. group: 'symmetry' explevel: expert -numc2sym: +nc2sym: default: 0 type: integer min: 0 @@ -287,7 +287,7 @@ numc2sym: For each, a pair of segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c2sym_sta1_1: default: .nan type: integer @@ -348,7 +348,7 @@ c2sym_seg2_1: long: Segment ID of second C2 segment group: 'symmetry' explevel: expert -numc3sym: +nc3sym: default: 0 type: integer min: 0 @@ -359,7 +359,7 @@ numc3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c3sym_sta1_1: default: .nan type: integer @@ -450,7 +450,7 @@ c3sym_seg3_1: long: Segment ID of third C3 segment group: 'symmetry' explevel: expert -numc4sym: +nc4sym: default: 0 type: integer min: 0 @@ -461,7 +461,7 @@ numc4sym: For each, four segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c4sym_sta1_1: default: .nan type: integer @@ -582,7 +582,7 @@ c4sym_seg4_1: long: Segment ID of fourth C4 segment group: 'symmetry' explevel: expert -numc5sym: +nc5sym: default: 0 type: integer min: 0 @@ -593,7 +593,7 @@ numc5sym: For each, five segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c5sym_sta1_1: default: .nan type: integer @@ -744,7 +744,7 @@ c5sym_seg5_1: long: Segment ID of fifth C5 segment group: 'symmetry' explevel: expert -numc6sym: +nc6sym: default: 0 type: integer min: 0 @@ -755,7 +755,7 @@ numc6sym: For each, six segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden c6sym_sta1_1: default: .nan type: integer @@ -936,7 +936,7 @@ c6sym_seg6_1: long: Segment ID of sixth C6 segment group: 'symmetry' explevel: expert -nums3sym: +ns3sym: default: 0 type: integer min: 0 @@ -947,7 +947,7 @@ nums3sym: For each, three segments on which the symmetry restraint is applied will have to be defined. Those must all have the same length. group: 'symmetry' - explevel: expert + explevel: hidden s3sym_sta1_1: default: .nan type: integer @@ -1058,7 +1058,7 @@ kncs: long: Force constant for non-crystallographic restraints group: 'symmetry' explevel: expert -numncs: +nncs: default: 0 type: integer min: 0 @@ -1068,7 +1068,7 @@ numncs: long: Number of non-crystallographic symmetry restraints. For each pairs of segments will have to be defined. Note that those must contain exactly the same residues/atom combinations. group: 'symmetry' - explevel: expert + explevel: hidden ncs_sta1_1: default: .nan type: integer diff --git a/src/haddock/modules/sampling/rigidbody/cns/check-homomers.cns b/src/haddock/modules/sampling/rigidbody/cns/check-homomers.cns index 00a359955..7faf7a4c9 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/check-homomers.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/check-homomers.cns @@ -22,32 +22,32 @@ while ($ncount < $data.ncomponents) loop checkmol end loop checkmol if ($data.flags.sym eq true) then - if ($data.numc2sym > 0) then + if ($data.nc2sym > 0) then if ($n_moving_mol = 2) then evaluate ($homosymmetry = true) end if end if - if ($data.numc2sym = 6) then + if ($data.nc2sym = 6) then if ($n_moving_mol = 4) then evaluate ($homosymmetry = true) end if end if - if ($data.numc3sym > 0) then + if ($data.nc3sym > 0) then if ($n_moving_mol = 3) then evaluate ($homosymmetry = true) end if end if - if ($data.numc4sym > 0) then + if ($data.nc4sym > 0) then if ($n_moving_mol = 4) then evaluate ($homosymmetry = true) end if end if - if ($data.numc5sym > 0) then + if ($data.nc5sym > 0) then if ($n_moving_mol = 5) then evaluate ($homosymmetry = true) end if end if - if ($data.numc6sym > 0) then + if ($data.nc6sym > 0) then if ($n_moving_mol = 6) then evaluate ($homosymmetry = true) end if diff --git a/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns b/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns index db61f2f26..ce39de650 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns @@ -102,9 +102,9 @@ while ($nchain1 < $data.ncomponents) loop nloop1 do (store5 = $nchain1) (segid $prot_segid_$nchain1) display RANDOM AIRS SAMPLED FROM ENTIRE SURFACE FOR MOLECULE $nchain1 else - evaluate ($numseg = abs($nrair_$nchain1)) + evaluate ($nseg = abs($nrair_$nchain1)) display RANDOM AIRS SAMPLED FROM SEGMENTS FOR MOLECULE $nchain1 - while ($fcounter < $numseg) loop Xflex + while ($fcounter < $nseg) loop Xflex evaluate($fcounter=$fcounter + 1) do (store5 = $nchain1) ( resid $rair_sta_$nchain1_$fcounter : $rair_end_$nchain1_$fcounter and segid $prot_segid_$nchain1) diff --git a/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns b/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns index 1da4ab5e9..a828552e2 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns @@ -58,26 +58,26 @@ evaluate ($toppar.par_nonbonded = "OPLSX") ! Symmetry restraints evaluate ($data.ksym = $ksym) evaluate ($Data.flags.sym = $sym_on) -evaluate ($data.numc2sym = $numc2sym) -evaluate ($data.numc3sym = $numc3sym) -evaluate ($data.nums3sym= $nums3sym) -evaluate ($data.numc4sym = $numc4sym) -evaluate ($data.numc5sym = $numc5sym) -evaluate ($data.numc6sym = $numc6sym) - -if ( $data.numc2sym eq 6) then +evaluate ($data.nc2sym = $nc2sym) +evaluate ($data.nc3sym = $nc3sym) +evaluate ($data.ns3sym= $ns3sym) +evaluate ($data.nc4sym = $nc4sym) +evaluate ($data.nc5sym = $nc5sym) +evaluate ($data.nc6sym = $nc6sym) + +if ( $data.nc2sym eq 6) then evaluate ($saprotocol.rotate180 = false) end if -if ( $data.numc3sym ne 0) then +if ( $data.nc3sym ne 0) then evaluate ($saprotocol.rotate180 = false) end if -if ( $data.numc4sym ne 0) then +if ( $data.nc4sym ne 0) then evaluate ($saprotocol.rotate180 = false) end if -if ( $data.numc5sym ne 0) then +if ( $data.nc5sym ne 0) then evaluate ($saprotocol.rotate180 = false) end if -if ( $data.numc6sym ne 0) then +if ( $data.nc6sym ne 0) then evaluate ($saprotocol.rotate180 = false) end if diff --git a/src/haddock/modules/sampling/rigidbody/cns/symmultimer.cns b/src/haddock/modules/sampling/rigidbody/cns/symmultimer.cns index 662bfa630..4bc582995 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/symmultimer.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/symmultimer.cns @@ -18,7 +18,7 @@ if ($Data.flags.sym eq true) then ! Define C2 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc2sym) loop c2symloop + while ($ncount < $data.nc2sym) loop c2symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c2sym_sta1_$ncount) @@ -65,7 +65,7 @@ if ($Data.flags.sym eq true) then ! Define C3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.numc3sym) loop c3symloop + while ($ncount < $data.nc3sym) loop c3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c3sym_sta1_$ncount) @@ -142,7 +142,7 @@ if ($Data.flags.sym eq true) then ! Define S3 symmetry restraints for symmetrical multimers ! eval ($ncount = 0) - while ($ncount < $data.nums3sym) loop s3symloop + while ($ncount < $data.ns3sym) loop s3symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $s3sym_sta1_$ncount) @@ -218,7 +218,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc4sym) loop c4symloop + while ($ncount < $data.nc4sym) loop c4symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c4sym_sta1_$ncount) @@ -369,7 +369,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 4) eval ($ncount = 0) - while ($ncount < $data.numc5sym) loop c5symloop + while ($ncount < $data.nc5sym) loop c5symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c5sym_sta1_$ncount) @@ -482,7 +482,7 @@ if ($Data.flags.sym eq true) then ! eval ($istep = 10) eval ($ncount = 0) - while ($ncount < $data.numc6sym) loop c6symloop + while ($ncount < $data.nc6sym) loop c6symloop eval ($ncount = $ncount + 1) evaluate ($i1start = $c6sym_sta1_$ncount) diff --git a/src/haddock/modules/sampling/rigidbody/defaults.yaml b/src/haddock/modules/sampling/rigidbody/defaults.yaml index ff3a35dd9..c909b6b41 100644 --- a/src/haddock/modules/sampling/rigidbody/defaults.yaml +++ b/src/haddock/modules/sampling/rigidbody/defaults.yaml @@ -956,7 +956,7 @@ symtbl_fname: long: Filename of the custom symmetry restraints file. group: 'symmetry' explevel: expert -numc2sym: +nc2sym: default: 0 type: integer min: 0 @@ -1028,7 +1028,7 @@ c2sym_seg2_1: long: Segment ID of second C2 segment group: 'symmetry' explevel: expert -numc3sym: +nc3sym: default: 0 type: integer min: 0 @@ -1130,7 +1130,7 @@ c3sym_seg3_1: long: Segment ID of third C3 segment group: 'symmetry' explevel: expert -numc4sym: +nc4sym: default: 0 type: integer min: 0 @@ -1262,7 +1262,7 @@ c4sym_seg4_1: long: Segment ID of fourth C4 segment group: 'symmetry' explevel: expert -numc5sym: +nc5sym: default: 0 type: integer min: 0 @@ -1424,7 +1424,7 @@ c5sym_seg5_1: long: Segment ID of fifth C5 segment group: 'symmetry' explevel: expert -numc6sym: +nc6sym: default: 0 type: integer min: 0 @@ -1616,7 +1616,7 @@ c6sym_seg6_1: long: Segment ID of sixth C6 segment group: 'symmetry' explevel: expert -nums3sym: +ns3sym: default: 0 type: integer min: 0 @@ -1738,7 +1738,7 @@ kncs: long: Force constant for non-crystallographic restraints group: 'symmetry' explevel: expert -numncs: +nncs: default: 0 type: integer min: 0 @@ -1748,7 +1748,7 @@ numncs: long: Number of non-crystallographic symmetry restraints. For each pairs of segments will have to be defined. Note that those must contain exactly the same residues/atom combinations. group: 'symmetry' - explevel: expert + explevel: hidden ncs_sta1_1: default: .nan type: integer From a0d7403184fb317c362bff5ced9750a03fb5892e Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 11:14:33 +0200 Subject: [PATCH 06/13] update numncs in cns files --- src/haddock/modules/refinement/emref/cns/emref.cns | 2 +- src/haddock/modules/refinement/flexref/cns/flexref.cns | 2 +- src/haddock/modules/refinement/mdref/cns/mdref.cns | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/haddock/modules/refinement/emref/cns/emref.cns b/src/haddock/modules/refinement/emref/cns/emref.cns index 76006e293..a048bc1d1 100644 --- a/src/haddock/modules/refinement/emref/cns/emref.cns +++ b/src/haddock/modules/refinement/emref/cns/emref.cns @@ -59,7 +59,7 @@ evaluate ($data.kcont=$kcont) ! NCS restraints evaluate ($data.kncs = $kncs) evaluate ($Data.flags.ncs = $ncs_on) -evaluate ($data.numncs = $numncs) +evaluate ($data.nncs = $nncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) diff --git a/src/haddock/modules/refinement/flexref/cns/flexref.cns b/src/haddock/modules/refinement/flexref/cns/flexref.cns index 58680ecb6..4ca0f0c3a 100644 --- a/src/haddock/modules/refinement/flexref/cns/flexref.cns +++ b/src/haddock/modules/refinement/flexref/cns/flexref.cns @@ -118,7 +118,7 @@ end if ! NCS restraints evaluate ($data.kncs = $kncs) evaluate ($Data.flags.ncs = $ncs_on) -evaluate ($data.numncs = $numncs) +evaluate ($data.nncs = $nncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) diff --git a/src/haddock/modules/refinement/mdref/cns/mdref.cns b/src/haddock/modules/refinement/mdref/cns/mdref.cns index f6e023011..4c206f484 100644 --- a/src/haddock/modules/refinement/mdref/cns/mdref.cns +++ b/src/haddock/modules/refinement/mdref/cns/mdref.cns @@ -67,7 +67,7 @@ end if ! NCS restraints evaluate ($data.kncs = $kncs) evaluate ($Data.flags.ncs = $ncs_on) -evaluate ($data.numncs = $numncs) +evaluate ($data.nncs = $nncs) ! Symmetry restraints evaluate ($data.ksym = $ksym) From 06a0801adc62988a08c07e80e5d776ce4c4ce8d8 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 11:30:26 +0200 Subject: [PATCH 07/13] modify parameter name in ncs checks --- src/haddock/gear/prepare_run.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/haddock/gear/prepare_run.py b/src/haddock/gear/prepare_run.py index 1df4e65b2..7c4e6a745 100644 --- a/src/haddock/gear/prepare_run.py +++ b/src/haddock/gear/prepare_run.py @@ -799,18 +799,18 @@ def validate_ncs_params(params: dict) -> None: # Validate value of `numncs` ncs_suffixes = list(groupped_ncs.keys()) # Case when number of definition do not match - if params["numncs"] != len(ncs_suffixes): + if params["nncs"] != len(ncs_suffixes): msg = ( - f'Number of NCS restraints (`numncs = {params["numncs"]}`) ' + f'Number of NCS restraints (`nncs = {params["nncs"]}`) ' " do not match with the number of defined NCS restraints " f"({len(ncs_suffixes)})" ) error_list.append(msg) else: # Case when numbers do not match - if max(ncs_suffixes) != params["numncs"]: + if max(ncs_suffixes) != params["nncs"]: msg = ( - f'Number of NCS restraints (`numncs = {params["numncs"]}`) ' + f'Number of NCS restraints (`nncs = {params["nncs"]}`) ' " do not match with the number of defined NCS restraints " f"({', '.join([str(s) for s in ncs_suffixes])})" ) From 4258b99a0a458402b216880b559c12dc7713205f Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 11:33:31 +0200 Subject: [PATCH 08/13] modify numncs parameter in tests --- tests/test_gear_prepare_run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_gear_prepare_run.py b/tests/test_gear_prepare_run.py index 3e0a74b6f..92bf59f57 100644 --- a/tests/test_gear_prepare_run.py +++ b/tests/test_gear_prepare_run.py @@ -38,7 +38,7 @@ def fixture_proper_ncs_params() -> dict[str, Union[str, int]]: return { "ncs_on": True, - "numncs": 2, + "nncs": 2, "ncs_sta1_1": 1, "ncs_sta2_1": 1, "ncs_end1_1": 10, @@ -469,7 +469,7 @@ def test_validate_ncs_params_different_end(proper_ncs_params): def test_validate_ncs_params_wrong_count(proper_ncs_params): """Test NCS param error when missmatch in number of ncs defined.""" # Set wrong number of ncs definition - proper_ncs_params["numncs"] = 1 + proper_ncs_params["nncs"] = 1 with pytest.raises(ConfigurationError): assert validate_ncs_params(proper_ncs_params) is None @@ -486,6 +486,6 @@ def test_validate_ncs_params_wrong_suffix_value(proper_ncs_params): proper_ncs_params[k3] = proper_ncs_params[k2] # Delete key2 del proper_ncs_params[k2] - # Except error as _3 != (numncs = 2) + # Except error as _3 != (nncs = 2) with pytest.raises(ConfigurationError): assert validate_ncs_params(proper_ncs_params) is None From 3c1cacdc1112ef2cc77bd1bd784a6c4cf217afb5 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 12:09:49 +0200 Subject: [PATCH 09/13] fix testing changes... --- .../docking-protein-homotrimer-test.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg b/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg index 33980d886..c8dca6e3a 100644 --- a/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg +++ b/examples/docking-protein-homotrimer/docking-protein-homotrimer-test.cfg @@ -36,7 +36,7 @@ ambig_fname = "data/1qu9_whiscy_air.tbl" sampling = 20 # Define NCS restraints between molecules ncs_on = true -ncs_sta1_1=1 +ncs_sta1_1=2 ncs_end1_1=128 ncs_seg1_1="A" ncs_sta2_1=2 From 7f98b9d9d352e710d5fd7f40305221d8351a23d9 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 12:10:47 +0200 Subject: [PATCH 10/13] upgrade test_examples_general.py with handling functions --- tests/test_examples_general.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/test_examples_general.py b/tests/test_examples_general.py index 1a4fd8fdc..cf15af7fe 100644 --- a/tests/test_examples_general.py +++ b/tests/test_examples_general.py @@ -73,9 +73,26 @@ def test_integration_examples(): def test_validate_cfg_files(): """Test all the examples configuration files are valid.""" for cfg_file in examples_cfg_files: + assert validate_cfg_file(cfg_file), f"Error detected in {cfg_file}!" + + +def validate_cfg_file(cfg_file: Path) -> bool: + """Handeler to validate a configuration file. + + Parameters + ---------- + cfg_file : Path + Path to the configuration file to check. + + Returns + ------- + bool + True if config file is OK else False + """ + try: if cfg_file.name == "params.cfg": # skip the params.cfg files as they might be part of old runs - continue + return True config_files = read_config(cfg_file) # update default non-mandatory parameters with user params params = recursive_dict_update( @@ -99,4 +116,9 @@ def test_validate_cfg_files(): reference_parameters=ALL_POSSIBLE_GENERAL_PARAMETERS, ) - validate_modules_params(modules_params, 20) \ No newline at end of file + validate_modules_params(modules_params, 20) + except Exception as e: + print(e) + return False + else: + return True From fa0cf07bd9827298110394ffa199259f9bb9bfc1 Mon Sep 17 00:00:00 2001 From: VGPReys Date: Tue, 17 Sep 2024 12:39:21 +0200 Subject: [PATCH 11/13] reverse changes on randomairs.cns --- src/haddock/modules/sampling/rigidbody/cns/randomairs.cns | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns b/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns index ce39de650..db61f2f26 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/randomairs.cns @@ -102,9 +102,9 @@ while ($nchain1 < $data.ncomponents) loop nloop1 do (store5 = $nchain1) (segid $prot_segid_$nchain1) display RANDOM AIRS SAMPLED FROM ENTIRE SURFACE FOR MOLECULE $nchain1 else - evaluate ($nseg = abs($nrair_$nchain1)) + evaluate ($numseg = abs($nrair_$nchain1)) display RANDOM AIRS SAMPLED FROM SEGMENTS FOR MOLECULE $nchain1 - while ($fcounter < $nseg) loop Xflex + while ($fcounter < $numseg) loop Xflex evaluate($fcounter=$fcounter + 1) do (store5 = $nchain1) ( resid $rair_sta_$nchain1_$fcounter : $rair_end_$nchain1_$fcounter and segid $prot_segid_$nchain1) From 128d68d91ca79bb9e9effa12c42aacfab071c6e3 Mon Sep 17 00:00:00 2001 From: Victor Reys <132575181+VGPReys@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:55:02 +0200 Subject: [PATCH 12/13] Apply typo suggestions from code review Co-authored-by: Anna Engel <113177776+AljaLEngel@users.noreply.github.com> --- .../docking-flexref-protein-glycan-full.cfg | 2 +- .../docking-flexref-protein-glycan-test.cfg | 2 +- src/haddock/gear/expandable_parameters.py | 2 +- tests/test_examples_general.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg b/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg index e2db10af4..5787521ad 100644 --- a/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg +++ b/examples/docking-protein-glycan/docking-flexref-protein-glycan-full.cfg @@ -42,7 +42,7 @@ mdsteps_cool1 = 5000 mdsteps_cool2 = 10000 mdsteps_cool3 = 10000 ambig_fname = "data/ambig.tbl" -# give full flexibilit to the glycan +# give full flexibility to the glycan fle_sta_1 = 1 fle_end_1 = 4 fle_seg_1 = "B" diff --git a/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg b/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg index 9900453b2..86d062148 100644 --- a/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg +++ b/examples/docking-protein-glycan/docking-flexref-protein-glycan-test.cfg @@ -38,7 +38,7 @@ mdsteps_cool1 = 5000 mdsteps_cool2 = 10000 mdsteps_cool3 = 10000 ambig_fname = "data/ambig.tbl" -# give full flexibilit to the glycan +# give full flexibility to the glycan fle_sta_1 = 1 fle_end_1 = 4 fle_seg_1 = "B" diff --git a/src/haddock/gear/expandable_parameters.py b/src/haddock/gear/expandable_parameters.py index db41380ad..1676843b1 100644 --- a/src/haddock/gear/expandable_parameters.py +++ b/src/haddock/gear/expandable_parameters.py @@ -284,7 +284,7 @@ def _read_groups_in_user_config( A set with the new parameters in the user configuration file that are acceptable according to the expandable rules. param_name_counts : dict[str, int] - Count of expendable parameter parameter name + Count of expendable parameter parameter names """ # minimum=1 is used to capture groups with missing parameters user_groups = get_user_groups(user_config, minimum=1, reference=False) diff --git a/tests/test_examples_general.py b/tests/test_examples_general.py index cf15af7fe..975fc0cb3 100644 --- a/tests/test_examples_general.py +++ b/tests/test_examples_general.py @@ -73,7 +73,7 @@ def test_integration_examples(): def test_validate_cfg_files(): """Test all the examples configuration files are valid.""" for cfg_file in examples_cfg_files: - assert validate_cfg_file(cfg_file), f"Error detected in {cfg_file}!" + assert validate_cfg_file(cfg_file), f"Error detected in {cfg_file}!" def validate_cfg_file(cfg_file: Path) -> bool: From 4d971fd32582fbe3382087263b2998d04dd343b4 Mon Sep 17 00:00:00 2001 From: Alexandre Bonvin Date: Tue, 17 Sep 2024 14:09:24 +0200 Subject: [PATCH 13/13] Update src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns Co-authored-by: Anna Engel <113177776+AljaLEngel@users.noreply.github.com> --- src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns b/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns index a828552e2..c3ffc1ed3 100644 --- a/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns +++ b/src/haddock/modules/sampling/rigidbody/cns/rigidbody.cns @@ -60,7 +60,7 @@ evaluate ($data.ksym = $ksym) evaluate ($Data.flags.sym = $sym_on) evaluate ($data.nc2sym = $nc2sym) evaluate ($data.nc3sym = $nc3sym) -evaluate ($data.ns3sym= $ns3sym) +evaluate ($data.ns3sym = $ns3sym) evaluate ($data.nc4sym = $nc4sym) evaluate ($data.nc5sym = $nc5sym) evaluate ($data.nc6sym = $nc6sym)