Skip to content

Commit abc82ba

Browse files
committed
add markdown in setup
1 parent 9e16a23 commit abc82ba

File tree

1 file changed

+84
-62
lines changed

1 file changed

+84
-62
lines changed

notebooks/tutorial.ipynb

Lines changed: 84 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"The package is designed to **process NeuroPixels ephys data** with **OpenEphys** and spike sorted with **Kilosort**."
36+
"The package is designed to **process NeuroPixels ephys data** with **OpenEphys** and spike sorted with **Kilosort**. The following Diagram corresponds to the `ephys_acute` module:"
3737
]
3838
},
3939
{
@@ -73,7 +73,7 @@
7373
"\n",
7474
"**- Step 4: Curate the Clustering Results (Optional)**\n",
7575
"\n",
76-
"**- Step 4: Visualize the Results**"
76+
"**- Step 5: Visualize the Results**"
7777
]
7878
},
7979
{
@@ -83,6 +83,17 @@
8383
"### **Setup**"
8484
]
8585
},
86+
{
87+
"cell_type": "markdown",
88+
"metadata": {},
89+
"source": [
90+
"This tutorial examines the `ephys_acute` module applied to physiological recordings and automatic ingestion of spike sorting results.\n",
91+
"\n",
92+
"The goal is to store, track and manage different curations of the spike sorting results and unit-level visualization results.\n",
93+
"\n",
94+
"The results of this Element example can be combined with other modalities to create a complete customizable data pipeline for your specific lab or study. For instance, you can combine `element-array-ephys` with `element-calcium-imaging` and `element-deeplabcut` to characterize the neural activity."
95+
]
96+
},
8697
{
8798
"cell_type": "markdown",
8899
"metadata": {},
@@ -603,6 +614,13 @@
603614
"ephys.Clustering.populate(session_key, display_progress=True)"
604615
]
605616
},
617+
{
618+
"cell_type": "markdown",
619+
"metadata": {},
620+
"source": [
621+
"### **Step 4: Curate the Clustering Results (Optional)**"
622+
]
623+
},
606624
{
607625
"attachments": {},
608626
"cell_type": "markdown",
@@ -657,54 +675,25 @@
657675
"cell_type": "markdown",
658676
"metadata": {},
659677
"source": [
660-
"Now that we've populated the tables in this workflow, there are one of\n",
661-
"several next steps. If you have an existing workflow for\n",
678+
"Now that we've populated the tables in this DataJoint pipeline, there are one of\n",
679+
"several next steps. If you have an existing pipeline for\n",
662680
"aligning waveforms to behavior data or other stimuli, you can easily\n",
663681
"invoke `element-event` or define your custom DataJoint tables to extend the\n",
664-
"pipeline.\n",
665-
"\n",
666-
"In this tutorial, we will do some exploratory analysis by fetching the data from the database and creating a few plots.\n",
667-
"\n",
668-
"## Querying Data\n",
669-
"\n",
670-
"DataJoint provides a powerful querying system, allowing you to retrieve and work with data stored in your database seamlessly. In this section, we'll explore the fundamental querying concepts.\n",
671-
"\n",
672-
"#### What is a Query?\n",
673-
"\n",
674-
"- A query is essentially a request for data. With DataJoint, you can craft specific queries to fetch data that meets your criteria from the database.\n",
675-
"\n",
676-
"#### The `fetch()` Method\n",
677-
"\n",
678-
"- The primary method for retrieving data from a DataJoint table is `fetch()`.\n",
679-
"- **Default Behavior**: Without any arguments, `fetch()` returns a list of dictionaries. Each dictionary corresponds to an entry in the table.\n",
680-
" \n",
681-
"#### The `fetch1()` Method\n",
682-
"\n",
683-
"- For tables with a single entry or when you're only interested in the first entry, use `fetch1()`.\n",
684-
"- **Default Behavior**: It returns a dictionary of attributes for that one entry.\n",
685-
"\n",
686-
"#### Specific Attributes\n",
687-
"\n",
688-
"- Both `fetch()` and `fetch1()` can be made more specific by providing attributes.\n",
689-
"- Example: `fetch1('fps')` will retrieve only the `fps` attribute from the first entry.\n",
690-
"\n",
691-
"#### Restricting Queries\n",
692-
"\n",
693-
"- Often, you don't want to fetch everything. Instead, you might want data related to a specific subject or session.\n",
694-
"- DataJoint uses the `&` operator to restrict queries.\n",
695-
"- Example: To get all session times for `subject5`, you might use:\n",
696-
" ```python\n",
697-
" subject1_times = (session.Session & \"subject = 'subject1'\").fetch(\"session_datetime\")\n",
698-
" ```\n",
699-
"\n",
700-
"#### Fetching Primary Keys\n",
701-
"\n",
702-
"- Sometimes, you just need the primary keys of entries.\n",
703-
"- Use the `fetch(\"KEY\")` syntax for this. For instance, `(session.Session).fetch(\"KEY\")`.\n",
704-
"\n",
705-
"#### Let's Dive In!\n",
706-
"\n",
707-
"Now that we've established the basics, let's delve deeper into querying with some practical examples."
682+
"pipeline."
683+
]
684+
},
685+
{
686+
"cell_type": "markdown",
687+
"metadata": {},
688+
"source": [
689+
"### **Step 5: Visualization of Results**"
690+
]
691+
},
692+
{
693+
"cell_type": "markdown",
694+
"metadata": {},
695+
"source": [
696+
"In this tutorial, we will do some exploratory analysis by fetching the data from the database and creating a few plots."
708697
]
709698
},
710699
{
@@ -825,16 +814,61 @@
825814
"cell_type": "markdown",
826815
"metadata": {},
827816
"source": [
828-
"## Conclusion\n",
817+
"## Summary\n",
829818
"\n",
819+
"Following this tutorial, we've efficiently: \n",
820+
"- covered the essential functionality of `element-array-ephys`\n",
821+
"- acquired the skills to register the electrophysiology recordings for each probe in each experimental session\n",
822+
"- insert data into tables\n",
823+
"- execute the spike sort with Kilosort\n",
824+
"- visualize the results "
825+
]
826+
},
827+
{
828+
"cell_type": "markdown",
829+
"metadata": {},
830+
"source": [
831+
"#### Documentation and DataJoint tutorials"
832+
]
833+
},
834+
{
835+
"cell_type": "markdown",
836+
"metadata": {},
837+
"source": [
838+
"For detailed documentation on `element-array-ephys`:\n",
839+
"\n",
840+
"[`DataJoint Element for Extracellular Electrophysiology - Documentation`](https://datajoint.com/docs/elements/element-array-ephys/)"
841+
]
842+
},
843+
{
844+
"cell_type": "markdown",
845+
"metadata": {},
846+
"source": [
847+
"For detailed documentation and tutorials on general DataJoint principles that support collaboration, automation, reproducibility, and visualizations:\n",
848+
"\n",
849+
"[`DataJoint for Python - Interactive Tutorials`](https://github.com/datajoint/datajoint-tutorials) covers fundamentals, including table tiers, query operations, fetch operations, automated computations with the make function, and more.\n",
850+
"\n",
851+
"[`DataJoint for Python - Documentation`](https://datajoint.com/docs/core/datajoint-python/0.14/)"
852+
]
853+
},
854+
{
855+
"cell_type": "markdown",
856+
"metadata": {},
857+
"source": [
858+
"#### Run this tutorial on your own data"
859+
]
860+
},
861+
{
862+
"cell_type": "markdown",
863+
"metadata": {},
864+
"source": [
830865
"Throughout this notebook, we've used DataJoint to work with database tables and keep\n",
831866
"data organized and automate analyses to increase efficiency of data processing. We've\n",
832867
"inserted data into tables, used queries to retrieve, manipulate, and visualize ephys data.\n",
833868
"\n",
834869
"Remember, this is just the beginning. As you grow familiar with DataJoint, you'll\n",
835870
"uncover even more ways to harness its capabilities for your specific research needs. \n",
836871
"\n",
837-
"---\n",
838872
"\n",
839873
"To run this tutorial notebook on your own data, please use the following steps:\n",
840874
"- Download the mysql-docker image for DataJoint and run the container according to the\n",
@@ -857,18 +891,6 @@
857891
"\n",
858892
"- Run this code block above and proceed with the rest of the notebook."
859893
]
860-
},
861-
{
862-
"cell_type": "code",
863-
"execution_count": null,
864-
"metadata": {},
865-
"outputs": [],
866-
"source": [
867-
"**Additional Resources:**\n",
868-
"- [Interactive Tutorials](https://github.com/datajoint/datajoint-tutorials) on `datajoint-python`: Dive deep into DataJoint's fundamentals.\n",
869-
"- [*`datajoint-python`* Documentation](https://datajoint.com/docs/core/datajoint-python/): Comprehensive documentation on DataJoint for Python.\n",
870-
"- [Element Array Electrophysiology Documentation](https://datajoint.com/docs/elements/element-array-ephys/): Detailed guide on the DataJoint Element for Array Electrophysiology.\n"
871-
]
872894
}
873895
],
874896
"metadata": {

0 commit comments

Comments
 (0)