From 6995e0f4f7c42c67e52a288a3bdf301695342da2 Mon Sep 17 00:00:00 2001 From: Milton Pividori Date: Tue, 5 Sep 2023 21:32:36 -0600 Subject: [PATCH] ccc pvalue: split notebook into generate and plots --- .../00-ccc_pvalue_dist-generate.ipynb | 410 ++++++++++++++++ nbs/25_pvalue/00-ccc_pvalue_dist.ipynb | 427 ----------------- nbs/25_pvalue/01-ccc_pvalue_dist-plot.ipynb | 449 ++++++++++++++++++ .../py/00-ccc_pvalue_dist-generate.py | 88 ++++ ...lue_dist.py => 01-ccc_pvalue_dist-plot.py} | 42 +- 5 files changed, 977 insertions(+), 439 deletions(-) create mode 100644 nbs/25_pvalue/00-ccc_pvalue_dist-generate.ipynb delete mode 100644 nbs/25_pvalue/00-ccc_pvalue_dist.ipynb create mode 100644 nbs/25_pvalue/01-ccc_pvalue_dist-plot.ipynb create mode 100644 nbs/25_pvalue/py/00-ccc_pvalue_dist-generate.py rename nbs/25_pvalue/py/{00-ccc_pvalue_dist.py => 01-ccc_pvalue_dist-plot.py} (56%) diff --git a/nbs/25_pvalue/00-ccc_pvalue_dist-generate.ipynb b/nbs/25_pvalue/00-ccc_pvalue_dist-generate.ipynb new file mode 100644 index 00000000..84028cc7 --- /dev/null +++ b/nbs/25_pvalue/00-ccc_pvalue_dist-generate.ipynb @@ -0,0 +1,410 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ec52faa3-656f-483e-9617-d7ec0f7d818c", + "metadata": { + "papermill": { + "duration": 0.003068, + "end_time": "2023-09-05T07:37:27.955837", + "exception": false, + "start_time": "2023-09-05T07:37:27.952769", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Description" + ] + }, + { + "cell_type": "markdown", + "id": "51102f42-fcd9-4a58-9c8d-dfcd3d2d464e", + "metadata": { + "papermill": { + "duration": 0.002343, + "end_time": "2023-09-05T07:37:27.968715", + "exception": false, + "start_time": "2023-09-05T07:37:27.966372", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "Generates a distribution of pvalues under the null hypothesis of no association." + ] + }, + { + "cell_type": "markdown", + "id": "7006ceeb-2651-407d-bfa1-1039727649ef", + "metadata": { + "papermill": { + "duration": 0.002323, + "end_time": "2023-09-05T07:37:27.973524", + "exception": false, + "start_time": "2023-09-05T07:37:27.971201", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Modules loading" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "1ffa1a96-7545-40b9-ac8b-8627e13de8d4", + "metadata": { + "papermill": { + "duration": 0.753618, + "end_time": "2023-09-05T07:37:28.729601", + "exception": false, + "start_time": "2023-09-05T07:37:27.975983", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "from ccc.coef import ccc\n", + "from ccc import conf" + ] + }, + { + "cell_type": "markdown", + "id": "0d3cc810-4b17-4213-8f03-6fe7e97a0fe3", + "metadata": { + "papermill": { + "duration": 0.010291, + "end_time": "2023-09-05T07:37:28.742736", + "exception": false, + "start_time": "2023-09-05T07:37:28.732445", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Settings" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a8dfa548-6ce1-4edd-bef2-a919fc6ad850", + "metadata": {}, + "outputs": [], + "source": [ + "rs = np.random.RandomState(0)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "fd167aff-e768-416f-a078-f926f6023a1e", + "metadata": {}, + "outputs": [], + "source": [ + "DATA_N_OBJS, DATA_N_FEATURES = 100, 1000\n", + "PVALUE_N_PERMS = 10000" + ] + }, + { + "cell_type": "markdown", + "id": "26bab485-b08e-4f59-b547-1da68fd36d54", + "metadata": {}, + "source": [ + "# Paths" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "170ee0f3-a6dd-4c8b-9a99-ec6d02df8e2e", + "metadata": {}, + "outputs": [], + "source": [ + "OUTPUT_DIR = conf.RESULTS_DIR / \"ccc_null-pvalues\"\n", + "OUTPUT_DIR.mkdir(parents=True, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "d083d95e-247e-45cc-bc28-36cf8144383c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PosixPath('/opt/data/results/ccc_null-pvalues')" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "OUTPUT_DIR" + ] + }, + { + "cell_type": "markdown", + "id": "6b593ccb-bce7-4a6b-818f-79d5378d4610", + "metadata": { + "papermill": { + "duration": 0.010291, + "end_time": "2023-09-05T07:37:28.742736", + "exception": false, + "start_time": "2023-09-05T07:37:28.732445", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Generate random data" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "472ff1df-b4f6-417f-b396-58a55ce0e39a", + "metadata": { + "papermill": { + "duration": 0.006782, + "end_time": "2023-09-05T07:37:28.752055", + "exception": false, + "start_time": "2023-09-05T07:37:28.745273", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "data = rs.rand(DATA_N_OBJS, DATA_N_FEATURES)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "acd7a9c0-d8a8-46f5-ab60-2478347adf36", + "metadata": { + "papermill": { + "duration": 0.009477, + "end_time": "2023-09-05T07:37:28.764102", + "exception": false, + "start_time": "2023-09-05T07:37:28.754625", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(10, 1000)" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.shape" + ] + }, + { + "cell_type": "markdown", + "id": "7c24b674-edde-4b83-817d-c7f10729cdc8", + "metadata": { + "papermill": { + "duration": 0.002588, + "end_time": "2023-09-05T07:37:28.769908", + "exception": false, + "start_time": "2023-09-05T07:37:28.767320", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Run CCC" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "5513799a-a239-4c66-ba6f-88290caf4484", + "metadata": { + "papermill": { + "duration": 7825.040968, + "end_time": "2023-09-05T09:47:53.813585", + "exception": false, + "start_time": "2023-09-05T07:37:28.772617", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "res = ccc(data, n_jobs=conf.GENERAL[\"N_JOBS\"], pvalue_n_perms=PVALUE_N_PERMS, use_ari_numba=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "5525b4ef-2e2e-4338-b52a-37d8308e237d", + "metadata": {}, + "outputs": [], + "source": [ + "cm_values, cm_pvalues = res" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "e08382ef-423a-4114-9a8f-f1b5abc48055", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(45,)" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cm_values.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "46e8560e-4c1b-4e2b-b373-f42ca0a59819", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(45,)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cm_pvalues.shape" + ] + }, + { + "cell_type": "markdown", + "id": "d25a59fa-a22b-41e0-84a3-74414ddaad23", + "metadata": { + "papermill": { + "duration": 0.010299, + "end_time": "2023-09-05T09:47:53.827026", + "exception": false, + "start_time": "2023-09-05T09:47:53.816727", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Save" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "b11f71f7-bab8-4d83-bf49-fd9419648a3d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PosixPath('/opt/data/results/ccc_null-pvalues/cm_values.npy')" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "output_file = OUTPUT_DIR / \"cm_values.npy\"\n", + "display(output_file)\n", + "\n", + "np.save(output_file, cm_values)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "12968ead-2e56-4214-956c-08f4f02952e9", + "metadata": {}, + "outputs": [], + "source": [ + "output_file = OUTPUT_DIR / \"cm_pvalues.npy\"\n", + "np.save(output_file, cm_pvalues)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f57efbc-893b-44a7-bc7a-77ca6b72a60a", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "jupytext": { + "cell_metadata_filter": "all,-execution,-papermill,-trusted", + "text_representation": { + "extension": ".py", + "format_name": "percent", + "format_version": "1.3", + "jupytext_version": "1.11.5" + } + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + }, + "papermill": { + "default_parameters": {}, + "duration": 7827.528961, + "end_time": "2023-09-05T09:47:54.507084", + "environment_variables": {}, + "exception": null, + "input_path": "nbs/25_pvalue/00-ccc_pvalue_dist.ipynb", + "output_path": "nbs/25_pvalue/00-ccc_pvalue_dist.run.ipynb", + "parameters": {}, + "start_time": "2023-09-05T07:37:26.978123", + "version": "2.3.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/nbs/25_pvalue/00-ccc_pvalue_dist.ipynb b/nbs/25_pvalue/00-ccc_pvalue_dist.ipynb deleted file mode 100644 index 5d80328a..00000000 --- a/nbs/25_pvalue/00-ccc_pvalue_dist.ipynb +++ /dev/null @@ -1,427 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "ec52faa3-656f-483e-9617-d7ec0f7d818c", - "metadata": { - "papermill": { - "duration": 0.003068, - "end_time": "2023-09-05T07:37:27.955837", - "exception": false, - "start_time": "2023-09-05T07:37:27.952769", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Description" - ] - }, - { - "cell_type": "markdown", - "id": "51102f42-fcd9-4a58-9c8d-dfcd3d2d464e", - "metadata": { - "papermill": { - "duration": 0.002343, - "end_time": "2023-09-05T07:37:27.968715", - "exception": false, - "start_time": "2023-09-05T07:37:27.966372", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "Tests whether the distribution of pvalues generated by CCC is the expected one (uniform)." - ] - }, - { - "cell_type": "markdown", - "id": "7006ceeb-2651-407d-bfa1-1039727649ef", - "metadata": { - "papermill": { - "duration": 0.002323, - "end_time": "2023-09-05T07:37:27.973524", - "exception": false, - "start_time": "2023-09-05T07:37:27.971201", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Modules loading" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "1ffa1a96-7545-40b9-ac8b-8627e13de8d4", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T07:37:27.979350Z", - "iopub.status.busy": "2023-09-05T07:37:27.979148Z", - "iopub.status.idle": "2023-09-05T07:37:28.727834Z", - "shell.execute_reply": "2023-09-05T07:37:28.727328Z" - }, - "papermill": { - "duration": 0.753618, - "end_time": "2023-09-05T07:37:28.729601", - "exception": false, - "start_time": "2023-09-05T07:37:27.975983", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "import seaborn as sns\n", - "from scipy import stats\n", - "\n", - "from ccc.coef import ccc" - ] - }, - { - "cell_type": "markdown", - "id": "0d3cc810-4b17-4213-8f03-6fe7e97a0fe3", - "metadata": { - "papermill": { - "duration": 0.010291, - "end_time": "2023-09-05T07:37:28.742736", - "exception": false, - "start_time": "2023-09-05T07:37:28.732445", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Generate random data" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "472ff1df-b4f6-417f-b396-58a55ce0e39a", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T07:37:28.748301Z", - "iopub.status.busy": "2023-09-05T07:37:28.748209Z", - "iopub.status.idle": "2023-09-05T07:37:28.750838Z", - "shell.execute_reply": "2023-09-05T07:37:28.750489Z" - }, - "papermill": { - "duration": 0.006782, - "end_time": "2023-09-05T07:37:28.752055", - "exception": false, - "start_time": "2023-09-05T07:37:28.745273", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "data = np.random.rand(100, 1000)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "acd7a9c0-d8a8-46f5-ab60-2478347adf36", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T07:37:28.758674Z", - "iopub.status.busy": "2023-09-05T07:37:28.758591Z", - "iopub.status.idle": "2023-09-05T07:37:28.762434Z", - "shell.execute_reply": "2023-09-05T07:37:28.762098Z" - }, - "papermill": { - "duration": 0.009477, - "end_time": "2023-09-05T07:37:28.764102", - "exception": false, - "start_time": "2023-09-05T07:37:28.754625", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "(100, 1000)" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "data.shape" - ] - }, - { - "cell_type": "markdown", - "id": "7c24b674-edde-4b83-817d-c7f10729cdc8", - "metadata": { - "papermill": { - "duration": 0.002588, - "end_time": "2023-09-05T07:37:28.769908", - "exception": false, - "start_time": "2023-09-05T07:37:28.767320", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Run CCC" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "5513799a-a239-4c66-ba6f-88290caf4484", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T07:37:28.775785Z", - "iopub.status.busy": "2023-09-05T07:37:28.775687Z", - "iopub.status.idle": "2023-09-05T09:47:53.811926Z", - "shell.execute_reply": "2023-09-05T09:47:53.811411Z" - }, - "papermill": { - "duration": 7825.040968, - "end_time": "2023-09-05T09:47:53.813585", - "exception": false, - "start_time": "2023-09-05T07:37:28.772617", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [ - "res = ccc(data, n_jobs=20, pvalue_n_perms=1000, use_ari_numba=True)" - ] - }, - { - "cell_type": "markdown", - "id": "d25a59fa-a22b-41e0-84a3-74414ddaad23", - "metadata": { - "papermill": { - "duration": 0.010299, - "end_time": "2023-09-05T09:47:53.827026", - "exception": false, - "start_time": "2023-09-05T09:47:53.816727", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# Plots" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "615d9e99-d2d7-4cce-8517-32907a236b27", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T09:47:53.833975Z", - "iopub.status.busy": "2023-09-05T09:47:53.833809Z", - "iopub.status.idle": "2023-09-05T09:47:53.941806Z", - "shell.execute_reply": "2023-09-05T09:47:53.941490Z" - }, - "papermill": { - "duration": 0.113327, - "end_time": "2023-09-05T09:47:53.943247", - "exception": false, - "start_time": "2023-09-05T09:47:53.829920", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Text(0, 0.5, 'Frequency')" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEWCAYAAACJ0YulAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAY2klEQVR4nO3debRdZZ3m8e9jQAaZKwFjIARsVIKtlga0Wy0H7GIoFbVEYylGRNElWtpaXYBSDl2VLuzucmqLRaPlIkALgoqgq7REbBzKAYOCTFJE0BATIeDAII0Gf/3H2dkekntzz03uPif35vtZ666z97uH83vvTc5z3r332SdVhSRJAA8bdQGSpK2HoSBJahkKkqSWoSBJahkKkqSWoSBJahkKGqkkZyb5myna1/wk9yaZ1cxfkeR1U7HvZn9fTLJkqvY3ief9uyR3Jvn5FO/3NUm+OZX71PRnKKgzSX6S5P4k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ZZZA+V9WNSb4E/BD4PfDxqhrz0sbpYMC/898CZye5lt6hlZOratreUjvJ+cCzgdlJVgHvAbaH7l6/vM2FJKk10w8fSZImwVCQJLUMBUlSy1CQJLUMBUlSy1CQJtDcJuKIDdreluSMTaw/bS/x1bbNUJAmdj69D0r1W9y0SzOKoSBN7NPA85PsAJBkAfAo4C+SLG/u2/++sTZMcm/f9EuTnN1Mz0nymSTfa36e3nkvpAEYCtIEmntDXQkc2TQtBj4FvKv5JPgTgGc195Ma1IeBD1bVocCf07sPlTRyM/o2F9IUWn8I6ZLm8bXAy5KcSO//0VxgIb1bSgziecDCvju27pZk16q6Z0qrlibJUJAG8zngA83XHe4E/BL4K+DQqvplc1hoxzG267+PTP/yhwH/oaru76ZcafN4+EgaQFXdC1wBfILeqGE34D7g183dOI8aZ9Pbkxyc5GH0vuRnvS8Db14/k+RJHZQtTZqhIA3ufHrfR3BBVV0D/AC4nl5Q/Os425wCfIHed0P339L4L4FFzZet3wC8sbOqpUnwLqmSpJYjBUlSy1CQJLUMBUlSy1CQJLUMBUlSy1CQJLUMBUlS6/8D3pR73044RO0AAAAASUVORK5CYII=\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "plt.hist(res[1], bins=10, edgecolor=\"k\") # Adjust the number of bins as needed\n", - "plt.title(\"Distribution of Values\")\n", - "plt.xlabel(\"Value\")\n", - "plt.ylabel(\"Frequency\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "37a85073-a287-48e6-adc6-f86808f15111", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T09:47:53.957397Z", - "iopub.status.busy": "2023-09-05T09:47:53.957308Z", - "iopub.status.idle": "2023-09-05T09:47:54.050477Z", - "shell.execute_reply": "2023-09-05T09:47:54.049947Z" - }, - "papermill": { - "duration": 0.105293, - "end_time": "2023-09-05T09:47:54.051767", - "exception": false, - "start_time": "2023-09-05T09:47:53.946474", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "Text(0, 0.5, 'Density')" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEWCAYAAACJ0YulAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAApfElEQVR4nO3de5xVdb3/8deHq6Byk5FgBhhATKEEExFDlNIU7aJdLKzUzKSL2vV4wk6/o3biZKe0U+fkKTWPmOWltNQOmUp5IUWFQhCQi4IwgDCIoGIiMJ/fH5+1N1ucYfbM7LUvM+/n47Efe8+6ftbMnvVZ38v6LnN3REREADqVOgARESkfSgoiIpKlpCAiIllKCiIikqWkICIiWUoKIiKSpaQgJWVmPzOz/1egbQ0xs1fNrHPy84Nm9rlCbDvZ3h/N7NxCba8F+/2umW02sxcKvN3PmNmcQm5TKp+SgqTGzFab2T/M7BUz22pmj5rZF8ws+71z9y+4+7/lua2T9rWMu69x9wPcfXcBYr/czG7ea/unuvvMtm67hXEMBr4BjHL3t+01r9rMdpnZiEbW+52Z/bBYcUr7oaQgafugux8IDAWuBL4J/KLQOzGzLoXeZpkYCrzo7pv2nuHu64DZwNm5082sH3AaUNQEJu2DkoIUhbtvc/e7gU8A55rZOwDM7EYz+27yub+Z/SEpVWwxs0fMrJOZ/RIYAtyTVA/9s5nVmpmb2flmtgb4c8603AQxwsyeMLNtZnZXcsLEzCabWV1ujJnSiJlNAb4FfCLZ31PJ/Gx1VBLXt83seTPbZGY3mVnvZF4mjnPNbE1S9fMvTf1uzKx3sn59sr1vJ9s/CbgfGJTEcWMjq89kr6QATAUWu/siM5tuZs8mpbUlZvbhJmJ4y+9u7+o3M/usmS01s5fM7E9mNjSZbmb2o+T3sM3MFmb+vlJ5lBSkqNz9CaAOmNTI7G8k86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rxfzQQGEUMKZGPk4BROSO29jKzA939lYJGLdJCSgoi+fk9cHXyuMMewEvAPwFHu/tLSbXQfo2slzuOTO78TsCx7v6PdMIVaR1VH4nkwd1fBR4EbiBKDb2A7cC2ZDTOU5tYdaOZHW5mnYiH/GTcB1yU+cHMxqYQtkiLKSmI5O8W4nkEt7r7U8DfgcVEovhrE+tMB/5APBs6d0jjLwPjkoetLwG+kFrUIi2gUVJFRCRLJQUREclSUhARkSwlBRERyVJSEBGRLCUFERHJUlIQEZEsJQUREcn6//GE8LGTpxSvAAAAAElFTkSuQmCC\n", - "text/plain": [ - "
" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "sns.histplot(res[1], kde=True, color=\"blue\")\n", - "plt.title(\"Distribution of Values\")\n", - "plt.xlabel(\"Value\")\n", - "plt.ylabel(\"Density\")" - ] - }, - { - "cell_type": "markdown", - "id": "5417f0e8-47f6-46c2-a6f8-20151b027e67", - "metadata": { - "papermill": { - "duration": 0.003324, - "end_time": "2023-09-05T09:47:54.058742", - "exception": false, - "start_time": "2023-09-05T09:47:54.055418", - "status": "completed" - }, - "tags": [] - }, - "source": [ - "# KS" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "abf1ab0c-3528-4942-b6b0-f96c944f629c", - "metadata": { - "execution": { - "iopub.execute_input": "2023-09-05T09:47:54.066710Z", - "iopub.status.busy": "2023-09-05T09:47:54.066596Z", - "iopub.status.idle": "2023-09-05T09:47:54.070465Z", - "shell.execute_reply": "2023-09-05T09:47:54.070054Z" - }, - "papermill": { - "duration": 0.009253, - "end_time": "2023-09-05T09:47:54.071610", - "exception": false, - "start_time": "2023-09-05T09:47:54.062357", - "status": "completed" - }, - "tags": [] - }, - "outputs": [ - { - "data": { - "text/plain": [ - "KstestResult(statistic=0.017040737040737053, pvalue=0.11155111928549677)" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "stats.ks_1samp(res[1], stats.uniform.cdf)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8717c138-7fb9-4cc4-bba4-4fe5adeac802", - "metadata": { - "papermill": { - "duration": 0.003436, - "end_time": "2023-09-05T09:47:54.078738", - "exception": false, - "start_time": "2023-09-05T09:47:54.075302", - "status": "completed" - }, - "tags": [] - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.12" - }, - "papermill": { - "default_parameters": {}, - "duration": 7827.528961, - "end_time": "2023-09-05T09:47:54.507084", - "environment_variables": {}, - "exception": null, - "input_path": "nbs/25_pvalue/00-ccc_pvalue_dist.ipynb", - "output_path": "nbs/25_pvalue/00-ccc_pvalue_dist.run.ipynb", - "parameters": {}, - "start_time": "2023-09-05T07:37:26.978123", - "version": "2.3.4" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/nbs/25_pvalue/01-ccc_pvalue_dist-plot.ipynb b/nbs/25_pvalue/01-ccc_pvalue_dist-plot.ipynb new file mode 100644 index 00000000..7f9248e6 --- /dev/null +++ b/nbs/25_pvalue/01-ccc_pvalue_dist-plot.ipynb @@ -0,0 +1,449 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ec52faa3-656f-483e-9617-d7ec0f7d818c", + "metadata": { + "papermill": { + "duration": 0.003068, + "end_time": "2023-09-05T07:37:27.955837", + "exception": false, + "start_time": "2023-09-05T07:37:27.952769", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Description" + ] + }, + { + "cell_type": "markdown", + "id": "51102f42-fcd9-4a58-9c8d-dfcd3d2d464e", + "metadata": { + "papermill": { + "duration": 0.002343, + "end_time": "2023-09-05T07:37:27.968715", + "exception": false, + "start_time": "2023-09-05T07:37:27.966372", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "Tests whether the distribution of pvalues generated by CCC is the expected one (uniform)." + ] + }, + { + "cell_type": "markdown", + "id": "7006ceeb-2651-407d-bfa1-1039727649ef", + "metadata": { + "papermill": { + "duration": 0.002323, + "end_time": "2023-09-05T07:37:27.973524", + "exception": false, + "start_time": "2023-09-05T07:37:27.971201", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Modules loading" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "1ffa1a96-7545-40b9-ac8b-8627e13de8d4", + "metadata": { + "papermill": { + "duration": 0.753618, + "end_time": "2023-09-05T07:37:28.729601", + "exception": false, + "start_time": "2023-09-05T07:37:27.975983", + "status": "completed" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns\n", + "from scipy import stats\n", + "\n", + "from ccc import conf" + ] + }, + { + "cell_type": "markdown", + "id": "0d3cc810-4b17-4213-8f03-6fe7e97a0fe3", + "metadata": { + "papermill": { + "duration": 0.010291, + "end_time": "2023-09-05T07:37:28.742736", + "exception": false, + "start_time": "2023-09-05T07:37:28.732445", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Settings" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9a154623-c787-4a31-871a-cad173f0eb9f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "5b09ff83-5377-49a9-b24b-65c6c90277d6", + "metadata": {}, + "source": [ + "# Paths" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "0122253c-99c0-41e2-8807-60df86bf0619", + "metadata": {}, + "outputs": [], + "source": [ + "OUTPUT_DIR = conf.RESULTS_DIR / \"ccc_null-pvalues\"\n", + "OUTPUT_DIR.mkdir(parents=True, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "3003ed2c-5da0-43b9-969d-9cf037d05730", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PosixPath('/opt/data/results/ccc_null-pvalues')" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "OUTPUT_DIR" + ] + }, + { + "cell_type": "markdown", + "id": "6b593ccb-bce7-4a6b-818f-79d5378d4610", + "metadata": { + "papermill": { + "duration": 0.010291, + "end_time": "2023-09-05T07:37:28.742736", + "exception": false, + "start_time": "2023-09-05T07:37:28.732445", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Load CCC values and pvalues" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "472ff1df-b4f6-417f-b396-58a55ce0e39a", + "metadata": { + "papermill": { + "duration": 0.006782, + "end_time": "2023-09-05T07:37:28.752055", + "exception": false, + "start_time": "2023-09-05T07:37:28.745273", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(45,)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "output_file = OUTPUT_DIR / \"cm_values.npy\"\n", + "cm_values = np.load(output_file)\n", + "display(cm_values.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "3412010d-d281-4dfc-99de-61fc55f603cf", + "metadata": { + "papermill": { + "duration": 0.006782, + "end_time": "2023-09-05T07:37:28.752055", + "exception": false, + "start_time": "2023-09-05T07:37:28.745273", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(45,)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "output_file = OUTPUT_DIR / \"cm_pvalues.npy\"\n", + "cm_pvalues = np.load(output_file)\n", + "display(cm_pvalues.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "8448d17b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.021739130434782608" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "n_perms = cm_pvalues.shape[0]\n", + "min_pvalue_resolution = (0 + 1) / (n_perms + 1)\n", + "display(min_pvalue_resolution)" + ] + }, + { + "cell_type": "markdown", + "id": "d25a59fa-a22b-41e0-84a3-74414ddaad23", + "metadata": { + "papermill": { + "duration": 0.010299, + "end_time": "2023-09-05T09:47:53.827026", + "exception": false, + "start_time": "2023-09-05T09:47:53.816727", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# Plots" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "615d9e99-d2d7-4cce-8517-32907a236b27", + "metadata": { + "papermill": { + "duration": 0.113327, + "end_time": "2023-09-05T09:47:53.943247", + "exception": false, + "start_time": "2023-09-05T09:47:53.829920", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Text(0, 0.5, 'Frequency')" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEWCAYAAABsY4yMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVk0lEQVR4nO3de7hddX3n8feHBAXkpg1tI5hEHKtQR1sM1da72Co06thaZaqoWEUfR9Sq04DibdpOy0yr4lgfGq2jQEULKipPteo4qK0KBgW5pBdEQwDRgJRLZITgd/7YK7oJJ2Sdc/Y6l1/er+fZT/Zea6/1+/7OOfnstX977d9KVSFJas9u812AJGkYBrwkNcqAl6RGGfCS1CgDXpIaZcBLUqMMeE1MklOTvGlC+1qR5NYkS7rH5yV5yST23e3v00leOKn9TaPdP0lyfZLrJrzfFyX5x0nuU4ufAa9eknw3yW1Jbkny70m+kuTlSX76N1RVL6+qP+65r6fc03Oq6qqq2ruq7pxA7W9NcsZ2+z+yqj44231Ps44HAK8DDq2qX9xu3YFJtiZ50BTbfTzJX8xVnWqHAa/peHpV7QOsBP4cWAv8zaQbSbJ00vtcI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myXvu4fmL/vRT7ZoMeO1qzmT0ZZpxR3fLpaYY8NrVnA2sSXJvgCSrgPsDv59kfTff+Num2jDJrWP3n53kA939A5J8NMnXu9tjBu+F1IMBr11KN2fPBcDTukVHAx8B3th9E/jhwBO6eX76OgV4R1UdDvwuo/mBpHm3oKcqkAaybZjmE92/Lwaek+Q4Rv8nlgOHMpoSoI+nAIeOzWy5b5J9quqWiVYtTZMBr13ROcDbu8ug7QncCLweOLyqbuyGXvaYYrvxeT3G1+8G/HpV3TZMudLMOESjXU5V3QqcB7yf0dH8vsAW4KZutsIjd7Dp95MckmQ3Rhcc2eazwCu3PUjyKwOULU2bAa9d1ZmM5lL/cFVdDHwTuIxR6P/TDrY5ATiX0bVgx6dufRWwurs48uXAywerWpoGZ5OUpEZ5BC9JjTLgJalRBrwkNcqAl6RGGfCS1CgDXpIaZcBLUqP+PwbT1lL5SL04AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.hist(cm_pvalues, bins=10, edgecolor=\"k\") # Adjust the number of bins as needed\n", + "plt.title(\"Distribution of Values\")\n", + "plt.xlabel(\"Value\")\n", + "plt.ylabel(\"Frequency\")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "37a85073-a287-48e6-adc6-f86808f15111", + "metadata": { + "papermill": { + "duration": 0.105293, + "end_time": "2023-09-05T09:47:54.051767", + "exception": false, + "start_time": "2023-09-05T09:47:53.946474", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Text(0, 0.5, 'Density')" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEWCAYAAABsY4yMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAA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zPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLlAPezCxTDngzs0w54M3MMuWANzPLVGkBL2l7SX+UtFDSfEmfLmtbZma2oaYS170W+HxE3C1pS+AuSTdExIISt2lmZoXSavAR8VRE3F08fxFYCEwua3tmZra+PmmDl9QMvBG4o5N5p0maI2lOa2trXxTHzGxQKD3gJY0CrgA+ExEvdJwfEWdHREtEtEyaNKns4piZDRqlBrykIaRwvzAirixzW2Zmtr4ye9EI+AWwMCLOKms7ZmbWuTJr8AcAJwJvk3RPMR1Z4vbMzKxKad0kI+LPgMpav5mZbZyvZDUzy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy5QD3swsUw54M7NMOeDNzDLlgDczy1SpAS/pCEkPSHpI0pllbsvMzNZXWsBLagR+DMwApgHHS5pW1vbMzGx9Zdbg9wEeioiHI2I1cAlwdInbMzOzKoqIclYsHQscERH/XPx8IrBvRJzRYbnTgNOKH3cFHujBZiYCS3qhuPXG+z24eL8Hl57u9w4RMamzGU29U55OqZPXNjiaRMTZwNmbtAFpTkS0bMp765n3e3Dxfg8uvbnfZTbRPAFsX/XzFGBxidszM7MqZQb8X4FdJO0oaShwHHBVidszM7MqpTXRRMRaSWcAfwAagV9GxPxe3swmNe1kwPs9uHi/B5de2+/STrKamVn/8pWsZmaZcsCbmWVqwAd8d8MdKPlRMf8+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zsB3wQUlzivHGZ3X2Rkkrqp4fK+nc4vkkSVdI+msxHVD6XpjVwAFvg0oxZs+dwBHFS8cBlwJfLa4EfgPw1mKcn1r9EPh+ROwNvJc0PpBZvxvQQxWYlaTSTPO74vFU4P2STiP9T2wLTCMNCVCLQ4FpVSNbjpa0ZUS82KulNushB7wNRr8FzipugzYCeA74ArB3RDxXNL0M7+R91eN6VM9vAPaLiJfLKa7ZpnETjQ06EbECuBn4Jak2PxpYCTxfjFY4o4u3PiNpd0kNpBuOVFwPnFH5QdI/lVBssx5zwNtgdTFpLPVLIuJe4G/AfFLo39rFe84Efk+6F2z10K2fAlqKmyMvAD5eWqnNesCjSZqZZco1eDOzTDngzcwy5YA3M8uUA97MLFMOeDOzTDngzcwy5YA3M8vUfwNWLiCaaODVxwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "sns.histplot(cm_pvalues, kde=True, color=\"blue\")\n", + "plt.title(\"Distribution of Values\")\n", + "plt.xlabel(\"Value\")\n", + "plt.ylabel(\"Density\")" + ] + }, + { + "cell_type": "markdown", + "id": "5417f0e8-47f6-46c2-a6f8-20151b027e67", + "metadata": { + "papermill": { + "duration": 0.003324, + "end_time": "2023-09-05T09:47:54.058742", + "exception": false, + "start_time": "2023-09-05T09:47:54.055418", + "status": "completed" + }, + "tags": [] + }, + "source": [ + "# KS" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "abf1ab0c-3528-4942-b6b0-f96c944f629c", + "metadata": { + "papermill": { + "duration": 0.009253, + "end_time": "2023-09-05T09:47:54.071610", + "exception": false, + "start_time": "2023-09-05T09:47:54.062357", + "status": "completed" + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "KstestResult(statistic=0.13113311331133115, pvalue=0.387755581916863)" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stats.kstest(cm_pvalues, stats.uniform.cdf, args=(min_pvalue_resolution, 1-min_pvalue_resolution))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "acaf1613-b186-4ff1-8d22-e996662c5bec", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "jupytext": { + "cell_metadata_filter": "all,-execution,-papermill,-trusted", + "text_representation": { + "extension": ".py", + "format_name": "percent", + "format_version": "1.3", + "jupytext_version": "1.11.5" + } + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + }, + "papermill": { + "default_parameters": {}, + "duration": 7827.528961, + "end_time": "2023-09-05T09:47:54.507084", + "environment_variables": {}, + "exception": null, + "input_path": "nbs/25_pvalue/00-ccc_pvalue_dist.ipynb", + "output_path": "nbs/25_pvalue/00-ccc_pvalue_dist.run.ipynb", + "parameters": {}, + "start_time": "2023-09-05T07:37:26.978123", + "version": "2.3.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/nbs/25_pvalue/py/00-ccc_pvalue_dist-generate.py b/nbs/25_pvalue/py/00-ccc_pvalue_dist-generate.py new file mode 100644 index 00000000..401f9a9d --- /dev/null +++ b/nbs/25_pvalue/py/00-ccc_pvalue_dist-generate.py @@ -0,0 +1,88 @@ +# --- +# jupyter: +# jupytext: +# cell_metadata_filter: all,-execution,-papermill,-trusted +# text_representation: +# extension: .py +# format_name: percent +# format_version: '1.3' +# jupytext_version: 1.11.5 +# kernelspec: +# display_name: Python 3 (ipykernel) +# language: python +# name: python3 +# --- + +# %% [markdown] tags=[] +# # Description + +# %% [markdown] tags=[] +# Generates a distribution of pvalues under the null hypothesis of no association. + +# %% [markdown] tags=[] +# # Modules loading + +# %% tags=[] +import numpy as np + +from ccc.coef import ccc +from ccc import conf + +# %% [markdown] tags=[] +# # Settings + +# %% +rs = np.random.RandomState(0) + +# %% +DATA_N_OBJS, DATA_N_FEATURES = 100, 1000 +PVALUE_N_PERMS = 10000 + +# %% [markdown] +# # Paths + +# %% +OUTPUT_DIR = conf.RESULTS_DIR / "ccc_null-pvalues" +OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + +# %% +OUTPUT_DIR + +# %% [markdown] tags=[] +# # Generate random data + +# %% tags=[] +data = rs.rand(DATA_N_OBJS, DATA_N_FEATURES) + +# %% tags=[] +data.shape + +# %% [markdown] tags=[] +# # Run CCC + +# %% tags=[] +res = ccc(data, n_jobs=conf.GENERAL["N_JOBS"], pvalue_n_perms=PVALUE_N_PERMS, use_ari_numba=True) + +# %% +cm_values, cm_pvalues = res + +# %% +cm_values.shape + +# %% +cm_pvalues.shape + +# %% [markdown] tags=[] +# # Save + +# %% +output_file = OUTPUT_DIR / "cm_values.npy" +display(output_file) + +np.save(output_file, cm_values) + +# %% +output_file = OUTPUT_DIR / "cm_pvalues.npy" +np.save(output_file, cm_pvalues) + +# %% diff --git a/nbs/25_pvalue/py/00-ccc_pvalue_dist.py b/nbs/25_pvalue/py/01-ccc_pvalue_dist-plot.py similarity index 56% rename from nbs/25_pvalue/py/00-ccc_pvalue_dist.py rename to nbs/25_pvalue/py/01-ccc_pvalue_dist-plot.py index a333ee01..04b4e13b 100644 --- a/nbs/25_pvalue/py/00-ccc_pvalue_dist.py +++ b/nbs/25_pvalue/py/01-ccc_pvalue_dist-plot.py @@ -28,34 +28,52 @@ import seaborn as sns from scipy import stats -from ccc.coef import ccc +from ccc import conf # %% [markdown] tags=[] -# # Generate random data +# # Settings -# %% tags=[] -data = np.random.rand(100, 1000) +# %% -# %% tags=[] -data.shape +# %% [markdown] +# # Paths + +# %% +OUTPUT_DIR = conf.RESULTS_DIR / "ccc_null-pvalues" +OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + +# %% +OUTPUT_DIR # %% [markdown] tags=[] -# # Run CCC +# # Load CCC values and pvalues # %% tags=[] -res = ccc(data, n_jobs=20, pvalue_n_perms=1000, use_ari_numba=True) +output_file = OUTPUT_DIR / "cm_values.npy" +cm_values = np.load(output_file) +display(cm_values.shape) + +# %% tags=[] +output_file = OUTPUT_DIR / "cm_pvalues.npy" +cm_pvalues = np.load(output_file) +display(cm_pvalues.shape) + +# %% +n_perms = cm_pvalues.shape[0] +min_pvalue_resolution = (0 + 1) / (n_perms + 1) +display(min_pvalue_resolution) # %% [markdown] tags=[] # # Plots # %% tags=[] -plt.hist(res[1], bins=10, edgecolor="k") # Adjust the number of bins as needed +plt.hist(cm_pvalues, bins=10, edgecolor="k") # Adjust the number of bins as needed plt.title("Distribution of Values") plt.xlabel("Value") plt.ylabel("Frequency") # %% tags=[] -sns.histplot(res[1], kde=True, color="blue") +sns.histplot(cm_pvalues, kde=True, color="blue") plt.title("Distribution of Values") plt.xlabel("Value") plt.ylabel("Density") @@ -64,6 +82,6 @@ # # KS # %% tags=[] -stats.ks_1samp(res[1], stats.uniform.cdf) +stats.kstest(cm_pvalues, stats.uniform.cdf, args=(min_pvalue_resolution, 1-min_pvalue_resolution)) -# %% tags=[] +# %%