Skip to content

Waveform-Analytics/mbon-dash-2025

Repository files navigation

🔬 Marine Bioacoustics GLMM Analysis

Acoustic indices as predictors of marine community patterns using Generalized Linear Mixed Models

🎯 Current Status: GLMM Analysis Complete!

Models Fitted: 5 community metrics successfully modeled
Significant Results: 20 acoustic-biological relationships found
Key Finding: Acoustic activity strongly predicts biological activity
Ready for Visualization: Interactive notebooks available


🚀 Quick Start (GLMM Analysis)

Want to explore the results? Jump straight to the interactive visualizations:

# View GLMM results interactively
cd notebooks
marimo edit glmm_visualization.py

Want to run the full pipeline?

# 1. Prepare data (Python)
cd python && uv run python FRESH-START-26SEP2025/scripts/04_prepare_for_glmm.py

# 2. Run GLMM analysis (R)
Rscript python/FRESH-START-26SEP2025/scripts/04_glmm_analysis_QUIET.R

# 3. Results are in: data/processed/04_glmm_results/

📊 What We Found

Key GLMM Results:

  • 🏆 Best Model: Fish abundance prediction (R² = 0.54)
  • 🎯 Strongest Predictor: Acoustic activity fraction (ACTtFraction)
  • 🔍 Surprising Finding: nROI negatively predicts species richness (acoustic artifact)
  • 📈 Signal Quality Matters: Higher SNR = more species detected

Biological Interpretation:

  • ✅ Acoustic monitoring can predict marine community patterns
  • ✅ Simple activity metrics work better than complex diversity indices
  • ✅ Environmental controls (station, season, depth) properly accounted for
  • ⚠️ Algorithm limitations affect some acoustic indices (nROI paradox)

📏 File Structure (Simplified)

✨ Currently Active:

mbon-dash-2025/
├── 📊 data/processed/04_glmm_results/  # ⬅️ GLMM outputs (tables, plots, models)
├── 🐍 python/FRESH-START-26SEP2025/   # Current analysis pipeline
│   ├── 04_prepare_for_glmm.py         # Python data prep
│   └── 04_glmm_analysis_QUIET.R       # R statistical analysis
├── 📊 notebooks/                   # Interactive visualization
│   └── glmm_visualization.py          # ⬅️ Marimo exploration notebook
├── 📋 notes/                        # Project documentation  
└── 🎠 R environment files            # renv.lock, .Rprofile

📋 Legacy/Background:

├── dashboard/     # Next.js web app (separate from GLMM work)
├── scripts/       # Build utilities
├── src/           # Python package (not needed for GLMM)
└── tools/         # Development utilities

⚙️ Environment Setup

Prerequisites

  • Python 3.12+ with uv package manager
  • R 4.3+ with renv for package management
  • Marimo for interactive notebooks

One-Time Setup

# 1. Python environment
cd python && uv install

# 2. R environment  
R -e "install.packages('renv'); renv::restore()"

# 3. Verify setup
uv run python --version
R --version
marimo --version

That's it! Everything is locked to specific versions.


📁 Key Outputs

GLMM Results

  • data/processed/04_glmm_results/tables/

    • fixed_effects_results.csv - All acoustic → biological relationships
    • model_fit_statistics.csv - R², AIC, BIC for each model
    • random_effects_results.csv - Variance components
  • data/processed/04_glmm_results/plots/

    • Effect plots for significant relationships
  • data/processed/04_glmm_results/models/

    • glmm_models.rds - R model objects for further analysis

Analysis Log

  • data/processed/glmm_analysis_log.txt - Complete analysis record

📋 Background & Documentation

Research Context: Can acoustic indices predict marine community patterns without manual species detection?

Data: 2021 May River recordings with manual fish detections as ground truth

Method: Generalized Linear Mixed Models controlling for spatial, temporal, and environmental variation

Key References:

  • Ferguson et al. (2023) - GLMM methodology for bioacoustics
  • Transue et al. (2023) - Acoustic indices in marine environments

Full Documentation: See notes/ directory and PROJECT_STRUCTURE.md


📄 License

MIT License - Copyright (c) 2025 Michelle Weirathmueller / Waveform Analytics, LLC


Contact: michelle@waveformanalytics

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •