How firnenemerald/junglab works
Project type and purpose
• This is not a traditional client–server or web-app system. It is a codebase for neuroscience experiment analysis (Jung Lab). It contains multiple analysis “pipelines” or modules (e.g., CLOI, ChAT, PV Analysis, behavior, Inscopix, DeepLabCut) that ingest raw data, preprocess it, run domain-specific computations, and produce results/plots.
File structure
• Top-level directories each represent a pipeline or experiment type: Behavior, CLOI, ChAT, Cluster, Inscopix, PVEPM, PVOF, PVYM, PV_Analysis.
• File finders and readers (e.g., filepathfinder.m, filereader_video.m, filereader_doric.m)
• Preprocessing steps (sync_dlc.m, smooth_dlc.m, fixerror_doric.m, kalmanfilter_h.m)
• Main orchestration scripts (mainscript.m, CLOI_MainScript.m, PV_YM_MainAnalysis.m)
• Analysis functions (clustering, SVM, PCA, correlation, behavior clustering)
• Plotting functions (PlotDLC, PlotCustomBar, plotCorrVsDistance)
• Data folders holding intermediate MAT or CSV dumps (data/*.mat, Verification/*.csv)
• Dev or Verification subdirectories for experiments and testing.
• Mixed MATLAB (.m) and Python (.py) code; external dependencies like DeepLabCut, Doric signal acquisition, Inscopix macros.
README for additional insights
a. Main components
• Data Sources (video files, Doric photometry, DeepLabCut outputs, Inscopix imaging)
• Shared Preprocessing Layer (file finder, reader, error correction, synchronization, smoothing, Kalman filters)
• Analysis Engine (clustering, SVM, PCA, correlation, behavioral metrics)
• Visualization/Reporting (plot functions, CSV exports)
• External Tools & Libraries (MATLAB runtime, Python environment, DeepLabCut library, Doric SDK, Inscopix macro)
b. Relationships and interactions
• From Preprocessing into each Pipeline Module’s Main Script
• Within each module: call sequence filefinder → filereader → preprocess → analysis functions → plot/export
• Dependencies on external toolboxes wherever applicable (DeepLabCut, Doric SDK)
c. Architectural patterns or design principles
• Modular pipeline design: each experiment type is isolated in its own namespace
• Reuse of common preprocessing functions across pipelines
• Clear separation of concerns: ingestion, cleaning, analysis, visualization
d. Technologies, frameworks, libraries
• MATLAB scripts (.m), MATLAB toolboxes (Signal Processing, Statistics)
• Python scripts for some real-time closed-loop tasks and DeepLabCut hooks
• DeepLabCut (pose estimation)
• Doric photometry hardware interface
• Inscopix imaging macros
Elements
• Blue for ingestion/preprocessing
• Green for analysis engines
• Orange for visualization
• Gray for external services/libraries
Detailed capture of architectural elements
• For each pipeline, call out its unique analysis functions (e.g., CLOI_GetMv, CHat_PlotSignal, PV_BatchProcess)
• CI/test subfolders under Dev/Verification showing where experimental code and validation data reside