Skip to content

Commit a92e972

Browse files
authored
Merge pull request #20 from kabilar/main
Update readme. Fix notebooks.
2 parents 36cce12 + 72a1de8 commit a92e972

File tree

4 files changed

+54
-92
lines changed

4 files changed

+54
-92
lines changed
File renamed without changes.

00-Getting_started/01-DataJoint Basics - Interactive.ipynb renamed to 00-Getting_Started/01-DataJoint Basics - Interactive.ipynb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
]
7777
},
7878
{
79+
"attachments": {},
7980
"cell_type": "markdown",
8081
"metadata": {},
8182
"source": [
@@ -86,7 +87,7 @@
8687
"> * In a session of electrophysiology\n",
8788
">> * you record electrical activity from a single neuron. You use recording equipment that produces separate data files for each neuron you recorded.\n",
8889
">> * Neuron's activities are recorded as raw traces. Neuron's spikes needs to be detected for further analysis to be performed.\n",
89-
"> * In a sesssion of calcium imaging\n",
90+
"> * In a session of calcium imaging\n",
9091
">> * you scan a brain region containing a number of neurons. You use recording equipment that produces separate data files for each scan you performed.\n",
9192
">> * you would like to segment the frames and get the regions of interest (ROIs), and save a mask for each ROI\n",
9293
">> * finally you would like to extract the trace from each segmented ROI"
@@ -107,6 +108,7 @@
107108
]
108109
},
109110
{
111+
"attachments": {},
110112
"cell_type": "markdown",
111113
"metadata": {},
112114
"source": [
@@ -117,7 +119,7 @@
117119
"> * In a session of electrophysiology\n",
118120
">> * you record electrical activity from a **single neuron**. You use recording equipment that produces separate data files for each neuron you recorded.\n",
119121
">> * Neuron's activities are recorded as raw traces. **Neuron's spikes** needs to be detected for further analysis to be performed.\n",
120-
"> * In a sesssion of calcium imaging\n",
122+
"> * In a session of calcium imaging\n",
121123
">> * you scan a brain region containing a number of neurons. You use recording equipment that produces separate data files for each **scan** you performed.\n",
122124
">> * you would like to segment the frames and get the **regions of interest (ROIs)**, and save a mask for each ROI\n",
123125
">> * finally you would like to extract the **trace** from each segmented ROI"
@@ -225,17 +227,11 @@
225227
]
226228
},
227229
{
230+
"attachments": {},
228231
"cell_type": "markdown",
229232
"metadata": {},
230233
"source": [
231-
"We create the schema using `dj.schema()` function, passing in the name of the schema. For this workshop, you are given the database privilege to create any schema **starting with your username followed by a `_` charcter**. So if your username is `john`, you can make any schema starting with `john_`, such as `john_tutorial`."
232-
]
233-
},
234-
{
235-
"cell_type": "markdown",
236-
"metadata": {},
237-
"source": [
238-
"Let's create a schema called `pipeline`, prefixed by `username_`."
234+
"We create the schema using `dj.schema()` function, passing in the name of the schema. For this workshop, you are given the database privilege to use any schema name. Let's create a schema called `tutorial`."
239235
]
240236
},
241237
{
@@ -244,7 +240,7 @@
244240
"metadata": {},
245241
"outputs": [],
246242
"source": [
247-
"schema = dj.schema('{YOUR_USERNAME}_tutorial')"
243+
"schema = dj.schema('tutorial')"
248244
]
249245
},
250246
{
@@ -555,7 +551,7 @@
555551
"source": [
556552
"Note that, to uniquely identify an experimental session (or simply a **session**), we need to know the mouse that the session was about. In other words, a session cannot existing without a corresponding mouse! \n",
557553
"\n",
558-
"With **mouse** already represented as a table in our pipeline, we say that the session **depends on** the mouse! We could graphically represent this in an **entity relationship diagram (ERD)** by drawing the line between two tables, with the one below (**session**) dependeing on the one above (**mouse**)."
554+
"With **mouse** already represented as a table in our pipeline, we say that the session **depends on** the mouse! We could graphically represent this in an **entity relationship diagram (ERD)** by drawing the line between two tables, with the one below (**session**) depending on the one above (**mouse**)."
559555
]
560556
},
561557
{
@@ -1181,11 +1177,12 @@
11811177
]
11821178
},
11831179
{
1180+
"attachments": {},
11841181
"cell_type": "markdown",
11851182
"metadata": {},
11861183
"source": [
11871184
"### Rename attribute with proj()\n",
1188-
"Say we want to rename the exisiting attribute `dob` of the `Mouse` table to `date_of_birth`, this can be done using `.proj()`"
1185+
"Say we want to rename the existing attribute `dob` of the `Mouse` table to `date_of_birth`, this can be done using `.proj()`"
11891186
]
11901187
},
11911188
{
@@ -1215,10 +1212,11 @@
12151212
]
12161213
},
12171214
{
1215+
"attachments": {},
12181216
"cell_type": "markdown",
12191217
"metadata": {},
12201218
"source": [
1221-
"Note: as you can see, the projection results keep the primary attributes from the `Mouse * Session` joinning operation, while removing all other non-primary attributes. To Keep all other attributes, you can use the `...` syntax"
1219+
"Note: as you can see, the projection results keep the primary attributes from the `Mouse * Session` joining operation, while removing all other non-primary attributes. To Keep all other attributes, you can use the `...` syntax"
12221220
]
12231221
},
12241222
{

03-Completed_Exercises/01-DataJoint Basics - Completed.ipynb

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@
4545
]
4646
},
4747
{
48+
"attachments": {},
4849
"cell_type": "markdown",
4950
"metadata": {},
5051
"source": [
5152
"If you visit the [documentation for DataJoint](https://docs.datajoint.io/introduction/Data-pipelines.html), we define a data pipeline as follows:\n",
5253
"> A data pipeline is a sequence of steps (more generally a directed acyclic graph) with integrated storage at each step. These steps may be thought of as nodes in a graph.\n",
5354
"\n",
54-
"While this is an accurate description, it may not be the most intuitive definition. Put succinctly, a data pipeline is a listing or a \"map\" of various \"things\" that you work with in a project, with line connecting things to each other to indicate their dependecies. The \"things\" in a data pipeline tends to be the *nouns* you find when describing a project. The \"things\" may include anything from mouse, experimenter, equipment, to experiment session, trial, two-photon scans, electric activities, to receptive fields, neuronal spikes, to figures for a publication! A data pipeline gives you a framework to:\n",
55+
"While this is an accurate description, it may not be the most intuitive definition. Put succinctly, a data pipeline is a listing or a \"map\" of various \"things\" that you work with in a project, with line connecting things to each other to indicate their dependencies. The \"things\" in a data pipeline tends to be the *nouns* you find when describing a project. The \"things\" may include anything from mouse, experimenter, equipment, to experiment session, trial, two-photon scans, electric activities, to receptive fields, neuronal spikes, to figures for a publication! A data pipeline gives you a framework to:\n",
5556
"\n",
5657
"1. define these \"things\" as tables in which you can store the information about them\n",
5758
"2. define the relationships (in particular the dependencies) between the \"things\"\n",
@@ -76,6 +77,7 @@
7677
]
7778
},
7879
{
80+
"attachments": {},
7981
"cell_type": "markdown",
8082
"metadata": {},
8183
"source": [
@@ -86,7 +88,7 @@
8688
"> * In a session of electrophysiology\n",
8789
">> * you record electrical activity from a single neuron. You use recording equipment that produces separate data files for each neuron you recorded.\n",
8890
">> * Neuron's activities are recorded as raw traces. Neuron's spikes needs to be detected for further analysis to be performed.\n",
89-
"> * In a sesssion of calcium imaging\n",
91+
"> * In a session of calcium imaging\n",
9092
">> * you scan a brain region containing a number of neurons. You use recording equipment that produces separate data files for each scan you performed.\n",
9193
">> * you would like to segment the frames and get the regions of interest (ROIs), and save a mask for each ROI\n",
9294
">> * finally you would like to extract the trace from each segmented ROI"
@@ -107,6 +109,7 @@
107109
]
108110
},
109111
{
112+
"attachments": {},
110113
"cell_type": "markdown",
111114
"metadata": {},
112115
"source": [
@@ -117,7 +120,7 @@
117120
"> * In a session of electrophysiology\n",
118121
">> * you record electrical activity from a **single neuron**. You use recording equipment that produces separate data files for each neuron you recorded.\n",
119122
">> * Neuron's activities are recorded as raw traces. **Neuron's spikes** needs to be detected for further analysis to be performed.\n",
120-
"> * In a sesssion of calcium imaging\n",
123+
"> * In a session of calcium imaging\n",
121124
">> * you scan a brain region containing a number of neurons. You use recording equipment that produces separate data files for each **scan** you performed.\n",
122125
">> * you would like to segment the frames and get the **regions of interest (ROIs)**, and save a mask for each ROI\n",
123126
">> * finally you would like to extract the **trace** from each segmented ROI"
@@ -225,17 +228,11 @@
225228
]
226229
},
227230
{
231+
"attachments": {},
228232
"cell_type": "markdown",
229233
"metadata": {},
230234
"source": [
231-
"We create the schema using `dj.schema()` function, passing in the name of the schema. For this workshop, you are given the database privilege to create any schema **starting with your username followed by a `_` charcter**. So if your username is `john`, you can make any schema starting with `john_`, such as `john_tutorial`."
232-
]
233-
},
234-
{
235-
"cell_type": "markdown",
236-
"metadata": {},
237-
"source": [
238-
"Let's create a schema called `pipeline`, prefixed by `username_`."
235+
"We create the schema using `dj.schema()` function, passing in the name of the schema. For this workshop, you are given the database privilege to use any schema name. Let's create a schema called `tutorial`."
239236
]
240237
},
241238
{
@@ -252,7 +249,7 @@
252249
}
253250
],
254251
"source": [
255-
"schema = dj.schema('{YOUR_USERNAME}_tutorial')"
252+
"schema = dj.schema('tutorial')"
256253
]
257254
},
258255
{
@@ -1059,12 +1056,13 @@
10591056
]
10601057
},
10611058
{
1059+
"attachments": {},
10621060
"cell_type": "markdown",
10631061
"metadata": {},
10641062
"source": [
10651063
"Note that, to uniquely identify an experimental session (or simply a **session**), we need to know the mouse that the session was about. In other words, a session cannot existing without a corresponding mouse! \n",
10661064
"\n",
1067-
"With **mouse** already represented as a table in our pipeline, we say that the session **depends on** the mouse! We could graphically represent this in an **entity relationship diagram (ERD)** by drawing the line between two tables, with the one below (**session**) dependeing on the one above (**mouse**)."
1065+
"With **mouse** already represented as a table in our pipeline, we say that the session **depends on** the mouse! We could graphically represent this in an **entity relationship diagram (ERD)** by drawing the line between two tables, with the one below (**session**) depending on the one above (**mouse**)."
10681066
]
10691067
},
10701068
{
@@ -1109,47 +1107,7 @@
11091107
"outputs": [
11101108
{
11111109
"data": {
1112-
"image/svg+xml": [
1113-
"<svg height=\"114pt\" viewBox=\"0.00 0.00 66.69 114.00\" width=\"67pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
1114-
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 110)\">\n",
1115-
"<title>%3</title>\n",
1116-
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-110 62.6914,-110 62.6914,4 -4,4\" stroke=\"transparent\"/>\n",
1117-
"<!-- Mouse -->\n",
1118-
"<g class=\"node\" id=\"node1\">\n",
1119-
"<title>Mouse</title>\n",
1120-
"<g id=\"a_node1\"><a xlink:title=\"mouse_id             \r",
1121-
"------------------------------\r",
1122-
"dob=null             \r",
1123-
"sex=&quot;unknown&quot;        \r",
1124-
"\">\n",
1125-
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"55.3633,-106 3.3281,-106 3.3281,-71 55.3633,-71 55.3633,-106\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n",
1126-
"<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"11.3369\" y=\"-86.7994\">Mouse</text>\n",
1127-
"</a>\n",
1128-
"</g>\n",
1129-
"</g>\n",
1130-
"<!-- Session -->\n",
1131-
"<g class=\"node\" id=\"node2\">\n",
1132-
"<title>Session</title>\n",
1133-
"<g id=\"a_node2\"><a xlink:title=\"→ Mouse\r",
1134-
"session_date         \r",
1135-
"------------------------------\r",
1136-
"experiment_setup     \r",
1137-
"experimenter         \r",
1138-
"data_path=&quot;&quot;         \r",
1139-
"\">\n",
1140-
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"58.5379,-35 .1535,-35 .1535,0 58.5379,0 58.5379,-35\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n",
1141-
"<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"8\" y=\"-15.7994\">Session</text>\n",
1142-
"</a>\n",
1143-
"</g>\n",
1144-
"</g>\n",
1145-
"<!-- Mouse&#45;&gt;Session -->\n",
1146-
"<g class=\"edge\" id=\"edge1\">\n",
1147-
"<title>Mouse-&gt;Session</title>\n",
1148-
"<path d=\"M29.3457,-70.9494C29.3457,-60.1083 29.3457,-46.2366 29.3457,-35.3418\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
1149-
"</g>\n",
1150-
"</g>\n",
1151-
"</svg>"
1152-
],
1110+
"image/svg+xml": "<svg height=\"114pt\" viewBox=\"0.00 0.00 66.69 114.00\" width=\"67pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 110)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" points=\"-4,4 -4,-110 62.6914,-110 62.6914,4 -4,4\" stroke=\"transparent\"/>\n<!-- Mouse -->\n<g class=\"node\" id=\"node1\">\n<title>Mouse</title>\n<g id=\"a_node1\"><a xlink:title=\"mouse_id             \r\n------------------------------\r\ndob=null             \r\nsex=&quot;unknown&quot;        \r\n\">\n<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"55.3633,-106 3.3281,-106 3.3281,-71 55.3633,-71 55.3633,-106\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"11.3369\" y=\"-86.7994\">Mouse</text>\n</a>\n</g>\n</g>\n<!-- Session -->\n<g class=\"node\" id=\"node2\">\n<title>Session</title>\n<g id=\"a_node2\"><a xlink:title=\"→ Mouse\r\nsession_date         \r\n------------------------------\r\nexperiment_setup     \r\nexperimenter         \r\ndata_path=&quot;&quot;         \r\n\">\n<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"58.5379,-35 .1535,-35 .1535,0 58.5379,0 58.5379,-35\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"8\" y=\"-15.7994\">Session</text>\n</a>\n</g>\n</g>\n<!-- Mouse&#45;&gt;Session -->\n<g class=\"edge\" id=\"edge1\">\n<title>Mouse-&gt;Session</title>\n<path d=\"M29.3457,-70.9494C29.3457,-60.1083 29.3457,-46.2366 29.3457,-35.3418\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n</g>\n</g>\n</svg>",
11531111
"text/plain": [
11541112
"<datajoint.diagram.Diagram at 0xa1d699588>"
11551113
]
@@ -1160,7 +1118,7 @@
11601118
}
11611119
],
11621120
"source": [
1163-
"dj.ERD(schema)"
1121+
"dj.Diagram(schema)"
11641122
]
11651123
},
11661124
{
@@ -4052,11 +4010,12 @@
40524010
]
40534011
},
40544012
{
4013+
"attachments": {},
40554014
"cell_type": "markdown",
40564015
"metadata": {},
40574016
"source": [
40584017
"### Rename attribute with proj()\n",
4059-
"Say we want to rename the exisiting attribute `dob` of the `Mouse` table to `date_of_birth`, this can be done using `.proj()`"
4018+
"Say we want to rename the existing attribute `dob` of the `Mouse` table to `date_of_birth`, this can be done using `.proj()`"
40604019
]
40614020
},
40624021
{
@@ -4284,10 +4243,11 @@
42844243
]
42854244
},
42864245
{
4246+
"attachments": {},
42874247
"cell_type": "markdown",
42884248
"metadata": {},
42894249
"source": [
4290-
"Note: as you can see, the projection results keep the primary attributes from the `Mouse * Session` joinning operation, while removing all other non-primary attributes. To Keep all other attributes, you can use the `...` syntax"
4250+
"Note: as you can see, the projection results keep the primary attributes from the `Mouse * Session` joining operation, while removing all other non-primary attributes. To Keep all other attributes, you can use the `...` syntax"
42914251
]
42924252
},
42934253
{

0 commit comments

Comments
 (0)