Skip to content

Commit 38c50fb

Browse files
committed
Markdown improvements in tutorial
1 parent 4190925 commit 38c50fb

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

notebooks/tutorial.ipynb

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
"source": [
88
"# DataJoint Element Tutorial: Array Electrophysiology\n",
99
"\n",
10-
"Welcome to the DataJoint Element tutorial for Array Electrophysiology! Dive into the world of automated analyses and organization of extracellular array electrophysiology data.\n",
10+
"Welcome to the tutorial for DataJoint's open-source data pipeline for NeuroPixels Array\n",
11+
"Electrophysiology. This tutorial aims to provide a comprehensive understanding of the\n",
12+
"open-source data pipeline created using `element-array-ephys` for processing\n",
13+
"and analyzing extracellular electrophysiology datasets. \n",
1114
"\n",
1215
"**In this tutorial, we will cover:**\n",
1316
"- The basics:\n",
14-
" - Differentiating between an Element and a pipeline.\n",
15-
" - How to plot the pipeline with `dj.Diagram`.\n",
17+
" - Differentiating between an Element, module, schema, table, and pipeline.\n",
18+
" - How to plot an overview of the pipeline with `dj.Diagram`.\n",
1619
"- Hands-on interactions with the pipeline:\n",
17-
" - Inserting data into tables.\n",
20+
" - Inserting real data into tables.\n",
1821
" - Querying table contents.\n",
1922
" - Fetching table contents.\n",
20-
" - Running the pipeline for your experiments.\n",
2123
"- A walk-through:\n",
22-
" - Processing NeuroPixels ephys data acquired with OpenEphys and sorted with Kilosort.\n",
24+
" - Processing NeuroPixels ephys data acquired with OpenEphys and spike sorted with Kilosort.\n",
2325
"\n",
2426
"**Additional Resources:**\n",
2527
"- [Interactive Tutorials](https://github.com/datajoint/datajoint-tutorials) on `datajoint-python`: Dive deep into DataJoint's fundamentals.\n",
@@ -51,10 +53,13 @@
5153
"Each DataJoint Element is a modular set of tables that can be combined into a complete\n",
5254
"pipeline. Here are the definitions for clarity:\n",
5355
"\n",
54-
"+ **Element**: A modular chunk of related tables.\n",
5556
"+ **Module**: In Python, a module is a file containing definitions and statements. In the context of DataJoint, modules often define and structure related database tables.\n",
57+
"+ **Table**: A structured set of data held within the database. It consists of rows and\n",
58+
" columns, much like an Excel spreadsheet.\n",
5659
"+ **Schema**: Think of a schema as a container or namespace within the database where related tables are grouped together. It helps organize and manage the database structure.\n",
57-
"+ **Table**: A structured set of data held within the database. It consists of rows and columns, much like an Excel spreadsheet.\n",
60+
"+ **Element**: A modular set of related tables. \n",
61+
"\n",
62+
"---\n",
5863
"\n",
5964
"Each Element contains 1 or more modules, and each module declares its own schema in the database.\n",
6065
"\n",
@@ -67,7 +72,9 @@
6772
"| Element Session | [Link](https://github.com/datajoint/element-session) | [Link](https://datajoint.com/docs/elements/element-session) | General information of experimental sessions. |\n",
6873
"| Element Array Ephys | [Link](https://github.com/datajoint/element-array-ephys) | [Link](https://datajoint.com/docs/elements/element-array-ephys) | NeuroPixels Array Electrophysiology analysis with Kilosort. |\n",
6974
"\n",
70-
"By importing the modules for the first time, the schemas and tables will be created in the database. Once created, importing modules will not create schemas and tables again, but the existing schemas/tables can be accessed.\n",
75+
"By importing the modules for the first time, the schemas and tables will be created in\n",
76+
"the database. Once created, importing modules will not create schemas and tables\n",
77+
"again, but will allow access to existing schemas/tables.\n",
7178
"\n",
7279
"The Elements are imported and activated within the `tutorial_pipeline` script."
7380
]
@@ -622,7 +629,7 @@
622629
"source": [
623630
"## Understanding Table Types in DataJoint\n",
624631
"\n",
625-
"In the previous section, we visualized the relationships between various tables in our pipeline using `dj.Diagram`. As you might have noticed, tables have different colors and shapes. This is because, in DataJoint, tables can be of different types, each serving a unique purpose.\n",
632+
"In the previous cell, we visualized the relationships between various tables in our pipeline using `dj.Diagram`. As you might have noticed, tables have different colors and shapes. This is because, in DataJoint, tables can be of different types, each serving a unique purpose.\n",
626633
"\n",
627634
"| Table tier | Color and shape | Description | Practical Example |\n",
628635
"| -- | -- | -- | -- |\n",
@@ -650,7 +657,7 @@
650657
"DataJoint offers a powerful set of commands that allow us to interact with the pipeline:\n",
651658
"\n",
652659
"- **Insert**: Manually add data to a table.\n",
653-
"- **Populate**: Automatically compute and add data based on existing data.\n",
660+
"- **Populate**: Automatically compute and insert data.\n",
654661
"- **Query**: Search and filter data.\n",
655662
"- **Fetch**: Retrieve data for further analysis or visualization.\n",
656663
"\n",
@@ -692,7 +699,7 @@
692699
}
693700
],
694701
"source": [
695-
"subject.Subject.describe()"
702+
"print(subject.Subject.describe())"
696703
]
697704
},
698705
{
@@ -1399,7 +1406,7 @@
13991406
"\n",
14001407
"- **Part Tables**: If a table has part tables associated with it, calling `populate()` on the main table will also populate its part tables. This is especially useful in cases like `ephys.EphysRecording` and its part table `ephys.EphysRecording.EphysFile`, as they are closely linked in terms of data lineage.\n",
14011408
"\n",
1402-
"- **Restriction**: The `populate()` method can be restricted to specific entries. For instance, by providing a `session_key`, we're ensuring the method only operates on the data relevant to that particular session. This is both efficient and avoids unnecessary operations on unrelated data.\n",
1409+
"- **Restriction**: The `populate()` method can be restricted to specific entries. For instance, by providing a `session_key`, we're ensuring the method only operates on the data relevant to that particular session. This is both efficient and avoids unnecessary operations.\n",
14031410
"\n",
14041411
"In the upcoming cells, we'll make use of the `populate()` method to fill the `ephys.EphysRecording` table and its part table. Remember, while this operation is automated, it's essential to understand the underlying logic to ensure accurate and consistent data entry.\n"
14051412
]
@@ -2448,10 +2455,20 @@
24482455
]
24492456
},
24502457
{
2451-
"attachments": {},
24522458
"cell_type": "markdown",
24532459
"metadata": {},
24542460
"source": [
2461+
"## Conclusion\n",
2462+
"\n",
2463+
"Throughout this notebook, we've used DataJoint to work with database tables and keep\n",
2464+
"data organized and automate analyses to increase efficiency of data processing. We've\n",
2465+
"inserted data into tables, used queries to retrieve, manipulate, and visualize ephys data.\n",
2466+
"\n",
2467+
"Remember, this is just the beginning. As you grow familiar with DataJoint, you'll\n",
2468+
"uncover even more ways to harness its capabilities for your specific research needs. \n",
2469+
"\n",
2470+
"---\n",
2471+
"\n",
24552472
"To run this tutorial notebook on your own data, please use the following steps:\n",
24562473
"- Download the mysql-docker image for DataJoint and run the container according to the\n",
24572474
" instructions provide in the repository.\n",
@@ -2471,12 +2488,18 @@
24712488
"dj.conn()\n",
24722489
"```\n",
24732490
"\n",
2474-
"- Run this code cell and proceed with the rest of the notebook."
2491+
"- Run this code block above and proceed with the rest of the notebook."
24752492
]
24762493
},
24772494
{
2478-
"cell_type": "markdown",
2479-
"metadata": {},
2495+
"cell_type": "code",
2496+
"execution_count": null,
2497+
"metadata": {
2498+
"vscode": {
2499+
"languageId": "plaintext"
2500+
}
2501+
},
2502+
"outputs": [],
24802503
"source": []
24812504
}
24822505
],

0 commit comments

Comments
 (0)