BC Groundfish Synopsis Reports
Generate reproducible data synopsis reports for over 100 species of British Columbia groundfish with standardized visualizations and statistical analyses.
Description
This skill helps you work with the `gfsynopsis` R package repository, which creates technical reports with standardized visualizations of fisheries data including catch statistics, survey maps, length/age compositions, and abundance indices. The reports follow Canadian Science Advisory Secretariat (CSAS) formatting standards.
Instructions
When working with this repository, follow these guidelines:
1. Understanding the Report Generation Pipeline
The report generation follows a multi-step pipeline:
1. **Data Loading** - Cached data objects stored in `report/data-cache-*/` directories
2. **Model Fitting** - Survey indices and CPUE models fitted using sdmTMB and other statistical packages
3. **Figure Generation** - Species-specific 2-page figure sets created via `make_pages()` function
4. **Report Compilation** - Bookdown reports compiled from R Markdown files
2. Building Reports
To generate synopsis reports:
Run `Rscript report/make.R` to generate all synopsis figures (MUST be run before report rendering)For parallel processing: `./report/build_figures.sh` generates figures for all 116+ species using GNU parallelRender bookdown reports by navigating to specific report directories and running `csasdown::render()`Main report directories:
`report/tech-report-main/` - Main English technical report`report/tech-report-french-main/` - French technical report`report/tech-report-haida/` - Haida Gwaii regional report3. Key Data Processing Scripts
`report/R/03-load-data.R` - Load cached fisheries data`report/R/04-survey-index-standardization.R` - Fit survey abundance index models`report/R/05-cpue-index-standardization.R` - Fit commercial CPUE index models`report/R/06-build-figure-pages.R` - Generate species-specific figure pages4. Package Structure
The repository follows standard R package conventions:
`R/` - Core package functions (species page generation, data processing utilities)`DESCRIPTION` - Package dependencies and metadata`inst/` - Installed package files and example data`man/` - Documentation files5. Configuration and Settings
`report/R/01-settings.R` - Main configuration file controlling cache locations, processing options, and languages`_bookdown.yml` files define report structure and file orderFrench language support controlled via `french` parameter throughout pipeline6. Data Architecture
Species-specific cached data in RDS format organized by common name with hyphensSeparate cache folders for different report variants (main, haida)Raw CPUE cache, survey index cache, and map cache directoriesFigure pages stored as PNG files in `figure-pages/` directories7. Key Dependencies
Be aware of these critical R packages:
`gfplot`, `gfdata`, `gfiphc` - Core PBS assessment plotting and data packages`sdmTMB` - Spatiotemporal modeling for survey indices and CPUE standardization`csasdown` - CSAS report templating system`bookdown` - Multi-format report generation8. Best Practices
Always run `Rscript report/make.R` before attempting to render reportsCheck that all required cached data exists in `report/data-cache-*/` before figure generationUse parallel processing (`build_figures.sh`) for generating figures for multiple speciesEnsure reproducibility by documenting any changes to configuration in `01-settings.R`Follow CSAS formatting standards when modifying report templatesUsage Examples
**Generate all figures and render main English report:**
```bash
Generate figures
Rscript report/make.R
Navigate to report directory and render
cd report/tech-report-main/
Rscript -e "csasdown::render()"
```
**Generate figures for specific species using parallel processing:**
```bash
./report/build_figures.sh
```
**Fit survey abundance index models:**
```bash
Rscript report/R/04-survey-index-standardization.R
```
Constraints
Figure generation must complete before report renderingCached data must exist in expected locations before running analysis scriptsReports require proper R environment with all dependencies installedParallel processing requires GNU parallel to be installedFrench reports require French language parameter to be set correctly throughout pipeline