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

Add constraints #84

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 17 additions & 11 deletions package/ClayCode/builder/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def run_em(
ndx_list.append(
self.stack.with_suffix(".ndx")
) # .insert(0, self.stack.with_suffix(".ndx"))

topfile = self.stack.top
while len(freeze_grps_list) < n_runs:
freeze_grps_list.append(None)
freeze_dims_list.append(None)
Expand Down Expand Up @@ -443,7 +443,7 @@ def run_em(
):
result = run_em(
crdin=self.stack,
topin=self.stack.top,
topin=topfile,
odir=self.args.outpath,
topout=self.args.outpath / f"{outname}.top",
outname=outname,
Expand All @@ -459,9 +459,7 @@ def run_em(
else:
logger.ferror(f"Energy minimisation failed.")
outgro = None
break
# freeze_grps = None
# freeze_dims = None
break # freeze_grps = None # freeze_dims = None
# if outgro is not False:
# result = run_em(
# crdin=self.stack,
Expand All @@ -481,10 +479,10 @@ def run_em(
# logger.ferror(f"Energy minimisation failed.")
if outgro is not None:
outpath = Dir(self.args.outpath)
top_files = outpath._get_filelist(ext=".top")
crd_top_files = [
*outpath.gro_filelist,
*outpath.itp_filelist,
*outpath._get_filelist(ext=".top"),
*outpath.itp_filelist, # *outpath._get_filelist(ext=".top"),
*outpath._get_filelist(ext=".csv"),
*outpath._get_filelist(ext=".mdp"),
*outpath._get_filelist(ext=".edr"),
Expand All @@ -493,10 +491,16 @@ def run_em(
]
em_files = []
backups = []
for file in sorted(
outpath.iterdir(), key=lambda f: f.suffix, reverse=True
):
if file not in crd_top_files and not file.is_dir():
for file in [
*sorted(
outpath.iterdir(), key=lambda f: f.suffix, reverse=True
),
*top_files,
]:
if (
file not in [*crd_top_files, *top_files]
and not file.is_dir()
):
file.unlink(missing_ok=True)
else:
if file.stem.split("_")[-1] == "em":
Expand Down Expand Up @@ -527,6 +531,8 @@ def run_em(
shutil.copy2(file, new_file)
except shutil.SameFileError:
pass
except FileNotFoundError:
pass
else:
if (
file.suffix == ".gro"
Expand Down
132 changes: 132 additions & 0 deletions package/ClayCode/data/data/UCS/CD11/constraints/C1000_distconstr.itp
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#ifdef TSheets
[ distance_restraints ]
; i j ? label funct lo up1 up2 weight
5 14 1 8 1 0.164367 0.364367 1.36437 1
6 7 1 9 1 0.164127 0.364127 1.36413 1
6 9 1 11 1 0.16889 0.36889 1.36889 1
6 13 1 15 1 0.166874 0.366874 1.36687 1
7 9 1 18 1 0.157101 0.357101 1.3571 1
7 13 1 22 1 0.158884 0.358884 1.35888 1
8 11 1 26 1 0.164571 0.364571 1.36457 1
8 12 1 27 1 0.158884 0.358884 1.35888 1
8 14 1 29 1 0.162724 0.362724 1.36272 1
9 10 1 30 1 0.163911 0.363911 1.36391 1
9 13 1 33 1 0.162724 0.362724 1.36272 1
11 12 1 39 1 0.164203 0.364203 1.3642 1
12 13 1 42 1 0.162857 0.362857 1.36286 1
12 14 1 43 1 0.157101 0.357101 1.3571 1
#endif
#ifdef ClaySheets
[ distance_restraints ]
; i j ? label funct lo up1 up2 weight
1 5 1 3 1 0.061459 0.261459 1.26146 1
1 14 1 12 1 0.0616818 0.261682 1.26168 1
2 8 1 38 1 0.0588899 0.25889 1.25889 1
2 11 1 41 1 0.0607607 0.260761 1.26076 1
2 12 1 42 1 0.0624407 0.262441 1.26244 1
2 14 1 44 1 0.0625977 0.262598 1.2626 1
3 12 1 73 1 0.0616075 0.261608 1.26161 1
3 13 1 74 1 0.0619537 0.261954 1.26195 1
4 6 1 97 1 0.060826 0.260826 1.26083 1
4 7 1 98 1 0.0621542 0.262154 1.26215 1
4 9 1 100 1 0.0604151 0.260415 1.26042 1
4 13 1 104 1 0.061558 0.261558 1.26156 1
5 14 1 134 1 0.164367 0.364367 1.36437 1
5 17 1 137 1 0.0920989 0.292099 1.2921 1
5 18 1 138 1 0.093902 0.293902 1.2939 1
5 21 1 141 1 0.137828 0.337828 1.33783 1
5 31 1 151 1 0.158407 0.358407 1.35841 1
6 7 1 155 1 0.164127 0.364127 1.36413 1
6 9 1 157 1 0.16889 0.36889 1.36889 1
6 13 1 161 1 0.166874 0.366874 1.36687 1
6 16 1 164 1 0.0930932 0.293093 1.29309 1
6 24 1 172 1 0.140443 0.340443 1.34044 1
7 9 1 184 1 0.157101 0.357101 1.3571 1
7 13 1 188 1 0.158884 0.358884 1.35888 1
8 11 1 212 1 0.164571 0.364571 1.36457 1
8 12 1 213 1 0.158884 0.358884 1.35888 1
8 14 1 215 1 0.162724 0.362724 1.36272 1
9 10 1 236 1 0.163911 0.363911 1.36391 1
9 13 1 239 1 0.162724 0.362724 1.36272 1
10 16 1 266 1 0.0922446 0.292245 1.29224 1
10 25 1 275 1 0.137573 0.337573 1.33757 1
11 12 1 285 1 0.164203 0.364203 1.3642 1
11 15 1 288 1 0.0938608 0.293861 1.29386 1
11 18 1 291 1 0.0941391 0.294139 1.29414 1
11 20 1 293 1 0.14253 0.34253 1.34253 1
12 13 1 308 1 0.162857 0.362857 1.36286 1
12 14 1 309 1 0.157101 0.357101 1.3571 1
15 19 1 374 1 0.0914262 0.291426 1.29143 1
15 20 1 375 1 0.0896022 0.289602 1.2896 1
15 22 1 377 1 0.0916612 0.291661 1.29166 1
15 30 1 385 1 0.16326 0.36326 1.36326 1
15 31 1 386 1 0.141698 0.341698 1.3417 1
15 32 1 387 1 0.157672 0.357672 1.35767 1
16 19 1 392 1 0.0910602 0.29106 1.29106 1
16 22 1 395 1 0.0902998 0.2903 1.2903 1
16 24 1 397 1 0.089119 0.289119 1.28912 1
16 25 1 398 1 0.0876886 0.287689 1.28769 1
16 28 1 401 1 0.163936 0.363936 1.36394 1
16 29 1 402 1 0.155229 0.355229 1.35523 1
16 30 1 403 1 0.163032 0.363032 1.36303 1
16 31 1 404 1 0.140828 0.340828 1.34083 1
17 21 1 411 1 0.0864457 0.286446 1.28645 1
17 33 1 423 1 0.164492 0.364492 1.36449 1
18 20 1 426 1 0.0894281 0.289428 1.28943 1
18 21 1 427 1 0.088218 0.288218 1.28822 1
18 23 1 429 1 0.091575 0.291575 1.29158 1
18 26 1 432 1 0.0902998 0.2903 1.2903 1
18 27 1 433 1 0.13728 0.33728 1.33728 1
18 32 1 438 1 0.162939 0.362939 1.36294 1
18 33 1 439 1 0.152555 0.352555 1.35255 1
18 34 1 440 1 0.159488 0.359488 1.35949 1
19 22 1 443 1 0.136588 0.336588 1.33659 1
19 31 1 452 1 0 0.197252 1.19725 1
20 31 1 466 1 0.163167 0.363167 1.36317 1
20 32 1 467 1 0 0.197929 1.19793 1
21 27 1 475 1 0.161973 0.361973 1.36197 1
21 33 1 481 1 0 0.198438 1.19844 1
22 30 1 490 1 0 0.198051 1.19805 1
23 26 1 497 1 0.136332 0.336332 1.33633 1
23 27 1 498 1 0 0.194345 1.19435 1
24 28 1 509 1 0 0.199106 1.19911 1
25 29 1 519 1 0 0.196732 1.19673 1
25 31 1 521 1 0.162734 0.362734 1.36273 1
26 34 1 532 1 0 0.196468 1.19647 1
#endif
#ifdef ClayNoOHSheets
[ distance_restraints ]
; i j ? label funct lo up1 up2 weight
1 5 1 3 1 0.061459 0.261459 1.26146 1
1 14 1 12 1 0.0616818 0.261682 1.26168 1
2 8 1 22 1 0.0588899 0.25889 1.25889 1
2 11 1 25 1 0.0607607 0.260761 1.26076 1
2 12 1 26 1 0.0624407 0.262441 1.26244 1
2 14 1 28 1 0.0625977 0.262598 1.2626 1
3 12 1 41 1 0.0616075 0.261608 1.26161 1
3 13 1 42 1 0.0619537 0.261954 1.26195 1
4 6 1 49 1 0.060826 0.260826 1.26083 1
4 7 1 50 1 0.0621542 0.262154 1.26215 1
4 9 1 52 1 0.0604151 0.260415 1.26042 1
4 13 1 56 1 0.061558 0.261558 1.26156 1
5 14 1 70 1 0.164367 0.364367 1.36437 1
5 17 1 73 1 0.0920989 0.292099 1.2921 1
5 18 1 74 1 0.093902 0.293902 1.2939 1
6 7 1 75 1 0.164127 0.364127 1.36413 1
6 9 1 77 1 0.16889 0.36889 1.36889 1
6 13 1 81 1 0.166874 0.366874 1.36687 1
6 16 1 84 1 0.0930932 0.293093 1.29309 1
7 9 1 88 1 0.157101 0.357101 1.3571 1
7 13 1 92 1 0.158884 0.358884 1.35888 1
8 11 1 100 1 0.164571 0.364571 1.36457 1
8 12 1 101 1 0.158884 0.358884 1.35888 1
8 14 1 103 1 0.162724 0.362724 1.36272 1
9 10 1 108 1 0.163911 0.363911 1.36391 1
9 13 1 111 1 0.162724 0.362724 1.36272 1
10 16 1 122 1 0.0922446 0.292245 1.29224 1
11 12 1 125 1 0.164203 0.364203 1.3642 1
11 15 1 128 1 0.0938608 0.293861 1.29386 1
11 18 1 131 1 0.0941391 0.294139 1.29414 1
12 13 1 132 1 0.162857 0.362857 1.36286 1
12 14 1 133 1 0.157101 0.357101 1.3571 1
#endif
Loading
Loading