![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
In the field of ecology, the niche refers to the compatibility between a species and a specific environmental condition. It explains how an organism or a population adapts to the availability of resources and competition.
For instance, when resources are plentiful and the presence of predators, parasites, and pathogens is low, the organism or population tends to grow. In locations and times of resources scarcity and high predation, the populations tend to shrink.
The composition and significance of environmental variables that constitute the dimensions of a niche can vary among species, and the importance of specific environmental factors for a species may change depending on geographical and ecological contexts.
Given this understanding, the primary goal of Quetzal is to provide users with quetzal::expressive
, a user-friendly means to effectively combine geospatial and temporal elements. This enables users to establish meaningful mathematical connections between a diverse and heterogeneous landscape and the underlying demographic processes, based on their own perspectives and preferences. Generally speaking, users will want to use quetzal::expressive
to mathematically compose spatio-temporal expressions with a signature double (location_type, time_type)
until they reach a satisfying definition of the local demographic parameter of interest.
Mathematical composition in C++ is not trivial as unlike languages, C++ does not understand mathematical expressions and their composition. In this strongly-typed language, you can not simply multiply the integer 42
and the function \( f(x,y) = x^y \) and expect it to work. Indeed, if you try to rescale a lambda function, e.g.:
it will not compile. As the compiler does not know natively what the rules are to multiply a number with whatever type f
is, it will (verbosely) insult you saying the operator*()
is not defined for the type int
and an anonymous type (the lambda function).
You need a library to tell the compiler what to do. This is where quetzal::expressive
comes handy: it allows you to add, substract, multiply, or compose mathematical expressions by giving them a uniform interface.
In the context of demographic models, my_expression
in the example below could represent for example r(x,t)
the growth rate at location x
at time t
. Being able to compose several smaller expressions into bigger expressions gives much freedom to users who can for example define r
in one part on the program and compose it at a later time with a different expression e.g. k(x,t)
the carrying capacity at location x
at time t
. By treating these local demographic parameters as independent expressions that can be mixed and matched, quetzal::expressive
allows great freedom in the implementation details of a spatio-temporal process.
Input
Output
quetzal::geography::raster
and prepare its integration into the simulation framework with quetzal::expressive
.In the context of ecological niche modeling (ENM), suitability refers to the degree of appropriateness or favorability of a particular environmental condition for a species to thrive and persist. ENM is a technique used in ecology to predict the distribution of species across landscapes based on their known occurrences and environmental variables.
Suitability can be thought of as a spectrum, ranging from conditions that are highly suitable for a species' survival and reproduction to conditions that are unsuitable or even detrimental. ENM attempts to map this spectrum across geographical space by analyzing the relationships between species occurrences and various environmental factors, such as temperature, precipitation, elevation, soil type, and vegetation cover.
It's important to note that suitability does not solely depend on a single environmental variable. Instead, it's a complex interplay of multiple factors that determine whether a species can survive, reproduce, and establish a viable population in a given area. Suitability GIS maps derived from previous analysis steps (see e.g. the niche models in Quetzal-crumbs python package) can then be integrated into the coalescence simulation framework.
The following example code
quetzal::geography::raster
quetzal::expressive
f(x,t)
quetzal::expressive::use
Input
Output
quetzal::geography::landscape
and prepare their integration into the simulation framework with quetzal::expressive
by dynamically modulating the suitability value as a function of the local elevation.It is a common approach to pack a wealth of information into a sole raster file. For instance, this can involve using a single friction file and designating ocean cells with NA values, and obstacles for dispersal with values of 1. Another way is to try to inject elevational data into the suitability map during the Ecological Niche Modeling step.
While these approaches are feasible and occasionally advantageous, they do not consistently represent the optimal or most adaptable solution.
In a broader sense, it's advisable to consider each Geographic Information System (GIS) input file as a means of representing a distinct attribute of the landscape such as suitability, friction, or elevation, utilizing quetzal::geography::landscape
to read and align these input files then utilizing quetzal::expressive
to adjust or combine these quantities according to the user's modeling intentions.
As an illustration we will show in this example how to adjust the stochasticity of a suitability-driven process as a function of the elevation model. This case and its variations can be applicable in various contexts:
Input
Output
quetzal::geography::landscape
and prepare their integration into the simulation framework with quetzal::expressive
and account for trans-oceanic dispersal events by dynamically defining the friction and the carrying capacity of a cell as functions of the suitability and elevation value.Drafting events, in the context of biological dispersal, refer to a phenomenon where organisms are carried across large distances by clinging to or being transported by other organisms, objects, or air currents. This can be thought of as a form of passive dispersal where an organism takes advantage of external forces to move beyond its usual range.
The term "drafting" is borrowed from concepts in physics. In biology, this concept is applied to scenarios where organisms, often small and lightweight, catch a ride on other organisms (like birds, insects, or larger animals), objects (like debris), or wind currents. Drafting events can play a significant role in the dispersal of organisms, especially those with limited mobility.
These drafting events provide an opportunity for organisms to reach new areas that they might not be able to access through their own locomotion. It's an interesting ecological phenomenon that highlights the intricate ways in which different species interact and influence each other's distribution and survival.
The general idea is to define lambda expressions that embed stochastic aspects of the model, while preserving the callable interface (space, time) -> double
.
Input
Output