Skip to content

Commit

Permalink
Add test cases for is_sandwich_compound
Browse files Browse the repository at this point in the history
  • Loading branch information
ralf-meyer committed Feb 17, 2024
1 parent 84d56c0 commit 2e2313b
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_mol3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,31 @@ def test_get_geometry_type_catoms_arr(resource_path_root):
assert geo_report['aromatic'] is False


@pytest.mark.parametrize(
'name, con_atoms',
[
('BOWROX_comp_0.mol2', [{3, 4, 5, 6, 7}]),
('BOXTEQ_comp_0.mol2', [{4, 5, 6, 7, 8, 9}]),
('BOXTIU_comp_0.mol2', [{2, 3, 5, 6, 8, 9}]),
('BOZHOQ_comp_2.mol2', [{1, 2, 3, 6, 8}, {4, 5, 7, 9, 10}]),
('BOZHUW_comp_2.mol2', [{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}]),
]
)
def test_is_sandwich_compound(resource_path_root, name, con_atoms):
xyz_file = resource_path_root / "inputs" / "sandwich_compounds" / name
mol = mol3D()
mol.readfrommol2(xyz_file)

num_sandwich_lig, info_sandwich_lig, aromatic, allconnect, sandwich_lig_atoms = mol.is_sandwich_compound()
print(num_sandwich_lig, info_sandwich_lig, aromatic, allconnect, sandwich_lig_atoms)

assert num_sandwich_lig == len(con_atoms)
assert aromatic
assert allconnect
for i, lig in enumerate(sandwich_lig_atoms):
assert lig["atom_idxs"] == con_atoms[i]


def test_readfromxyzfile(resource_path_root):
xyz_file = resource_path_root / "inputs" / "cr3_f6_optimization.xyz"
mol = mol3D()
Expand Down
168 changes: 168 additions & 0 deletions tests/testresources/inputs/sandwich_compounds/BOWROX_comp_0.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
@<TRIPOS>MOLECULE
sandwich/BOWROX_comp_0
76 80 1
SMALL
PartialCharges
****
Generated from molSimplify

@<TRIPOS>ATOM
1 Ir1 5.6764 11.8665 8.4331 Ir 1 RES1 2.0
2 N1 4.309 10.4215 7.9219 N.1 1 RES1 0.0
3 C1 3.4476 9.6557 7.8769 C.1 1 RES1 0.0
4 N2 2.4826 8.8311 7.8095 N.pl3 1 RES1 0.0
5 C2 1.2961 8.9031 7.1577 C.3 1 RES1 0.0
6 H1 1.1842 8.1286 6.5508 H 1 RES1 0.0
7 H2 0.5432 8.9118 7.7995 H 1 RES1 0.0
8 C3 1.3315 10.0571 6.4584 C.3 1 RES1 0.0
9 H3 2.0043 10.6462 6.8505 H 1 RES1 0.0
10 H4 0.4548 10.4782 6.4883 H 1 RES1 0.0
11 H5 1.5718 9.8542 5.5268 H 1 RES1 0.0
12 C4 2.604 7.5308 8.5487 C.3 1 RES1 0.0
13 H6 2.5027 6.7847 7.9044 H 1 RES1 0.0
14 H7 1.8617 7.4632 9.2031 H 1 RES1 0.0
15 C5 3.959 7.3738 9.303 C.3 1 RES1 0.0
16 H8 4.6884 7.7206 8.741 H 1 RES1 0.0
17 H9 4.124 6.427 9.4953 H 1 RES1 0.0
18 H10 3.9319 7.8777 10.1421 H 1 RES1 0.0
19 N3 6.7032 10.3473 9.238 N.1 1 RES1 0.0
20 C6 7.2417 9.3547 9.6077 C.1 1 RES1 0.0
21 N4 7.8709 8.2726 10.0897 N.pl3 1 RES1 0.0
22 C7 8.4836 7.3956 9.2031 C.3 1 RES1 0.0
23 H11 9.4628 7.5548 9.283 H 1 RES1 0.0
24 H12 8.3139 6.4837 9.5277 H 1 RES1 0.0
25 C8 8.1773 7.4174 7.8669 C.3 1 RES1 0.0
26 H13 8.7146 6.7455 7.3974 H 1 RES1 0.0
27 H14 7.2287 7.2298 7.7446 H 1 RES1 0.0
28 H15 8.3846 8.3075 7.4973 H 1 RES1 0.0
29 C9 7.7884 7.9497 11.5032 C.3 1 RES1 0.0
30 H16 8.7028 7.8123 11.8454 H 1 RES1 0.0
31 H17 7.3006 7.0902 11.5981 H 1 RES1 0.0
32 C10 7.0932 8.9816 12.3848 C.3 1 RES1 0.0
33 H18 7.6918 9.7517 12.5072 H 1 RES1 0.0
34 H19 6.8941 8.5846 13.2564 H 1 RES1 0.0
35 H20 6.2661 9.2739 11.9577 H 1 RES1 0.0
36 C11 5.7335 13.9404 7.8969 C.ar 1 RES1 0.0
37 C12 7.0485 13.4931 8.1766 C.ar 1 RES1 0.0
38 C13 7.4043 12.5485 7.1851 C.ar 1 RES1 0.0
39 C14 6.2979 12.3173 6.366 C.ar 1 RES1 0.0
40 C15 5.2233 13.1921 6.7855 C.ar 1 RES1 0.0
41 C16 4.9959 15.1228 8.5587 C.3 1 RES1 0.0
42 H21 4.0816 15.1708 8.2191 H 1 RES1 0.0
43 H22 5.4672 15.9583 8.3489 H 1 RES1 0.0
44 H23 4.9806 14.9941 9.5302 H 1 RES1 0.0
45 C17 7.9722 14.1258 9.1781 C.3 1 RES1 0.0
46 H24 8.605 13.4539 9.5078 H 1 RES1 0.0
47 H25 7.4491 14.477 9.9273 H 1 RES1 0.0
48 H26 8.4648 14.8566 8.751 H 1 RES1 0.0
49 C18 8.7358 11.8482 7.1327 C.3 1 RES1 0.0
50 H27 9.405 12.4482 6.7406 H 1 RES1 0.0
51 H28 8.6592 11.0388 6.5833 H 1 RES1 0.0
52 H29 9.0103 11.6017 8.0418 H 1 RES1 0.0
53 C19 6.2178 11.3508 5.1897 C.3 1 RES1 0.0
54 H30 6.4487 11.822 4.363 H 1 RES1 0.0
55 H31 5.307 10.9974 5.1198 H 1 RES1 0.0
56 H32 6.8458 10.6113 5.332 H 1 RES1 0.0
57 C20 3.8895 13.3273 6.1212 C.3 1 RES1 0.0
58 H33 3.2037 13.504 6.798 H 1 RES1 0.0
59 H34 3.6751 12.4983 5.6467 H 1 RES1 0.0
60 H35 3.9154 14.0713 5.4844 H 1 RES1 0.0
61 P1 4.5163 12.1645 10.3409 P.3 1 RES1 0.0
62 O1 3.1755 12.9477 10.0597 O.3 1 RES1 0.0
63 O2 5.1243 13.0546 11.4707 O.3 1 RES1 0.0
64 O3 4.1876 10.7771 11.0037 O.3 1 RES1 0.0
65 C21 2.4273 13.7462 10.9787 C.3 1 RES1 0.0
66 H36 1.8169 13.1724 11.4907 H 1 RES1 0.0
67 H37 1.9041 14.4116 10.4818 H 1 RES1 0.0
68 H38 3.0376 14.2022 11.5906 H 1 RES1 0.0
69 C22 6.3391 12.6009 12.1351 C.3 1 RES1 0.0
70 H39 6.0988 12.0206 12.8893 H 1 RES1 0.0
71 H40 6.8387 13.3753 12.4647 H 1 RES1 0.0
72 H41 6.8894 12.0991 11.4982 H 1 RES1 0.0
73 C23 3.3817 10.6069 12.1725 C.3 1 RES1 0.0
74 H42 3.5843 11.3203 12.8144 H 1 RES1 0.0
75 H43 3.5773 9.7364 12.5771 H 1 RES1 0.0
76 H44 2.4355 10.6483 11.9253 H 1 RES1 0.0
@<TRIPOS>BOND
1 1 2 1
1 1 19 1
1 1 36 un
1 1 37 un
1 1 38 un
1 1 39 un
1 1 40 un
1 1 61 1
1 2 3 3
1 3 4 1
1 4 5 1
1 4 12 1
1 5 6 1
1 5 7 1
1 5 8 1
1 8 9 1
1 8 10 1
1 8 11 1
1 12 13 1
1 12 14 1
1 12 15 1
1 15 16 1
1 15 17 1
1 15 18 1
1 19 20 3
1 20 21 1
1 21 22 1
1 21 29 1
1 22 23 1
1 22 24 1
1 22 25 1
1 25 26 1
1 25 27 1
1 25 28 1
1 29 30 1
1 29 31 1
1 29 32 1
1 32 33 1
1 32 34 1
1 32 35 1
1 36 37 ar
1 36 40 ar
1 36 41 1
1 37 38 ar
1 37 45 1
1 38 39 ar
1 38 49 1
1 39 40 ar
1 39 53 1
1 40 57 1
1 41 42 1
1 41 43 1
1 41 44 1
1 45 46 1
1 45 47 1
1 45 48 1
1 49 50 1
1 49 51 1
1 49 52 1
1 53 54 1
1 53 55 1
1 53 56 1
1 57 58 1
1 57 59 1
1 57 60 1
1 61 62 1
1 61 63 1
1 61 64 1
1 62 65 1
1 63 69 1
1 64 73 1
1 65 66 1
1 65 67 1
1 65 68 1
1 69 70 1
1 69 71 1
1 69 72 1
1 73 74 1
1 73 75 1
1 73 76 1
@<TRIPOS>SUBSTRUCTURE
1 RES1 76
83 changes: 83 additions & 0 deletions tests/testresources/inputs/sandwich_compounds/BOXTEQ_comp_0.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@<TRIPOS>MOLECULE
sandwich/BOXTEQ_comp_0
32 39 1
SMALL
PartialCharges
****
Generated from molSimplify

@<TRIPOS>ATOM
1 Ru1 3.0602 0.4366 1.8265 Ru.oh 1 RES1 1.0
2 S1 4.2151 1.6707 3.5219 S.3 1 RES1 0.0
3 O1 3.1017 4.0084 -0.185 O.co2 1 RES1 0.0
4 O2 3.5114 1.9451 0.4498 O.co2 1 RES1 0.0
5 N1 1.5186 1.8269 2.1359 N.3 1 RES1 0.0
6 H1 0.805 1.5886 1.6588 H 1 RES1 0.0
7 H2 1.2876 1.8269 2.9964 H 1 RES1 0.0
8 C1 2.9091 3.0616 0.5452 C.2 1 RES1 0.0
9 C2 1.9445 3.1862 1.7387 C.3 1 RES1 0.0
10 H3 1.1602 3.7106 1.4719 H 1 RES1 0.0
11 C3 4.4116 -1.2618 1.5557 C.ar 1 RES1 0.0
12 H4 5.3393 -1.2853 1.5031 H 1 RES1 0.0
13 C4 1.6207 -1.1878 1.7231 C.ar 1 RES1 0.0
14 H5 0.6937 -1.1752 1.7932 H 1 RES1 0.0
15 C5 3.7631 -1.4063 2.7784 C.ar 1 RES1 0.0
16 H6 4.2596 -1.5443 3.5533 H 1 RES1 0.0
17 C6 2.3873 -1.3431 2.8465 C.ar 1 RES1 0.0
18 H7 1.9698 -1.409 3.6759 H 1 RES1 0.0
19 C7 2.233 -1.0461 0.4537 C.ar 1 RES1 0.0
20 H8 1.722 -0.9342 -0.3154 H 1 RES1 0.0
21 C8 3.6219 -1.0786 0.3836 C.ar 1 RES1 0.0
22 H9 4.0394 -0.9784 -0.44 H 1 RES1 0.0
23 C9 4.1184 3.4434 3.086 C.3 1 RES1 0.0
24 H10 4.5228 3.9696 3.7928 H 1 RES1 0.0
25 H11 4.6226 3.6005 2.2721 H 1 RES1 0.0
26 C10 2.6712 3.901 2.8796 C.3 1 RES1 0.0
27 H12 2.1785 3.7548 3.7012 H 1 RES1 0.0
28 H13 2.6681 4.8542 2.7005 H 1 RES1 0.0
29 C11 5.977 1.4252 3.2787 C.3 1 RES1 0.0
30 H14 6.1911 1.5407 2.35 H 1 RES1 0.0
31 H15 6.2172 0.537 3.5533 H 1 RES1 0.0
32 H16 6.4642 2.0651 3.8025 H 1 RES1 0.0
@<TRIPOS>BOND
1 1 2 1
1 1 4 1
1 1 5 1
1 1 11 un
1 1 13 un
1 1 15 un
1 1 17 un
1 1 19 un
1 1 21 un
1 2 23 1
1 2 29 1
1 3 8 2
1 4 8 1
1 5 6 1
1 5 7 1
1 5 9 1
1 8 9 1
1 9 10 1
1 9 26 1
1 11 12 1
1 11 15 ar
1 11 21 ar
1 13 14 1
1 13 17 ar
1 13 19 ar
1 15 16 1
1 15 17 ar
1 17 18 1
1 19 20 1
1 19 21 ar
1 21 22 1
1 23 24 1
1 23 25 1
1 23 26 1
1 26 27 1
1 26 28 1
1 29 30 1
1 29 31 1
1 29 32 1
@<TRIPOS>SUBSTRUCTURE
1 RES1 32
107 changes: 107 additions & 0 deletions tests/testresources/inputs/sandwich_compounds/BOXTIU_comp_0.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
@<TRIPOS>MOLECULE
sandwich/BOXTIU_comp_0
44 51 1
SMALL
PartialCharges
****
Generated from molSimplify

@<TRIPOS>ATOM
1 Ru1 4.8134 3.2102 5.176 Ru.oh 1 RES1 1.0
2 S1 3.4304 5.1082 4.7883 S.3 1 RES1 0.0
3 C1 5.1787 2.8192 3.031 C.ar 1 RES1 0.0
4 C2 6.3389 1.6467 4.8812 C.ar 1 RES1 0.0
5 H1 7.129 1.4648 5.3361 H 1 RES1 0.0
6 C3 5.1478 3.7342 1.8276 C.3 1 RES1 0.0
7 H2 4.2486 4.1189 1.7615 H 1 RES1 0.0
8 C4 6.157 4.8898 1.9051 C.3 1 RES1 0.0
9 H3 6.0455 5.3571 2.7358 H 1 RES1 0.0
10 H4 6.0067 5.4956 1.1759 H 1 RES1 0.0
11 H5 7.0491 4.54 1.8518 H 1 RES1 0.0
12 O1 4.3095 4.049 9.1705 O.co2 1 RES1 0.0
13 C5 1.7391 4.5904 4.4328 C.3 1 RES1 0.0
14 H6 1.4608 3.9398 5.0813 H 1 RES1 0.0
15 H7 1.7012 4.2029 3.5553 H 1 RES1 0.0
16 H8 1.1563 5.3515 4.4715 H 1 RES1 0.0
17 O2 4.1648 3.1172 7.1589 O.co2 1 RES1 0.0
18 C6 5.4072 5.1487 7.3606 C.3 1 RES1 0.0
19 H9 6.0914 5.4411 7.9977 H 1 RES1 0.0
20 C7 3.9647 1.2928 4.5312 C.ar 1 RES1 0.0
21 H10 3.1667 0.8884 4.7845 H 1 RES1 0.0
22 C8 3.9884 2.156 3.4375 C.ar 1 RES1 0.0
23 H11 3.2039 2.3029 2.96 H 1 RES1 0.0
24 C9 3.1437 5.9056 6.3943 C.3 1 RES1 0.0
25 H12 2.5949 6.6946 6.2669 H 1 RES1 0.0
26 H13 2.6597 5.2956 6.9734 H 1 RES1 0.0
27 C10 4.4566 6.3043 7.0654 C.3 1 RES1 0.0
28 H14 4.9137 6.9409 6.4943 H 1 RES1 0.0
29 H15 4.251 6.7548 7.8994 H 1 RES1 0.0
30 C11 4.5879 4.0112 7.9768 C.2 1 RES1 0.0
31 N1 6.0676 4.6254 6.1282 N.3 1 RES1 0.0
32 H16 6.8419 4.242 6.3411 H 1 RES1 0.0
33 H17 6.2353 5.2984 5.57 H 1 RES1 0.0
34 C12 6.3444 2.5631 3.794 C.ar 1 RES1 0.0
35 H18 7.1337 3.0038 3.5762 H 1 RES1 0.0
36 C13 5.3867 2.8835 0.5904 C.3 1 RES1 0.0
37 H19 6.2108 2.3994 0.6904 H 1 RES1 0.0
38 H20 5.4397 3.4502 -0.1823 H 1 RES1 0.0
39 H21 4.6622 2.2623 0.4839 H 1 RES1 0.0
40 C14 5.1644 1.0283 5.2668 C.ar 1 RES1 0.0
41 C15 5.1257 0.1553 6.4992 C.3 1 RES1 0.0
42 H22 5.934 0.277 7.0025 H 1 RES1 0.0
43 H23 5.0474 -0.7653 6.2379 H 1 RES1 0.0
44 H24 4.3712 0.3987 7.0412 H 1 RES1 0.0
@<TRIPOS>BOND
1 1 2 1
1 1 3 un
1 1 4 un
1 1 17 1
1 1 20 un
1 1 22 un
1 1 31 1
1 1 34 un
1 1 40 un
1 2 13 1
1 2 24 1
1 3 6 1
1 3 22 ar
1 3 34 ar
1 4 5 1
1 4 34 ar
1 4 40 ar
1 6 7 1
1 6 8 1
1 6 36 1
1 8 9 1
1 8 10 1
1 8 11 1
1 12 30 2
1 13 14 1
1 13 15 1
1 13 16 1
1 17 30 1
1 18 19 1
1 18 27 1
1 18 30 1
1 18 31 1
1 20 21 1
1 20 22 ar
1 20 40 ar
1 22 23 1
1 24 25 1
1 24 26 1
1 24 27 1
1 27 28 1
1 27 29 1
1 31 32 1
1 31 33 1
1 34 35 1
1 36 37 1
1 36 38 1
1 36 39 1
1 40 41 1
1 41 42 1
1 41 43 1
1 41 44 1
@<TRIPOS>SUBSTRUCTURE
1 RES1 44
Loading

0 comments on commit 2e2313b

Please sign in to comment.