From 64849f57306fd920349b0c7e12100ce5f85820f8 Mon Sep 17 00:00:00 2001 From: neukym Date: Mon, 25 Nov 2024 16:19:07 +0000 Subject: [PATCH 1/6] First attempt at fix --- kymata/invokers/invoker_run_nkg_plotting.py | 1 - pyproject.toml | 12 ++++++++++++ submit_gridsearch.sh | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/kymata/invokers/invoker_run_nkg_plotting.py b/kymata/invokers/invoker_run_nkg_plotting.py index 86e49468..e5f8805c 100644 --- a/kymata/invokers/invoker_run_nkg_plotting.py +++ b/kymata/invokers/invoker_run_nkg_plotting.py @@ -40,7 +40,6 @@ def main(): ylim=-200, ) - fig.show() fig.savefig(Path(path_to_nkg_files, "expression_plot.png")) elif function_family_type == "ANN": diff --git a/pyproject.toml b/pyproject.toml index 61a6639e..704822b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,12 +48,24 @@ h5io = "^0.1.9" mkdocs-material = "^9.5.24" mkdocstrings = {extras = ["python"], version = "^0.25.1"} twine = "^5.1.1" +ipywidgets = "^8.1.5" +ipyevents = "^2.0.2" +cairocffi = "^1.7.1" +vtk = "^9.3.1" +pyqt5 = "^5.15.11" +vtk-osmesa = "^9.3.1" +mesa = "^3.0.3" [tool.poetry.dev-dependencies] pytest = "^8.3.2" ipdb = "^0.13.13" ruff = "^0.5.6" +[[tool.poetry.source]] +name = "vtk-osmesa" +url = "https://wheels.vtk.org" +priority = "supplemental" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/submit_gridsearch.sh b/submit_gridsearch.sh index 3aeca8cb..a51a3b22 100755 --- a/submit_gridsearch.sh +++ b/submit_gridsearch.sh @@ -21,11 +21,13 @@ ARG=${args[$SLURM_ARRAY_TASK_ID - 1]} module load apptainer apptainer exec \ -B /imaging/projects/cbu/kymata/ \ - /imaging/local/software/singularity_images/python/python_3.11.7-slim.sif \ + /imaging/local/software/singularity_images/ubuntu/ubuntu_22.04.5.sif \ bash -c \ " cd /imaging/projects/cbu/kymata/analyses/andy/kymata-core/ ; \ export VENV_PATH=~/poetry/ ; \ - \$VENV_PATH/bin/poetry run python -m kymata.invokers.run_gridsearch \ + export PYVISTA_OFF_SCREEN=true ; + export PYVISTA_USE_IPYVTK=true ; + xvfb-run \$VENV_PATH/bin/poetry run python -m kymata.invokers.run_gridsearch \ --config dataset4.yaml \ --input-stream auditory \ --transform-path 'predicted_function_contours/GMSloudness/stimulisig' \ From 0ff3857d0c1dcb5ccf7df4a77c66065e2d0ff091 Mon Sep 17 00:00:00 2001 From: neukym Date: Tue, 26 Nov 2024 13:16:52 +0000 Subject: [PATCH 2/6] Adds ability to try with the next available number of buffer --- submit_gridsearch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submit_gridsearch.sh b/submit_gridsearch.sh index a51a3b22..4cf7457e 100755 --- a/submit_gridsearch.sh +++ b/submit_gridsearch.sh @@ -27,7 +27,7 @@ apptainer exec \ export VENV_PATH=~/poetry/ ; \ export PYVISTA_OFF_SCREEN=true ; export PYVISTA_USE_IPYVTK=true ; - xvfb-run \$VENV_PATH/bin/poetry run python -m kymata.invokers.run_gridsearch \ + xvfb-run -a \$VENV_PATH/bin/poetry run python -m kymata.invokers.run_gridsearch \ --config dataset4.yaml \ --input-stream auditory \ --transform-path 'predicted_function_contours/GMSloudness/stimulisig' \ From 844e3adf3eef14f925cc8ed963e928280e049d73 Mon Sep 17 00:00:00 2001 From: young-x-skyee Date: Sun, 1 Dec 2024 11:35:18 +0000 Subject: [PATCH 3/6] fix #416 --- kymata/plot/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kymata/plot/plot.py b/kymata/plot/plot.py index f9109409..f4625f89 100644 --- a/kymata/plot/plot.py +++ b/kymata/plot/plot.py @@ -165,7 +165,7 @@ def _hexel_minimap_data(expression_set: HexelExpressionSet, best_transforms_left, best_transforms_right = expression_set.best_transforms() best_transforms_left = best_transforms_left[best_transforms_left[COL_LOGP_VALUE] < alpha_logp] best_transforms_right = best_transforms_right[best_transforms_right[COL_LOGP_VALUE] < alpha_logp] - if minimap_latency_range is not None or (None, None): + if minimap_latency_range is not None and not (None, None): # Filter the dataframe to keep rows where 'latency' is within the range best_transforms_left = best_transforms_left[(best_transforms_left['latency'] >= minimap_latency_range[0]) & (best_transforms_left['latency'] <= minimap_latency_range[1])] From ef2196fc4ac36462ba1c9fda2a0865acd7c0188a Mon Sep 17 00:00:00 2001 From: young-x-skyee Date: Sun, 1 Dec 2024 11:50:55 +0000 Subject: [PATCH 4/6] fix #417 --- kymata/plot/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kymata/plot/plot.py b/kymata/plot/plot.py index f4625f89..39bfdd7d 100644 --- a/kymata/plot/plot.py +++ b/kymata/plot/plot.py @@ -770,7 +770,7 @@ def _custom_label(transform_name): ) legends.append(top_legend) - __reposition_axes_for_legends(fig, legends) + __reposition_axes_for_legends(fig, legends) __add_text_annotations(axes_names, top_ax, bottom_ax, fig, paired_axes, ylim) From e2eb5f6f4e246761fb01298d64fc58ca04978682 Mon Sep 17 00:00:00 2001 From: young-x-skyee Date: Sun, 1 Dec 2024 12:01:31 +0000 Subject: [PATCH 5/6] Enhanced legend display function --- kymata/plot/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kymata/plot/plot.py b/kymata/plot/plot.py index 39bfdd7d..0954a27c 100644 --- a/kymata/plot/plot.py +++ b/kymata/plot/plot.py @@ -734,7 +734,7 @@ def _custom_label(transform_name): if show_legend: split_legend_at_n_transforms = 15 legend_n_col = 2 if len(custom_handles) > split_legend_at_n_transforms else 1 - if hidden_transforms_in_legend and len(not_shown) > 0: + if hidden_transforms_in_legend and len(not_shown) > 0 and legend_display is None: if len(not_shown) > split_legend_at_n_transforms: legend_n_col = 2 # Plot dummy legend for other transforms which are included in model selection but not plotted From b103e011a5af20e64347af28d7842866b7f633c0 Mon Sep 17 00:00:00 2001 From: young-x-skyee Date: Thu, 5 Dec 2024 22:53:27 +0000 Subject: [PATCH 6/6] Using higher precision for threshold p-valus --- kymata/plot/plot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kymata/plot/plot.py b/kymata/plot/plot.py index 0954a27c..3433a8b3 100644 --- a/kymata/plot/plot.py +++ b/kymata/plot/plot.py @@ -503,8 +503,10 @@ def expression_plot( sidak_corrected_alpha = 1 - ( (1 - alpha) - ** (1 / (2 * len(expression_set.latencies) * n_channels * len(show_only))) - ) + ** np.float128(1 / (2 + * len(expression_set.latencies) + * n_channels + * len(show_only)))) sidak_corrected_alpha = p_to_logp(sidak_corrected_alpha)