Tutorials¶
Learn DataJoint by building real pipelines.
These tutorials guide you through building data pipelines step by step. Each tutorial is a Jupyter notebook, published here with its code and its executed outputs, so you can follow the whole pipeline without leaving the page. Start with the basics and progress to domain-specific and advanced topics.
Want to run them yourself? Every notebook can be downloaded and executed against your own MySQL or PostgreSQL database. Installation covers the setup: DataJoint, a database, Jupyter, and getting the notebooks.
Learning Paths¶
Choose your learning path based on your goals:
π± New to DataJoint¶
Goal: Understand core concepts and build your first pipeline
Path:
- First Pipeline β 30 min β Tables, queries, four core operations
- Schema Design β 45 min β Primary keys, relationships, table tiers
- Data Entry β 30 min β Inserting and managing data
- Queries β 45 min β Operators, restrictions, projections
- Try an example: University Database β Complete pipeline with realistic data
Next: Read Relational Workflow Model to understand the conceptual foundation.
π Building Production Pipelines¶
Goal: Create automated, scalable data processing workflows
Prerequisites: Complete basics above or have equivalent experience
Path:
- Computation β Automated processing with Imported/Computed tables
- Object Storage β Handle large data (arrays, files, images)
- Distributed Computing β Multi-worker parallel execution
- Practice: Fractal Pipeline or Blob Detection
Next:
- Run Computations β populate() usage patterns
- Distributed Computing β Cluster deployment
- Handle Errors β Job management and recovery
π§ͺ Domain-Specific Applications¶
Goal: Build scientific data pipelines for your field
Prerequisites: Complete basics, understand computation model
Production Software: DataJoint Elements
Standard pipelines for neurophysiology experiments, actively used in many labs worldwide. These are not tutorialsβthey are production-ready modular pipelines for calcium imaging, electrophysiology, array ephys, optogenetics, and more.
Learning tutorials (neuroscience):
- Calcium Imaging β Import movies, segment cells, extract traces
- Electrophysiology β Import recordings, spike detection, waveforms
- Allen CCF β Hierarchical brain atlas ontology
Complete demo pipeline:
- LC-MS Demo β Liquid chromatography-mass spectrometry pipeline showcasing DataJoint best practices with PostgreSQL: sample tracking, scan acquisition, mass spectral analysis, and parameterized peak detection
General patterns:
- Hotel Reservations β Booking systems with resource management
- Languages & Proficiency β Many-to-many relationships
π§ Extending DataJoint¶
Goal: Customize DataJoint for specialized needs
Prerequisites: Proficient with basics and production pipelines
Path:
- Custom Codecs β Create domain-specific data types
- JSON Data Type β Semi-structured data patterns
- SQL Comparison β Understand DataJoint's query algebra
Next:
- Codec API β Complete codec specification
- Create Custom Codec β Step-by-step codec development
Basics¶
Core concepts for getting started with DataJoint:
- First Pipeline β Tables, queries, and the four core operations
- Schema Design β Primary keys, relationships, and table tiers
- Data Entry β Inserting and managing data
- Queries β Operators and fetching results
- Computation β Imported and Computed tables
- Object Storage β Blobs, attachments, and object stores
Examples¶
Complete pipelines demonstrating DataJoint patterns:
- University Database β Academic records with students, courses, and grades
- Hotel Reservations β Booking system with rooms, guests, and reservations
- Languages & Proficiency β Language skills tracking with many-to-many relationships
- Fractal Pipeline β Iterative computation and parameter sweeps
- Blob Detection β Image processing with automated computation
Domain Tutorials¶
Real-world scientific pipelines:
- Calcium Imaging β Import TIFF movies, segment cells, extract fluorescence traces
- Electrophysiology β Import recordings, detect spikes, extract waveforms
- Electrophysiology with Object Storage β Neural data with
<npy@>lazy loading - Allen CCF β Brain atlas with hierarchical region ontology
Advanced Topics¶
Extending DataJoint for specialized use cases:
- SQL Comparison β DataJoint for SQL users
- JSON Data Type β Semi-structured data in tables
- Distributed Computing β Multi-process and cluster workflows
- Custom Codecs β Extending the type system