-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/requirements/scikit-learn-1.5.0
- Loading branch information
Showing
13 changed files
with
793 additions
and
518 deletions.
There are no files selected for viewing
This file contains 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,84 @@ | ||
import tempfile | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
from ConservedWaterSearch.water_clustering import WaterClustering | ||
|
||
|
||
@pytest.fixture() | ||
def orientations_normalized(): | ||
return np.asarray([[1, 0, 0], [-0.25038 * 2, 0.96814764 * 2, 0]]) | ||
|
||
|
||
@pytest.fixture() | ||
def orientations_not_normalized(): | ||
return np.asarray([[1, 0, 0], [-0.25038, 0.96814764, 0]]) | ||
|
||
|
||
@pytest.fixture( | ||
params=[ | ||
"tests/data/conserved_sample_FCW.dat", | ||
"tests/data/conserved_sample_FCW2.dat", | ||
"tests/data/dispersed_sample_HCW.dat", | ||
"tests/data/dispersed_sample_HCW2.dat", | ||
"tests/data/circ_sample_HCW.dat", | ||
"tests/data/circ_sample_HCW2.dat", | ||
"tests/data/circ_sample_HCW3.dat", | ||
"tests/data/sample_WCW.dat", | ||
"tests/data/sample_circular_only_WCW.dat", | ||
"tests/data/dispersed_sample_WCW.dat", | ||
"tests/data/2_by_2_WCW.dat", | ||
"tests/data/dispersed_sample_not_conserved.dat", | ||
"tests/data/not_conserved.dat", | ||
] | ||
) | ||
def water_data(request): | ||
return np.loadtxt(request.param), request.param.split("/")[-1].split(".")[0] | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def _pymol_skip(): | ||
pytest.importorskip("pymol") | ||
|
||
|
||
@pytest.fixture(params=[{"onlyO": False}, {"onlyO": True}]) | ||
def water_clustering_setup(request): | ||
wc = WaterClustering(10) | ||
# Common setup for both cases | ||
wc._waterO.append(np.asarray([0.0, 0.0, 0.0])) | ||
wc._waterO.append(np.asarray([0.0, 2.0, 0.0])) | ||
|
||
if request.param["onlyO"]: | ||
# Only oxygen scenario | ||
wc._water_type.append("O_clust") | ||
wc._water_type.append("O_clust") | ||
else: | ||
# Full water type clustering | ||
wc._waterH1.append(np.asarray([1.0, 0.0, 0.0])) | ||
wc._waterH1.append(np.asarray([0.0, 0.8, 0.5])) | ||
wc._waterH2.append(np.asarray([2.5, 2.0, 2.8])) | ||
wc._waterH2.append(np.asarray([0.0, 3.0, 0.0])) | ||
wc._water_type.append("FCW") | ||
wc._water_type.append("HCW") | ||
|
||
return wc, request.param["onlyO"] | ||
|
||
|
||
@pytest.fixture() | ||
def water_clustering_setup_for_deletion(): | ||
with tempfile.NamedTemporaryFile( | ||
mode="w+", delete=True | ||
) as dat, tempfile.NamedTemporaryFile(mode="w+", delete=True) as res: | ||
wc = WaterClustering(10, output_file=res.name, restart_data_file=dat.name) | ||
Odata = np.asarray([[0.1, 0.1, 0.1], [1.5, 1.6, 1.7], [1.9, 5.8, 5.6]]) | ||
H1 = np.asarray([[0.8, 0.5, 0.8], [1.4, 0.6, 3.7], [3.9, 5.1, 5.9]]) | ||
H2 = np.asarray([[0.4, 0.7, 0.1], [1.7, 3.6, 2.7], [1.8, 3.8, 5.1]]) | ||
yield wc, dat.name, Odata, H1, H2 | ||
|
||
|
||
@pytest.fixture() | ||
def water_clustering_data(): | ||
Opos = np.loadtxt("tests/data/testdataO.dat") | ||
Hpos = np.loadtxt("tests/data/testdataH.dat") | ||
return Opos, Hpos |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,42 @@ | ||
10 | ||
HDBSCAN | ||
FCW HCW WCW | ||
True | ||
10 9 8 7 6 5 4 3 2 | ||
0.0 | ||
0.8 | ||
True | ||
0.85 | ||
120.0 | ||
0.4 | ||
5.0 | ||
17.0 | ||
0.15 | ||
15.0 | ||
17.0 | ||
20.0 | ||
0.7 | ||
0.03 | ||
0.05 0.01 | ||
0.05 0.001 | ||
1 | ||
0 | ||
0 | ||
0 | ||
False | ||
False | ||
FCW 41.068180084228516 30.142730712890625 41.10182189941406 41.66721725463867 29.93570899963379 40.32832336425781 41.67447280883789 30.349889755249023 41.86960983276367 | ||
FCW 46.2599983215332 36.27909469604492 47.799095153808594 46.40528106689453 36.8060188293457 46.96168899536133 45.53178024291992 35.63311004638672 47.5701789855957 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.57703399658203 29.518451690673828 46.76020050048828 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.7336540222168 29.52460289001465 46.767112731933594 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 46.796688079833984 29.28479766845703 46.859107971191406 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 47.06808090209961 29.681392669677734 46.571876525878906 | ||
WCW 41.64666748046875 29.21222686767578 46.958892822265625 41.335205078125 29.523826599121094 47.85660934448242 41.68410873413086 28.263580322265625 47.273006439208984 | ||
WCW 41.64666748046875 29.21222686767578 46.958892822265625 40.76143264770508 28.935361862182617 47.33266067504883 42.02277755737305 29.73078155517578 47.72677230834961 | ||
WCW 41.64666748046875 29.21222686767578 46.958892822265625 41.139888763427734 29.2017765045166 47.82090759277344 42.43814468383789 29.755647659301758 47.23863220214844 | ||
WCW 41.64666748046875 29.21222686767578 46.958892822265625 41.139888763427734 29.2017765045166 47.82090759277344 42.16964340209961 30.064558029174805 46.96408462524414 | ||
WCW 41.64666748046875 29.21222686767578 46.958892822265625 41.139888763427734 29.2017765045166 47.82090759277344 41.111446380615234 28.96769142150879 46.150352478027344 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 46.20960998535156 34.230098724365234 49.565521240234375 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 45.35662841796875 34.91427230834961 49.88496398925781 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.22610855102539 34.317527770996094 48.66962814331055 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.11109161376953 34.746253967285156 50.20753479003906 |
This file contains 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,51 @@ | ||
10 | ||
HDBSCAN | ||
FCW HCW WCW | ||
False | ||
10 9 8 7 6 5 4 3 2 | ||
0.0 | ||
0.8 | ||
True | ||
0.85 | ||
120.0 | ||
0.4 | ||
5.0 | ||
17.0 | ||
0.15 | ||
15.0 | ||
17.0 | ||
20.0 | ||
0.7 | ||
0.03 | ||
0.05 0.01 | ||
0.05 0.001 | ||
1 | ||
0 | ||
0 | ||
0 | ||
False | ||
False | ||
FCW 41.068180084228516 30.142730712890625 41.10182189941406 41.66721725463867 29.93570899963379 40.32832336425781 41.67447280883789 30.349889755249023 41.86960983276367 | ||
FCW 46.2599983215332 36.27909469604492 47.799095153808594 46.40528106689453 36.8060188293457 46.96168899536133 45.53178024291992 35.63311004638672 47.5701789855957 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.57703399658203 29.518451690673828 46.76020050048828 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.7336540222168 29.52460289001465 46.767112731933594 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 46.796688079833984 29.28479766845703 46.859107971191406 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 47.06808090209961 29.681392669677734 46.571876525878906 | ||
WCW 39.01727294921875 28.470001220703125 45.4654541015625 39.796817779541016 28.641372680664062 46.067901611328125 38.63682556152344 27.556671142578125 45.32023620605469 | ||
WCW 39.01727294921875 28.470001220703125 45.4654541015625 38.598297119140625 28.485820770263672 46.373313903808594 38.417484283447266 29.076522827148438 44.94355010986328 | ||
WCW 41.53099822998047 29.199005126953125 47.10000228881836 40.590145111083984 29.131559371948242 47.43204116821289 41.907108306884766 29.717559814453125 47.867881774902344 | ||
WCW 41.53099822998047 29.199005126953125 47.10000228881836 41.02421951293945 29.188554763793945 47.96201705932617 42.32247543334961 29.7424259185791 47.37974166870117 | ||
WCW 41.53099822998047 29.199005126953125 47.10000228881836 41.02421951293945 29.188554763793945 47.96201705932617 42.05397415161133 30.05133628845215 47.105194091796875 | ||
WCW 41.53099822998047 29.199005126953125 47.10000228881836 41.02421951293945 29.188554763793945 47.96201705932617 40.99577713012695 28.954469680786133 46.29146194458008 | ||
WCW 41.38667297363281 29.2388916015625 49.453338623046875 40.45566177368164 29.181554794311523 49.09288024902344 41.444602966308594 29.98031234741211 50.12187194824219 | ||
WCW 41.38667297363281 29.2388916015625 49.453338623046875 40.38933563232422 29.288846969604492 49.400211334228516 41.74907684326172 30.13817596435547 49.20848846435547 | ||
WCW 41.38667297363281 29.2388916015625 49.453338623046875 40.38933563232422 29.288846969604492 49.400211334228516 41.71467208862305 28.75216293334961 48.64370346069336 | ||
WCW 41.38667297363281 29.2388916015625 49.453338623046875 40.61896896362305 29.564220428466797 50.00541687011719 41.91059875488281 28.852718353271484 50.21253204345703 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 46.20960998535156 34.230098724365234 49.565521240234375 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 45.35662841796875 34.91427230834961 49.88496398925781 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.22610855102539 34.317527770996094 48.66962814331055 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.11109161376953 34.746253967285156 50.20753479003906 | ||
WCW 40.217777252197266 28.26666831970215 42.95000457763672 40.36005783081055 27.290151596069336 43.111778259277344 40.27594757080078 28.985763549804688 42.257530212402344 | ||
WCW 40.217777252197266 28.26666831970215 42.95000457763672 40.36005783081055 27.290151596069336 43.111778259277344 40.48881530761719 28.353918075561523 41.991397857666016 | ||
WCW 40.217777252197266 28.26666831970215 42.95000457763672 40.36005783081055 27.290151596069336 43.111778259277344 40.08379364013672 28.8424129486084 43.7565803527832 | ||
WCW 40.217777252197266 28.26666831970215 42.95000457763672 39.507957458496094 28.19581413269043 42.24919509887695 40.97538375854492 28.760726928710938 42.523460388183594 |
This file contains 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,32 @@ | ||
10 | ||
HDBSCAN | ||
onlyO | ||
False | ||
10 9 8 7 6 5 4 3 2 | ||
0.0 | ||
0.8 | ||
True | ||
0.85 | ||
120.0 | ||
0.4 | ||
5.0 | ||
17.0 | ||
0.15 | ||
15.0 | ||
17.0 | ||
20.0 | ||
0.7 | ||
0.03 | ||
0.05 0.01 | ||
0.05 0.001 | ||
1 | ||
0 | ||
0 | ||
0 | ||
False | ||
False | ||
O_clust 46.712730407714844 29.038183212280273 45.893638610839844 | ||
O_clust 41.068180084228516 30.142730712890625 41.10182189941406 | ||
O_clust 41.64666748046875 29.21222686767578 46.958892822265625 | ||
O_clust 46.2599983215332 36.27909469604492 47.799095153808594 | ||
O_clust 45.247276306152344 33.96091079711914 49.6036376953125 |
This file contains 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,37 @@ | ||
10 | ||
HDBSCAN | ||
FCW HCW WCW | ||
False | ||
8 | ||
0.0 | ||
0.8 | ||
True | ||
0.85 | ||
120.0 | ||
0.4 | ||
5.0 | ||
17.0 | ||
0.15 | ||
15.0 | ||
17.0 | ||
20.0 | ||
0.7 | ||
0.03 | ||
0.05 0.01 | ||
0.05 0.001 | ||
1 | ||
0 | ||
0 | ||
0 | ||
False | ||
False | ||
FCW 46.2599983215332 36.27909469604492 47.799095153808594 46.40528106689453 36.8060188293457 46.96168899536133 45.53178024291992 35.63311004638672 47.5701789855957 | ||
FCW 41.23272705078125 30.330909729003906 40.98818588256836 41.84754180908203 30.135316848754883 40.22415542602539 41.8143424987793 30.42807960510254 41.79582595825195 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.57703399658203 29.518451690673828 46.76020050048828 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.7336540222168 29.52460289001465 46.767112731933594 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 46.796688079833984 29.28479766845703 46.859107971191406 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 47.06808090209961 29.681392669677734 46.571876525878906 | ||
WCW 38.71666717529297 28.565555572509766 45.59444808959961 39.27976989746094 28.85868263244629 46.36709976196289 39.268402099609375 28.068113327026367 44.925018310546875 | ||
WCW 38.71666717529297 28.565555572509766 45.59444808959961 39.27976989746094 28.85868263244629 46.36709976196289 38.426761627197266 27.61688995361328 45.46800231933594 | ||
WCW 38.71666717529297 28.565555572509766 45.59444808959961 38.116878509521484 29.172077178955078 45.07254409790039 38.5151252746582 27.902780532836914 44.873260498046875 | ||
WCW 38.71666717529297 28.565555572509766 45.59444808959961 38.116878509521484 29.172077178955078 45.07254409790039 38.096839904785156 28.39474105834961 46.36037063598633 |
This file contains 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,57 @@ | ||
10 | ||
OPTICS | ||
FCW HCW WCW | ||
True | ||
10 9 8 7 6 5 4 3 2 | ||
0.1 0.05 0.01 0.005 0.001 0.0005 0.0001 1e-05 | ||
0.8 | ||
True | ||
0.85 | ||
120.0 | ||
0.4 | ||
5.0 | ||
17.0 | ||
0.15 | ||
15.0 | ||
17.0 | ||
20.0 | ||
0.7 | ||
0.03 | ||
0.05 0.01 | ||
0.05 0.001 | ||
1 | ||
0 | ||
0 | ||
0 | ||
False | ||
False | ||
FCW 41.23272705078125 30.330909729003906 40.98818588256836 41.84754180908203 30.135316848754883 40.22415542602539 41.8143424987793 30.42807960510254 41.79582595825195 | ||
FCW 46.2599983215332 36.27909469604492 47.799095153808594 46.40528106689453 36.8060188293457 46.96168899536133 45.53178024291992 35.63311004638672 47.5701789855957 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.57703399658203 29.518451690673828 46.76020050048828 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.107078552246094 28.24843406677246 45.991004943847656 46.7336540222168 29.52460289001465 46.767112731933594 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 46.796688079833984 29.28479766845703 46.859107971191406 | ||
WCW 46.712730407714844 29.038183212280273 45.893638610839844 46.524566650390625 28.066614151000977 46.03733444213867 47.06808090209961 29.681392669677734 46.571876525878906 | ||
WCW 41.665000915527344 29.24900245666504 46.48900604248047 41.0498161315918 29.52010154724121 45.74869918823242 41.19739532470703 29.277957916259766 47.37247085571289 | ||
WCW 41.665000915527344 29.24900245666504 46.48900604248047 40.7099609375 29.082006454467773 46.73397445678711 41.96389389038086 29.89197540283203 47.19416427612305 | ||
WCW 41.665000915527344 29.24900245666504 46.48900604248047 42.456478118896484 29.792423248291016 46.76874542236328 41.70244216918945 28.300355911254883 46.80311965942383 | ||
WCW 38.83000564575195 28.447998046875 45.4890022277832 39.38174057006836 27.9505558013916 44.81957244873047 39.46666717529297 28.566635131835938 46.2509651184082 | ||
WCW 38.83000564575195 28.447998046875 45.4890022277832 39.38174057006836 27.9505558013916 44.81957244873047 38.23021697998047 29.054519653320312 44.967098236083984 | ||
WCW 38.83000564575195 28.447998046875 45.4890022277832 38.62846374511719 27.78522300720215 44.76781463623047 38.21017837524414 28.277183532714844 46.25492477416992 | ||
WCW 40.85199737548828 27.82000160217285 43.040000915527344 40.67170333862305 28.283079147338867 43.90778732299805 40.88725280761719 28.550844192504883 42.35836410522461 | ||
WCW 40.85199737548828 27.82000160217285 43.040000915527344 40.67170333862305 28.283079147338867 43.90778732299805 40.26106262207031 27.014118194580078 43.00326919555664 | ||
WCW 45.27727508544922 26.86363983154297 46.12636184692383 44.44940948486328 26.706167221069336 46.664730072021484 45.97956466674805 26.252676010131836 46.491756439208984 | ||
WCW 45.27727508544922 26.86363983154297 46.12636184692383 44.44940948486328 26.706167221069336 46.664730072021484 45.003814697265625 26.586687088012695 45.2052116394043 | ||
WCW 45.27727508544922 26.86363983154297 46.12636184692383 45.43928527832031 26.17399024963379 45.42057418823242 44.90922546386719 26.213802337646484 46.7913818359375 | ||
WCW 45.27727508544922 26.86363983154297 46.12636184692383 45.43928527832031 26.17399024963379 45.42057418823242 44.353797912597656 27.235193252563477 46.030784606933594 | ||
WCW 42.93000411987305 26.560001373291016 47.17888641357422 42.991546630859375 26.679779052734375 48.169776916503906 42.173213958740234 26.345054626464844 46.56157684326172 | ||
WCW 42.93000411987305 26.560001373291016 47.17888641357422 42.261905670166016 25.81601333618164 47.16757583618164 42.56803512573242 27.41203498840332 46.80070877075195 | ||
WCW 42.93000411987305 26.560001373291016 47.17888641357422 42.261905670166016 25.81601333618164 47.16757583618164 42.63617706298828 26.932165145874023 48.05931854248047 | ||
WCW 43.17110824584961 26.85555648803711 42.74555969238281 42.3840217590332 26.301883697509766 42.47364044189453 43.57135009765625 26.591943740844727 43.623233795166016 | ||
WCW 43.17110824584961 26.85555648803711 42.74555969238281 42.735599517822266 26.46652603149414 41.933780670166016 42.30861282348633 27.14484405517578 43.160789489746094 | ||
WCW 43.17110824584961 26.85555648803711 42.74555969238281 42.735599517822266 26.46652603149414 41.933780670166016 43.8919563293457 27.3093204498291 42.221656799316406 | ||
WCW 47.64555740356445 33.075557708740234 50.49333572387695 46.68040084838867 33.10683822631836 50.23353576660156 48.1732177734375 33.91178512573242 50.34400177001953 | ||
WCW 47.64555740356445 33.075557708740234 50.49333572387695 46.68040084838867 33.10683822631836 50.23353576660156 47.751216888427734 33.867313385009766 51.094966888427734 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 46.20960998535156 34.230098724365234 49.565521240234375 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 45.019012451171875 33.98157501220703 48.63025665283203 45.35662841796875 34.91427230834961 49.88496398925781 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.22610855102539 34.317527770996094 48.66962814331055 | ||
WCW 45.247276306152344 33.96091079711914 49.6036376953125 44.58808135986328 33.21979522705078 49.73096466064453 45.11109161376953 34.746253967285156 50.20753479003906 |
Oops, something went wrong.