Sfoglia il codice sorgente

more AEP processing

asobolev 10 mesi fa
parent
commit
55fbf13149

File diff suppressed because it is too large
+ 129 - 301
analysis/AEPs/AEP_MoSeq_Neuro.ipynb


File diff suppressed because it is too large
+ 94 - 99
analysis/AEPs/preprocessing.ipynb


File diff suppressed because it is too large
+ 398 - 501
analysis/AEPs/visualizing.ipynb


File diff suppressed because it is too large
+ 235 - 179
analysis/CCR.ipynb


File diff suppressed because it is too large
+ 825 - 4
playground.ipynb


+ 19 - 19
postprocessing/MoSeq.ipynb

@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 53,
+   "execution_count": 162,
    "id": "c4461104",
    "metadata": {},
    "outputs": [],
@@ -24,7 +24,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 163,
    "id": "20f34373",
    "metadata": {},
    "outputs": [
@@ -52,7 +52,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "3f458c67",
+   "id": "733dd36d",
    "metadata": {},
    "source": [
     "## Read MoSeq source file"
@@ -302,7 +302,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "afdbf7cb",
+   "id": "ba4c8762",
    "metadata": {},
    "source": [
     "## Create moseq processed file in the session"
@@ -335,7 +335,7 @@
   {
    "cell_type": "code",
    "execution_count": 140,
-   "id": "940a25dc",
+   "id": "e1135957",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -349,7 +349,7 @@
   {
    "cell_type": "code",
    "execution_count": 141,
-   "id": "15fa95a9",
+   "id": "57cd7a46",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -362,7 +362,7 @@
   {
    "cell_type": "code",
    "execution_count": 142,
-   "id": "7178d8d5",
+   "id": "1992e8a7",
    "metadata": {},
    "outputs": [
     {
@@ -385,7 +385,7 @@
   {
    "cell_type": "code",
    "execution_count": 143,
-   "id": "7f40333f",
+   "id": "d7456dfe",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -397,7 +397,7 @@
   {
    "cell_type": "code",
    "execution_count": 144,
-   "id": "9e3c38b4",
+   "id": "d12f64b2",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -413,7 +413,7 @@
   {
    "cell_type": "code",
    "execution_count": 145,
-   "id": "374b61a3",
+   "id": "15583cbc",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -428,7 +428,7 @@
   {
    "cell_type": "code",
    "execution_count": 146,
-   "id": "8cf4fd3a",
+   "id": "4550d764",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -450,7 +450,7 @@
   {
    "cell_type": "code",
    "execution_count": 147,
-   "id": "247dd217",
+   "id": "a620621a",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -461,7 +461,7 @@
   {
    "cell_type": "code",
    "execution_count": 148,
-   "id": "df439db9",
+   "id": "aab44ba2",
    "metadata": {
     "scrolled": true
    },
@@ -502,7 +502,7 @@
   {
    "cell_type": "code",
    "execution_count": 149,
-   "id": "7728db64",
+   "id": "c59cec3a",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -514,7 +514,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "cf73b011",
+   "id": "b7684257",
    "metadata": {},
    "source": [
     "## Assembly and syllables analysis"
@@ -523,7 +523,7 @@
   {
    "cell_type": "code",
    "execution_count": 161,
-   "id": "b1bb83d0",
+   "id": "67dbdfb4",
    "metadata": {},
    "outputs": [
     {
@@ -828,7 +828,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "fa1de3f0",
+   "id": "c80d130b",
    "metadata": {},
    "source": [
     "## Correlation with binary syllable"
@@ -864,7 +864,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "9f663fcc",
+   "id": "0c9dfef8",
    "metadata": {},
    "source": [
     "## Syllable proportion in diff states"
@@ -950,7 +950,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "34267618",
+   "id": "91b55d64",
    "metadata": {},
    "source": [
     "## Syllable occurence"

+ 8 - 16
postprocessing/execute.ipynb

@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 46,
    "id": "c37dce82",
    "metadata": {
     "scrolled": true
@@ -39,7 +39,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 47,
    "id": "a8ea2991",
    "metadata": {},
    "outputs": [
@@ -75,7 +75,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 27,
+   "execution_count": 48,
    "id": "3891b792",
    "metadata": {},
    "outputs": [],
@@ -100,12 +100,8 @@
     "#sessions = [filebase]\n",
     "#sessions = processed_008229\n",
     "sessions = [\n",
-    "'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-19_10-33-51',\n",
-    "'009266_hippoSIT_2023-04-20_08-57-39',\n",
+    "'009266_hippoSIT_2023-04-18_10-10-37',  # ch17, 10 + 55 correction, 5682 events\n",
+    "'009266_hippoSIT_2023-04-18_17-03-10',  # ch17, 6 + 55 correction, 5494 events: FIXME very weird 1-2nd in target, find out\n",
     "]\n",
     "\n",
     "# FIXME move occupancy outside units\n",
@@ -145,7 +141,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 28,
+   "execution_count": 49,
    "id": "24cd2f6e",
    "metadata": {},
    "outputs": [
@@ -153,12 +149,8 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "session 009266_hippoSIT_2023-04-13_08-57-46 done\n",
-      "session 009266_hippoSIT_2023-04-14_09-17-34 done\n",
-      "session 009266_hippoSIT_2023-04-17_09-06-10 done\n",
-      "session 009266_hippoSIT_2023-04-17_17-04-17 done\n",
-      "session 009266_hippoSIT_2023-04-19_10-33-51 done\n",
-      "session 009266_hippoSIT_2023-04-20_08-57-39 done\n"
+      "session 009266_hippoSIT_2023-04-18_10-10-37 done\n",
+      "session 009266_hippoSIT_2023-04-18_17-03-10 done\n"
      ]
     }
    ],

+ 73 - 0
postprocessing/manual.ipynb

@@ -245,6 +245,79 @@
    "metadata": {},
    "outputs": [],
    "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5149a1e2",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "fdd8c434",
+   "metadata": {},
+   "source": [
+    "## Copy H5 from selected sessions to a separate folder"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "id": "fb60603b",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import shutil\n",
+    "\n",
+    "source = '/home/sobolev/nevermind/Andrey/data'\n",
+    "dest = '/home/sobolev/nevermind/Andrey/sandbox/export'\n",
+    "\n",
+    "selected_sessions = [\n",
+    "'009266_hippoSIT_2023-04-17_17-04-17',  # ch17, 20 + 55 correction, 5067 events. Showcase for N2 / N3 mod in target\n",
+    "'009266_hippoSIT_2023-04-18_10-10-37',  # ch17, 10 + 55 correction, 5682 events\n",
+    "'009266_hippoSIT_2023-04-18_17-03-10',  # ch17, 6 + 55 correction, 5494 events: FIXME very weird 1-2nd in target, find out\n",
+    "'009266_hippoSIT_2023-04-19_10-33-51',  # ch17, 4 + 55 correction, 6424 events: very weird 1-2nd in target, find out\n",
+    "'009266_hippoSIT_2023-04-20_08-57-39',  # ch1, 1 + 55 correction, 6424 events. Showcase for N2 / N3 mod in target\n",
+    "'009266_hippoSIT_2023-04-24_16-56-55',  # ch17, 5 + 55* correction, 6165 events, frequency\n",
+    "'009266_hippoSIT_2023-04-26_08-20-17',  # ch17, 12 + 55* correction, 6095 events, duration - showcase for N2 \n",
+    "'009266_hippoSIT_2023-05-02_12-22-14',  # ch20, 10 + 55 correction, 5976 events, FIXME very weird 1-2nd in target, find out\n",
+    "'009266_hippoSIT_2023-05-04_09-11-06',  # ch17, 5 + 55* correction, 4487 events, coma session with baseline AEPs\n",
+    "#'009266_hippoSIT_2023-05-04_19-47-15',  # ch20, 2 + 55 correction, 5678 events, duration\n",
+    "]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "id": "42475af4",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "for session in selected_sessions:\n",
+    "    animal      = session.split('_')[0]\n",
+    "\n",
+    "    # create folder\n",
+    "    session_src = os.path.join(source, animal, session)\n",
+    "    session_dst = os.path.join(dest, animal, session)\n",
+    "    if not os.path.exists(session_dst):\n",
+    "        os.makedirs(session_dst)\n",
+    "        \n",
+    "    # copy files\n",
+    "    for f_name in ['AEPs.h5', session + '.h5']:\n",
+    "        src = os.path.join(session_src, f_name)\n",
+    "        dst = os.path.join(session_dst, f_name)\n",
+    "        shutil.copyfile(src, dst)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "48ac0857",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {