1. Introduction and workflow
Scope: EcoMetriQ 1.1.2 · Interface: ui/main_dialog.py · Computation: modules/alpha_beta_indices.py, modules/spatial_analysis.py, modules/validation.py · Processing: processing_algorithms.py
1.1 What is EcoMetriQ
EcoMetriQ is a plugin that computes biodiversity measures and spatial diversity analyses from species records inside QGIS, without writing code. The input is a CSV file in which each row is a species record. The following computations are made from this file:
- Alpha diversity: species richness, evenness and dominance of a single community (one site, one sample or all records together); Hill numbers; sampling completeness (sample coverage) and estimation of the number of unseen species (Chao1, ACE).
- Rarefaction and accumulation curves: the expected number of species as sample size increases.
- Beta diversity: differences in species composition between sites; Jaccard, Sørensen, Whittaker, Bray-Curtis and Baselga's partitioning into turnover and nestedness.
- Gamma diversity: the regional species pool and the additive and multiplicative partitioning of regional diversity into within-site (alpha) and between-site (beta) components.
- Spatial analyses: kernel density estimation (KDE), Getis-Ord Gi* hotspot analysis, extent of occurrence (EOO) and area of occupancy (AOO) for IUCN criterion B, alpha shape.
- Validation: built-in analytical tests and comparison with R output.
All results appear as plain text in the window and are exported as text or CSV. Spatial results are added to QGIS as layers. Five of these computations are also available as algorithms in the Processing toolbox (Chapter 10).
1.2 Who this book is for and how to read it
The book was written for ecologists, landscape architects, botanists and graduate students who will use EcoMetriQ in research. Each chapter describes one tab and follows the same order:
- What the tab does: its place in the workflow, its input and its output.
- Screen and parameters: a screenshot, with the name of each field, what it does, its default value and its code location.
- Indices and formulas: the mathematical definition of each measure, exactly how the program computes it and which source it is based on.
- Running: step by step with the sample data.
- Output and interpretation: a line-by-line explanation of the text shown in the window, how the number should be read and how it should not be read.
- Cautions and expert questions: common mistakes, edge cases and questions a reviewer might ask.
Basic rule: the source code is the reference
Every default value, formula and behavior in this book was taken from the source code of EcoMetriQ 1.1.2 and is shown in the form file.py:line. For example, modules/alpha_beta_indices.py:355 is the line where the classic form of Chao1 is computed. Where the general textbook definition differs from what the program does, the book describes what the program does and points out the difference.
The interface is in English. Button, box and field names are given in the book exactly as they appear in the interface, in English and in code format, e.g. Compute Alpha Indices.
1.3 Sample data and the numbers in this book
All screens and numbers in the book were produced by actually running EcoMetriQ 1.1.2 with the sample data shipped with the plugin. Screenshots were taken in QGIS 4.2.3.
- File:
EcoMetriQ/ecometriq_sample/antalya_basin_species.csv - Content: riparian plant records from five sub-watersheds of the Antalya Basin (Aksu, Boğaçay, Köprüçay, Kırkgöz-Düden, Manavgat). 1,818 rows, 694 distinct names, four columns:
Species,X,Y,site. - Coordinates: WGS84 latitude-longitude (EPSG:4326).
- Count column: none. Each row is a record, not an individual. This creates an important difference in interpretation throughout the book (§3.5).
- Sub-watershed boundaries:
ecometriq_sample/antalya_alt_havzalar/*.gpkg(used only as a background in maps).
A reader who loads the same file and presses the same buttons gets the same numbers. Date lines and file paths will differ according to the reader's own computer.
The sample data are raw
The sample file is a raw field record without name correction: it contains 19 fungal taxa and one tortoise (Testudo graeca) record, spelling variants (Juniperus feotidissima / foetidissima) and records of the same species entered both under the bare species name and under a subspecies name. The program counts these names as separate species, as they are. This book uses the file in its raw state to show the program's behavior. How name cleaning (taxonomic curation) changes the results is shown with numbers in §3.6. In your own work, clean the data first.
1.4 Typical workflow
| Step | Tab | What is done | Chapter |
|---|---|---|---|
| 1 | Data Input |
The CSV is loaded; the numbers of records and species are checked | 3 |
| 2 | Alpha Indices |
Alpha measures for all records (or a manually entered table) | 4 |
| 3 | Rarefaction |
Rarefaction and accumulation curves, comparison of sites | 5 |
| 4 | Beta Diversity |
Differences between sites according to the site column |
6 |
| 5 | Gamma Diversity |
Regional pool and alpha-beta-gamma partitioning | 7 |
| 6 | Spatial Analysis |
KDE, Gi*, EOO/AOO, alpha shape; QGIS layers | 8 |
| 7 | Validation |
Built-in tests; comparison with R output | 9 |
| 8 | Report |
Collecting all results in a single text | 10 |
The tabs are not locked to one another; you can go directly to any of them. However, tabs that use the CSV do not run until a CSV has been loaded in Data Input, and they display a warning (e.g. "Please load a CSV file first.").
1.5 Notation
The following symbols are used throughout the book:
| Symbol | Meaning |
|---|---|
| S | observed number of species (richness) |
| N | total number of individuals; total number of records if there is no count column |
| n_i | number of individuals (or records) of species i |
| p_i = n_i / N | relative abundance of species i |
| f_1, f_2 | number of singletons (species seen once) and doubletons (species seen twice) |
| q | order of the Hill number (0, 1, 2) |
| S_T | combined species pool of all sites (gamma richness) |
| a, b, c | species shared by two sites, species only in the first and species only in the second |
| h | KDE bandwidth (meters) |
The decimal separator in the text is a point (0.946), and a comma separates thousands (1,818); program output and code lines also use the decimal point (0.9463).
1.6 Version and citation
This book describes EcoMetriQ 1.1.2. Versions 1.1.1 and 1.1.2 are maintenance releases: 1.1.1 fixes interface defects in 1.1.0, and 1.1.2 fixes the data-reading, Processing and message defects found in a robustness test. On valid data the computed diversity and spatial values are the same in all three versions (the list of changes is in Appendix C). When you use the plugin in a study, state the version number and the settings you used (in particular bandwidth, distance band, FDR correction, AOO cell size) in the methods section. Suggested methods sentences are given in Chapter 11.
The plugin is distributed under the GNU GPL-2.0 license; source code and bug reports: github.com/omerorucu/ecometriq.