|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 1, |
| 6 | + "id": "71e121d4", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [], |
| 9 | + "source": [ |
| 10 | + "import simulation_tools as sim\n", |
| 11 | + "import pandas as pd" |
| 12 | + ] |
| 13 | + }, |
| 14 | + { |
| 15 | + "cell_type": "code", |
| 16 | + "execution_count": 2, |
| 17 | + "id": "fb17ca19", |
| 18 | + "metadata": {}, |
| 19 | + "outputs": [], |
| 20 | + "source": [ |
| 21 | + "# Path to a .csv file with connectomes in upper triangular form\n", |
| 22 | + "path_conn = \"/home/neuromod/ad_sz/data/abide/abide1_2_controls_concat.csv\"" |
| 23 | + ] |
| 24 | + }, |
| 25 | + { |
| 26 | + "cell_type": "code", |
| 27 | + "execution_count": 3, |
| 28 | + "id": "8b6c3bf5", |
| 29 | + "metadata": {}, |
| 30 | + "outputs": [], |
| 31 | + "source": [ |
| 32 | + "# Load control connectomes from ABIDE\n", |
| 33 | + "conn_df = pd.read_csv(path_conn)" |
| 34 | + ] |
| 35 | + }, |
| 36 | + { |
| 37 | + "cell_type": "code", |
| 38 | + "execution_count": 4, |
| 39 | + "id": "5df7cb69", |
| 40 | + "metadata": {}, |
| 41 | + "outputs": [], |
| 42 | + "source": [ |
| 43 | + "# Create a range of N values\n", |
| 44 | + "N_values = range(300, 951, 50)" |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + "cell_type": "code", |
| 49 | + "execution_count": 5, |
| 50 | + "id": "3b4565ab", |
| 51 | + "metadata": {}, |
| 52 | + "outputs": [ |
| 53 | + { |
| 54 | + "name": "stdout", |
| 55 | + "output_type": "stream", |
| 56 | + "text": [ |
| 57 | + "Simulation ran for N=300.\n", |
| 58 | + "Simulation ran for N=350.\n", |
| 59 | + "Simulation ran for N=400.\n", |
| 60 | + "Simulation ran for N=450.\n", |
| 61 | + "Simulation ran for N=500.\n", |
| 62 | + "Simulation ran for N=550.\n", |
| 63 | + "Simulation ran for N=600.\n", |
| 64 | + "Simulation ran for N=650.\n", |
| 65 | + "Simulation ran for N=700.\n", |
| 66 | + "Simulation ran for N=750.\n", |
| 67 | + "Simulation ran for N=800.\n", |
| 68 | + "Simulation ran for N=850.\n", |
| 69 | + "Simulation ran for N=900.\n", |
| 70 | + "Simulation ran for N=950.\n" |
| 71 | + ] |
| 72 | + } |
| 73 | + ], |
| 74 | + "source": [ |
| 75 | + "result_list = []\n", |
| 76 | + "# Loop through the values of N and run simulation with specififed parameters\n", |
| 77 | + "for N in N_values:\n", |
| 78 | + " result = sim.run_multiple_simulation(conn_df, N=N, pi=0.20, d=0.3, q=0.1, num_sample=100)\n", |
| 79 | + " print(f\"Simulation ran for N={N}.\")\n", |
| 80 | + " result_list.append(result)" |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + "cell_type": "code", |
| 85 | + "execution_count": 6, |
| 86 | + "id": "ebf2916e", |
| 87 | + "metadata": {}, |
| 88 | + "outputs": [ |
| 89 | + { |
| 90 | + "name": "stdout", |
| 91 | + "output_type": "stream", |
| 92 | + "text": [ |
| 93 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=300: 0.52, with mean specificity of 0.99.\n", |
| 94 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=350: 0.62, with mean specificity of 0.99.\n", |
| 95 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=400: 0.72, with mean specificity of 0.99.\n", |
| 96 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=450: 0.78, with mean specificity of 0.98.\n", |
| 97 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=500: 0.84, with mean specificity of 0.98.\n", |
| 98 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=550: 0.88, with mean specificity of 0.98.\n", |
| 99 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=600: 0.91, with mean specificity of 0.98.\n", |
| 100 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=650: 0.94, with mean specificity of 0.98.\n", |
| 101 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=700: 0.95, with mean specificity of 0.98.\n", |
| 102 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=750: 0.96, with mean specificity of 0.98.\n", |
| 103 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=800: 0.97, with mean specificity of 0.98.\n", |
| 104 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=850: 0.98, with mean specificity of 0.98.\n", |
| 105 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=900: 0.99, with mean specificity of 0.98.\n", |
| 106 | + "Estimated mean sensitivity to detect d=0.3, with pi=0.2%, q=0.1 and N=950: 0.99, with mean specificity of 0.98.\n" |
| 107 | + ] |
| 108 | + } |
| 109 | + ], |
| 110 | + "source": [ |
| 111 | + "for result in result_list:\n", |
| 112 | + " print(result)" |
| 113 | + ] |
| 114 | + }, |
| 115 | + { |
| 116 | + "cell_type": "code", |
| 117 | + "execution_count": null, |
| 118 | + "id": "cd6f422f", |
| 119 | + "metadata": {}, |
| 120 | + "outputs": [], |
| 121 | + "source": [] |
| 122 | + } |
| 123 | + ], |
| 124 | + "metadata": { |
| 125 | + "kernelspec": { |
| 126 | + "display_name": "Python 3 (ipykernel)", |
| 127 | + "language": "python", |
| 128 | + "name": "python3" |
| 129 | + }, |
| 130 | + "language_info": { |
| 131 | + "codemirror_mode": { |
| 132 | + "name": "ipython", |
| 133 | + "version": 3 |
| 134 | + }, |
| 135 | + "file_extension": ".py", |
| 136 | + "mimetype": "text/x-python", |
| 137 | + "name": "python", |
| 138 | + "nbconvert_exporter": "python", |
| 139 | + "pygments_lexer": "ipython3", |
| 140 | + "version": "3.10.10" |
| 141 | + } |
| 142 | + }, |
| 143 | + "nbformat": 4, |
| 144 | + "nbformat_minor": 5 |
| 145 | +} |
0 commit comments