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

Plotting fix for CBU nodes #413

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions kymata/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])]
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -734,7 +736,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
Expand Down Expand Up @@ -770,7 +772,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)

Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 4 additions & 2 deletions submit_gridsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -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' \
Expand Down