|
@@ -2,7 +2,33 @@
|
|
|
"cells": [
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 9,
|
|
|
+ "execution_count": 7,
|
|
|
+ "id": "4001a375",
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "import sys, os\n",
|
|
|
+ "sys.path.append(os.path.join(os.getcwd(), '..'))\n",
|
|
|
+ "sys.path.append(os.path.join(os.getcwd(), '..', '..'))"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 11,
|
|
|
+ "id": "570920e2",
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "%matplotlib inline\n",
|
|
|
+ "\n",
|
|
|
+ "from session.sessions import selected_009266\n",
|
|
|
+ "from analysis.imports import *\n",
|
|
|
+ "#from analysis.loading import load_session_data"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 12,
|
|
|
"id": "51eeaa1d",
|
|
|
"metadata": {},
|
|
|
"outputs": [],
|
|
@@ -28,8 +54,8 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 10,
|
|
|
- "id": "0b384b99",
|
|
|
+ "execution_count": 13,
|
|
|
+ "id": "26ba4176",
|
|
|
"metadata": {},
|
|
|
"outputs": [
|
|
|
{
|
|
@@ -89,6 +115,121 @@
|
|
|
" return [has_h5_ephys(path), has_dat(path), has_clu(path), ch_num(path)]"
|
|
|
]
|
|
|
},
|
|
|
+ {
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "id": "b3b05781",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "## Unit count"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 14,
|
|
|
+ "id": "c12f7fc1",
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": [
|
|
|
+ "['009266_hippoSIT_2023-04-13_08-57-46',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-14_09-17-34',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-17_09-06-10',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-17_17-04-17',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-18_10-10-37',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-18_17-03-10',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-19_10-33-51',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-20_08-57-39',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-20_15-24-14',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-21_08-43-00',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-21_13-12-31',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-24_10-08-11',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-24_16-56-55',\n",
|
|
|
+ " '009266_hippoSIT_2023-04-26_08-20-17',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-02_12-22-14',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-04_09-11-06',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-04_19-47-15',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-22_09-27-22',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-23_09-18-05',\n",
|
|
|
+ " '009266_hippoSIT_2023-05-25_15-55-57',\n",
|
|
|
+ " '009266_hippoSIT_2023-06-14_08-21-23',\n",
|
|
|
+ " '009266_hippoSIT_2023-06-19_08-58-35']"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "execution_count": 14,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "sessions = [s for s in selected_009266.keys()]\n",
|
|
|
+ "sessions.sort()\n",
|
|
|
+ "sessions"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 17,
|
|
|
+ "id": "351ef94c",
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "unit_mx = np.zeros([len(sessions), 6]) # 6 shanks total\n",
|
|
|
+ "for i, session in enumerate(sessions):\n",
|
|
|
+ " animal = session.split('_')[0]\n",
|
|
|
+ " h5_file = os.path.join(source, animal, session, session + '.h5')\n",
|
|
|
+ " \n",
|
|
|
+ " with h5py.File(h5_file, 'r') as f:\n",
|
|
|
+ " unit_names = [x for x in f['units']]\n",
|
|
|
+ " \n",
|
|
|
+ " shanks = np.unique([int(x[0]) for x in unit_names])\n",
|
|
|
+ " shanks.sort()\n",
|
|
|
+ " for shank in shanks:\n",
|
|
|
+ " unit_mx[i, shank - 1] = len([x for x in unit_names if int(x[0]) == shank])"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 19,
|
|
|
+ "id": "c8ecf2cb",
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": [
|
|
|
+ "array([[ 6, 2, 6, 3, 0, 0],\n",
|
|
|
+ " [11, 1, 6, 2, 1, 0],\n",
|
|
|
+ " [ 8, 1, 6, 5, 1, 0],\n",
|
|
|
+ " [14, 2, 7, 3, 1, 0],\n",
|
|
|
+ " [12, 13, 14, 6, 4, 0],\n",
|
|
|
+ " [17, 10, 13, 5, 3, 0],\n",
|
|
|
+ " [19, 5, 6, 8, 3, 0],\n",
|
|
|
+ " [ 0, 4, 15, 8, 5, 3],\n",
|
|
|
+ " [ 0, 1, 6, 6, 8, 3],\n",
|
|
|
+ " [ 0, 4, 17, 8, 6, 5],\n",
|
|
|
+ " [ 1, 4, 17, 8, 0, 1],\n",
|
|
|
+ " [22, 21, 0, 9, 1, 3],\n",
|
|
|
+ " [18, 1, 22, 4, 0, 7],\n",
|
|
|
+ " [ 2, 24, 9, 6, 5, 7],\n",
|
|
|
+ " [ 0, 17, 0, 9, 5, 8],\n",
|
|
|
+ " [25, 29, 30, 14, 7, 19],\n",
|
|
|
+ " [30, 14, 7, 7, 1, 3],\n",
|
|
|
+ " [31, 34, 10, 2, 2, 12],\n",
|
|
|
+ " [22, 43, 4, 0, 1, 6],\n",
|
|
|
+ " [14, 41, 55, 2, 1, 7],\n",
|
|
|
+ " [11, 0, 35, 1, 1, 2],\n",
|
|
|
+ " [32, 0, 17, 1, 0, 0]], dtype=int16)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "execution_count": 19,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "unit_mx.astype(np.int16)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
{
|
|
|
"cell_type": "markdown",
|
|
|
"id": "531ad003",
|
|
@@ -401,7 +542,9 @@
|
|
|
"cell_type": "code",
|
|
|
"execution_count": 20,
|
|
|
"id": "d466c590",
|
|
|
- "metadata": {},
|
|
|
+ "metadata": {
|
|
|
+ "scrolled": true
|
|
|
+ },
|
|
|
"outputs": [
|
|
|
{
|
|
|
"data": {
|