-
Notifications
You must be signed in to change notification settings - Fork 58
Fixing shape support in cgtoaa module #1515
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
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
82688f0
shape argument added
cc6ac17
shape test added
rversin 46ecf2a
shape handling added
rversin 9f1d8f3
capri shape fix
rversin d9a5a78
Merge branch 'CG-HADDOCK' of https://github.com/haddocking/haddock3 i…
amjjbonvin 692d0c5
Fixed shape issue in cgtoaa and added shape docking example
amjjbonvin 1222085
Updated config files
amjjbonvin 5dad2f8
Updated protein-protein-shape docking example
amjjbonvin cb1e962
Updated config files, added end-to-end test
amjjbonvin e6c6d47
Added mol_fix_origin=true for shape
amjjbonvin 25b705d
missing dockstring and definition added
rversin c5d7130
corrected code
rversin 5cb554d
usage of Path instead of splicing
rversin c57dae4
test fixed
rversin 8e7b003
Add check for shape before reading cg-to-aa restraints
amjjbonvin f0fb788
Merge branch 'CG-HADDOCK-shape' of https://github.com/haddocking/hadd…
amjjbonvin 59c38fd
shape removed from martinize
rversin 9dcb648
shape check added
rversin 1840ab7
shape checking function added
rversin 2475f40
shape removed from martinize
rversin b9b0a54
shape checks updated
rversin 92d2de3
test for generate_topology fixed
rversin 7d6c75a
Avoid reading of cg-to-aa restraints for shape
amjjbonvin b2024ef
Merge branch 'CG-HADDOCK-shape' of https://github.com/haddocking/hadd…
amjjbonvin 88fc754
Correction
amjjbonvin 1a93483
add helper function in CG file generation
VGPReys a924dd0
.psf to .Format.TOPOLOGY
VGPReys f62f615
fix origin name
VGPReys b98db55
fix aa psf filepath
VGPReys 267100e
full path usage
rversin df61242
shape added to PDBFile
rversin 3fd590e
selection of spage residues
rversin 3812fdf
Merge branch 'CG-HADDOCK-shape' into enhance-filename-generation-cg
VGPReys 2bd6c74
Merge pull request #1521 from haddocking/enhance-filename-generation-cg
VGPReys b94a039
add check for backmapping file in tests
VGPReys 9dfc8bf
path issues and remove tmp files
VGPReys 0e0c184
fname in end2end
VGPReys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| """End-to-end test for the protein-protein-shape docking example.""" | ||
|
|
||
| import shutil | ||
| import tempfile | ||
| import gzip | ||
| from pathlib import Path | ||
|
|
||
| from haddock.clis.cli import main as cli_main | ||
|
|
||
| import warnings | ||
| from Bio.PDB.PDBExceptions import PDBConstructionWarning | ||
|
|
||
|
|
||
| EXAMPLE_DIR = ( | ||
| Path(__file__).resolve().parents[1] / "examples" / "docking-protein-protein-shape" | ||
| ) | ||
|
|
||
| def test_protein_protein_shape_CG(monkeypatch): | ||
| """Test protein-protein-shape CG docking example. | ||
|
|
||
| Uses docking-protein-protein-shape-CG-test.cfg to run the full pipeline | ||
| (topoaa, topocg rigidbody, caprieval, seletop, flexref, caprieval, cgtoaa, emref, caprieval, | ||
| clustfcc, seletopclusts, caprieva) | ||
| """ | ||
| warnings.simplefilter('ignore', PDBConstructionWarning) | ||
|
|
||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| shutil.copytree(Path(EXAMPLE_DIR, "data"), Path(tmpdir, "data")) | ||
| config_fname = "docking-protein-protein-shape-CG-test.cfg" | ||
| cfg = Path(tmpdir, config_fname) | ||
| shutil.copy(Path(EXAMPLE_DIR, config_fname), cfg) | ||
|
|
||
| monkeypatch.chdir(tmpdir) | ||
| cli_main(cfg) | ||
|
|
||
| run_dir = Path("run1-CG-test") | ||
|
|
||
| # Verify all workflow steps produced output directories | ||
| assert Path(run_dir, "00_topoaa").exists(), f"00_topoaa not created" | ||
| assert Path(run_dir, "01_topocg").exists(), f"01_topocg not created" | ||
| assert Path(run_dir, "02_rigidbody").exists(), f"02_rigidbody not created" | ||
| assert Path(run_dir, "03_caprieval").exists(), f"03_caprieval not created" | ||
| assert Path(run_dir, "04_seletop").exists(), f"04_seletop created" | ||
| assert Path(run_dir, "05_flexref").exists(), f"05_flexref not created" | ||
| assert Path(run_dir, "06_caprieval").exists(), f"06_caprieval not created" | ||
| assert Path(run_dir, "07_cgtoaa").exists(), f"07_cgtoaa not created" | ||
| assert Path(run_dir, "08_emref").exists(), f"08_emref not created" | ||
| assert Path(run_dir, "09_caprieval").exists(), f"09_caprieval not created" | ||
| assert Path(run_dir, "10_clustfcc").exists(), f"10_clustfcc not created" | ||
| assert Path(run_dir, "11_seletopclusts").exists(), f"10_seletopclusts not created" | ||
| assert Path(run_dir, "12_caprieval").exists(), f"12_caprieval not created" | ||
| with gzip.open(Path(run_dir, "08_emref/emref_1.pdb.gz"), 'rt') as f: | ||
| assert any('SHA SHA S' in line for line in f), f"Shape atoms not found in emref PDB file" | ||
2,034 changes: 2,034 additions & 0 deletions
2,034
examples/docking-protein-protein-shape/data/2r15_A.pdb
Large diffs are not rendered by default.
Oops, something went wrong.
2,034 changes: 2,034 additions & 0 deletions
2,034
examples/docking-protein-protein-shape/data/2r15_B.pdb
Large diffs are not rendered by default.
Oops, something went wrong.
4,023 changes: 4,023 additions & 0 deletions
4,023
examples/docking-protein-protein-shape/data/2r15_reference.pdb
Large diffs are not rendered by default.
Oops, something went wrong.
208 changes: 208 additions & 0 deletions
208
examples/docking-protein-protein-shape/data/ambig-shape.tbl
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
examples/docking-protein-protein-shape/docking-protein-protein-shape-CG-full.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # ==================================================================== | ||
| # Protein-protein docking example with shape restraints | ||
|
|
||
| # directory in which the scoring will be done | ||
| run_dir = "run1-CG-full" | ||
|
|
||
| # execution mode | ||
| mode = "local" | ||
| ncores = 50 | ||
|
|
||
| # molecules to be docked | ||
| molecules = [ | ||
| "data/2r15_A.pdb", | ||
| "data/2r15_B.pdb", | ||
| "data/shape.pdb", | ||
| ] | ||
|
|
||
| # ==================================================================== | ||
| # Parameters for each stage are defined below, prefer full paths | ||
| # ==================================================================== | ||
| [topoaa] | ||
|
|
||
| [topocg] | ||
|
|
||
| [rigidbody] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
|
rversin marked this conversation as resolved.
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
| fnat_cutoff = 7.0 # cutoff for coarse-grained structures | ||
|
|
||
| [seletop] | ||
|
|
||
| [flexref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
| fnat_cutoff = 7.0 # cutoff for coarse-grained structures | ||
|
|
||
| [cgtoaa] | ||
| mol_shape_3 = true | ||
| log_level = 'verbose' | ||
|
|
||
| [emref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [clustfcc] | ||
| min_population = 4 | ||
|
|
||
| [seletopclusts] | ||
| top_models = 4 | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| # ==================================================================== | ||
|
|
||
72 changes: 72 additions & 0 deletions
72
examples/docking-protein-protein-shape/docking-protein-protein-shape-CG-test.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # ==================================================================== | ||
| # Protein-protein docking example with shape restraints | ||
|
|
||
| # directory in which the scoring will be done | ||
| run_dir = "run1-CG-test" | ||
|
|
||
| # execution mode | ||
| mode = "local" | ||
| ncores = 10 | ||
| debug = true | ||
|
|
||
| # molecules to be docked | ||
| molecules = [ | ||
| "data/2r15_A.pdb", | ||
| "data/2r15_B.pdb", | ||
| "data/shape.pdb", | ||
| ] | ||
|
|
||
| # ==================================================================== | ||
| # Parameters for each stage are defined below, prefer full paths | ||
| # ==================================================================== | ||
| [topoaa] | ||
|
|
||
| [topocg] | ||
|
|
||
| [rigidbody] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| sampling = 5 | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
|
rversin marked this conversation as resolved.
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
| fnat_cutoff = 7.0 # cutoff for coarse-grained structures | ||
|
|
||
| [seletop] | ||
| select = 2 | ||
|
|
||
| [flexref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
| fnat_cutoff = 7.0 # cutoff for coarse-grained structures | ||
|
|
||
| [cgtoaa] | ||
| mol_shape_3 = true | ||
|
|
||
| [emref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [clustfcc] | ||
| min_population = 1 | ||
|
|
||
| [seletopclusts] | ||
| top_models = 4 | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| # ==================================================================== | ||
|
|
||
62 changes: 62 additions & 0 deletions
62
examples/docking-protein-protein-shape/docking-protein-protein-shape-full.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # ==================================================================== | ||
| # Protein-protein docking example with shape restraints | ||
|
|
||
| # directory in which the scoring will be done | ||
| run_dir = "run1-full" | ||
|
|
||
| # execution mode | ||
| mode = "local" | ||
| ncores = 50 | ||
|
|
||
| # molecules to be docked | ||
| molecules = [ | ||
| "data/2r15_A.pdb", | ||
| "data/2r15_B.pdb", | ||
| "data/shape.pdb", | ||
| ] | ||
|
|
||
| # ==================================================================== | ||
| # Parameters for each stage are defined below, prefer full paths | ||
| # ==================================================================== | ||
| [topoaa] | ||
|
|
||
| [rigidbody] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
|
rversin marked this conversation as resolved.
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [seletop] | ||
|
|
||
| [flexref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [emref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [clustfcc] | ||
| min_population = 4 | ||
|
|
||
| [seletopclusts] | ||
| top_models = 4 | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| # ==================================================================== | ||
|
|
||
64 changes: 64 additions & 0 deletions
64
examples/docking-protein-protein-shape/docking-protein-protein-shape-test.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # ==================================================================== | ||
| # Protein-protein docking example with shape restraints | ||
|
|
||
| # directory in which the scoring will be done | ||
| run_dir = "run1-test" | ||
|
|
||
| # execution mode | ||
| mode = "local" | ||
| ncores = 10 | ||
|
|
||
| # molecules to be docked | ||
| molecules = [ | ||
| "data/2r15_A.pdb", | ||
| "data/2r15_B.pdb", | ||
| "data/shape.pdb", | ||
| ] | ||
|
|
||
| # ==================================================================== | ||
| # Parameters for each stage are defined below, prefer full paths | ||
| # ==================================================================== | ||
| [topoaa] | ||
|
|
||
| [rigidbody] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| sampling = 5 | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
|
rversin marked this conversation as resolved.
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [seletop] | ||
| select = 2 | ||
|
|
||
| [flexref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [emref] | ||
| tolerance = 20 | ||
| ambig_fname = "data/ambig-shape.tbl" | ||
| mol_shape_3 = true | ||
| mol_fix_origin_3 = true | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| [clustfcc] | ||
| min_population = 1 | ||
|
|
||
| [seletopclusts] | ||
| top_models = 4 | ||
|
|
||
| [caprieval] | ||
| reference_fname = "data/2r15_reference.pdb" | ||
|
|
||
| # ==================================================================== | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.