{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# A new statistical method to analyze Morris Water Maze data using Dirichlet distribution\n", "\n", "This notebook shows how you can easily reproduce the results presented in our paper and apply the Dirichlet test to your own data using Python. You only have to modify the names of the files to load your own data.\n", "\n", "Follow the instructions alongside the code and run the code to obtain your results !\n", "\n", "*Remember*: you need to have a working installation of Python (2 or 3) and Jupyter." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load modules" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import sys\n", "sys.path.insert(0, '../')\n", "from dirichlet import dirichlet\n", "\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load data\n", "Data must be passed as a numpy 2D array where each row [TQ,AQ1,OQ,AQ2] represents one sample (note that each row will be normalized so that its sum is 1). If your data is in a `.csv` file, you can use `pandas` or `numpy`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### With pandas (if this doesn't work, just use numpy)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "data_3tg = pd.read_csv('3Tg.csv')\n", "data_wt = pd.read_csv('wt.csv')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | TQ | \n", "AQ1 | \n", "OQ | \n", "AQ2 | \n", "
|---|---|---|---|---|
| 0 | \n", "45.3 | \n", "15.7 | \n", "27.6 | \n", "11.4 | \n", "
| 1 | \n", "21.2 | \n", "21.9 | \n", "24.4 | \n", "32.5 | \n", "
| 2 | \n", "26.2 | \n", "31.3 | \n", "21.5 | \n", "21.0 | \n", "
| 3 | \n", "37.0 | \n", "24.5 | \n", "12.3 | \n", "26.3 | \n", "
| 4 | \n", "30.2 | \n", "32.7 | \n", "16.8 | \n", "20.3 | \n", "
| 5 | \n", "28.9 | \n", "20.9 | \n", "18.8 | \n", "31.5 | \n", "
| 6 | \n", "22.8 | \n", "30.0 | \n", "29.1 | \n", "18.2 | \n", "