Skip to content

Repository files navigation

R-CMD-check

metabarMap

Interactive Shiny application for visualizing metabarcoding results on a map.

Description

This application displays metabarcoding detection data for multiple sampling stations. Users can:

  • View sampling stations on an interactive map colored by species richness
  • Click stations to see detected species with images, common names, and links to external databases
  • Browse ambiguous species groups that could not be distinguished
  • Download all data as CSV files

Data Structure

The application requires project-specific data files in inst/extdata/:

Required CSV Files

  1. localisations.csv - Station coordinates
    • Columns: station, lat, long
    • Example: ST1,51.6908819,-75.8168186
  2. species_table.csv - Detection data (wide format)
    • Columns: TaxonName, Group, Genus, Species, ST1, ST2, …, STn
    • Each station column contains read counts (numeric)
    • Species with Group="zMultiple" are treated as ambiguous detections
    • Ambiguous species may have colon-separated names: "species1 : species2"
    • Ambiguous species may have underscore format: "Group_Genus_Species"
  3. species_info.csv - Species metadata
    • Columns: species, English, French, gbif_url, col_url, itis_url, Native_Quebec, Exotic_Quebec, status_ca, status_qc, img
    • species: Scientific name (Genus species)
    • English/French: Common names
    • *_url: Links to external databases (GBIF, Catalogue of Life, ITIS)
    • Native_Quebec/Exotic_Quebec: Boolean flags for species status in Quebec
    • status_ca: Conservation status under Canada’s Species at Risk Act (SARA/LEP) - values include “En voie de disparition” (Endangered), “Menacée” (Threatened), “Préoccupante” (Special Concern), “Disparue du pays” (Extirpated)
    • status_qc: Conservation status under Quebec’s Loi sur les espèces menacées ou vulnérables (LEMV) - values include “Menacée” (Threatened), “Vulnérable” (Vulnerable), “Susceptible” (Likely to be designated)
    • img: Path to species image (e.g., inst/extdata/img/Species_name.jpg)

Images

Species images should be placed in inst/extdata/img/ with filenames matching the paths in species_info.csv.

Conservation Status Data Sources

These files should be downloaded from their respective sources and placed in inst/extdata/:

  1. CA_especes_en_peril.csv - Canadian species at risk
  2. QC_especes_en_peril.csv - Quebec species at risk

Note: These files are not tracked in version control due to their size. They must be downloaded manually before running scripts/enrich_species.R.

Running Locally

# Install dependencies
remotes::install_local()

# Run the app
metabarMap::run_app()

Docker Deployment

Build locally for ShinyProxy and upload on the remote registry

  1. Open SSH tunnel to remote server:
ssh -i ~/.ssh/id_compute_cloud -L 5001:localhost:5000 sviss@ip.to.compute.cloud.canada
  1. Build and tag the image (replace project-tag with your project identifier):
docker build -t localhost:5001/metabarmap:project-tag .
  1. Push to ShinyProxy registry:
docker push localhost:5001/metabarmap:project-tag

On the remote server

Pull the image localy from the registry

docker pull localhost:500/metabarmap:v1.0.0-nemaska

Configuration

Application settings are configured in inst/golem-config.yml:

default:
  station_ids: ["ST1","ST2","ST3",...]
  project_name: "Your Project Name"
  project_logo: "https://your-logo-url.png"
  methodology_file: "methodology.md"
  partners:
    - name: "Partner Name"
      max_height: "80px"
      url: "https://partner-website.org"
      image: "img/partners/logo.png"

Configuration Fields

  • station_ids: Array of station identifiers matching column names in species_table.csv. These stations will be displayed on the map and available for selection.

  • project_name: Application title displayed in the navigation bar and browser tab.

  • project_logo: URL to project logo image. Can be an external URL (https://) or path to local file in inst/extdata/.

  • methodology_file: Filename of markdown document in inst/extdata/ containing methodology description. Displayed in the “Methodology” tab panel.

  • partners: List of partner organizations to display in the application footer. Each partner requires:

    • name: Organization name (used for alt text)
    • max_height: Maximum logo height in CSS units (e.g., “80px”)
    • url: Partner website URL (opens in new tab when logo is clicked)
    • image: Path to logo file relative to inst/extdata/ directory

About

Shiny application to explore metabarcoding data at sampling sites

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages