# sdarionicolas-boop/enm-bgen architecture

> Architecture diagram of the GitHub repository sdarionicolas-boop/enm-bgen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sdarionicolas-boop/enm-bgen
- Repository: https://github.com/sdarionicolas-boop/enm-bgen

## Overview

The README describes ENM-BGEN, an ecological niche-modeling pipeline that turns species-presence records and environmental layers into habitat-suitability rasters, conservation overlays, metrics, and interactive maps. Its documented workflow covers record cleaning and spatial thinning, environmental preparation and VIF selection, per-species modeling and ensemble projection, classification, and a MapBiomas land-cover cross. The supplied tree does not include the documented R pipeline or its data and results; those nodes therefore have no source path. The visible JavaScript files are bundled map libraries, not evidence of the pipeline’s internal wiring.

Main entry points: [`outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-binding-2.2.3/leaflet.js`](https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-binding-2.2.3/leaflet.js) (Leaflet widget binding), [`outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-1.3.1/leaflet.js`](https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-1.3.1/leaflet.js) (Leaflet map engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Input data"]
  node_presence_sources["GBIF and iNaturalist"]
  node_presence_csv["Presence CSV"]
  node_climate["WorldClim layers"]
  node_terrain["SRTM layers"]
  node_land_cover["MapBiomas Argentina"]
end

subgraph group_preparation["Data preparation"]
  node_clean_thin["Clean and thin"]
  node_environment_prep["Environmental stack"]
  node_vif["VIF selection"]
end

subgraph group_modeling["Modeling"]
  node_pseudo_absence["Pseudo-absences"]
  node_fit["Cross-validated models"]
  node_ensemble["Ensemble projection"]
end

subgraph group_outputs["Conservation outputs"]
  node_suitability["Suitability rasters"]
  node_classification["Suitability classes"]
  node_metrics["Model metrics"]
  node_mapbiomas["MapBiomas cross"]
  node_conservation["Habitat-use totals"]
  node_interactive_map["Interactive map"]
  node_leaflet_binding["Leaflet widget binding<br/>[leaflet.js]"]
  node_leaflet_core["Leaflet map engine<br/>[leaflet.js]"]
end

node_analyst(("Analyst"))

node_analyst -->|"provides"| node_presence_csv
node_presence_sources -.->|"records inform"| node_presence_csv
node_presence_csv -->|"clean and thin"| node_clean_thin
node_climate -->|"prepare layers"| node_environment_prep
node_terrain -->|"prepare layers"| node_environment_prep
node_environment_prep -->|"select variables"| node_vif
node_clean_thin -->|"supply occurrences"| node_pseudo_absence
node_vif -->|"supply predictors"| node_fit
node_pseudo_absence -->|"supply absences"| node_fit
node_fit -->|"ensemble models"| node_ensemble
node_ensemble -->|"write predictions"| node_suitability
node_suitability -->|"classify suitability"| node_classification
node_ensemble -->|"report performance"| node_metrics
node_suitability -->|"cross habitat"| node_mapbiomas
node_land_cover -->|"cross land use"| node_mapbiomas
node_mapbiomas -->|"summarize areas"| node_conservation
node_suitability -->|"visualize suitability"| node_interactive_map
node_interactive_map -.->|"render layers"| node_leaflet_binding
node_leaflet_binding -->|"use map engine"| node_leaflet_core
node_analyst -->|"inspect results"| node_interactive_map

click node_leaflet_binding "https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-binding-2.2.3/leaflet.js"
click node_leaflet_core "https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-1.3.1/leaflet.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_presence_sources,node_presence_csv,node_climate,node_terrain,node_land_cover toneBlue
class node_clean_thin,node_environment_prep,node_vif toneAmber
class node_pseudo_absence,node_fit,node_ensemble toneMint
class node_suitability,node_classification,node_metrics,node_mapbiomas,node_conservation,node_interactive_map,node_leaflet_binding,node_leaflet_core toneRose
class node_analyst toneIndigo
```

## Components

### Input data

- **GBIF and iNaturalist**
- **Presence CSV**
- **WorldClim layers**
- **SRTM layers**
- **MapBiomas Argentina**

### Data preparation

- **Clean and thin**
- **Environmental stack**
- **VIF selection**

### Modeling

- **Pseudo-absences**
- **Cross-validated models**
- **Ensemble projection**

### Conservation outputs

- **Suitability rasters**
- **Suitability classes**
- **Model metrics**
- **MapBiomas cross**
- **Habitat-use totals**
- **Interactive map**
- [Leaflet widget binding](https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-binding-2.2.3/leaflet.js): `outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-binding-2.2.3/leaflet.js`
- [Leaflet map engine](https://github.com/sdarionicolas-boop/enm-bgen/blob/main/outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-1.3.1/leaflet.js): `outputs/ranking_partidos/mapa_prioridades_partidos_files/leaflet-1.3.1/leaflet.js`

### Other components

- **Analyst**

## Connections

- Analyst → Presence CSV: provides
- GBIF and iNaturalist → Presence CSV: records inform
- Presence CSV → Clean and thin: clean and thin
- WorldClim layers → Environmental stack: prepare layers
- SRTM layers → Environmental stack: prepare layers
- Environmental stack → VIF selection: select variables
- Clean and thin → Pseudo-absences: supply occurrences
- VIF selection → Cross-validated models: supply predictors
- Pseudo-absences → Cross-validated models: supply absences
- Cross-validated models → Ensemble projection: ensemble models
- Ensemble projection → Suitability rasters: write predictions
- Suitability rasters → Suitability classes: classify suitability
- Ensemble projection → Model metrics: report performance
- Suitability rasters → MapBiomas cross: cross habitat
- MapBiomas Argentina → MapBiomas cross: cross land use
- MapBiomas cross → Habitat-use totals: summarize areas
- Suitability rasters → Interactive map: visualize suitability
- Interactive map → Leaflet widget binding: render layers
- Leaflet widget binding → Leaflet map engine: use map engine
- Analyst → Interactive map: inspect results
