Skip to content

Commit

Permalink
Removed error handling, added climate pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrabenmeister committed Dec 18, 2024
1 parent 259e29a commit c045fcd
Show file tree
Hide file tree
Showing 5 changed files with 312 additions and 44 deletions.
291 changes: 291 additions & 0 deletions pipelines/GenesFromSpace/Tool/Climate_niche_v_GBIF_bbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
{
"nodes": [
{
"id": "177",
"type": "io",
"position": {
"x": 876.0952269491904,
"y": 688.2305943548577
},
"data": {
"descriptionFile": "GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json"
}
},
{
"id": "178",
"type": "io",
"position": {
"x": -572.2975373051523,
"y": 864.1949246529587
},
"data": {
"descriptionFile": "GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json"
}
},
{
"id": "179",
"type": "output",
"position": {
"x": 1927.4448283548331,
"y": 609.8767657940492
},
"data": {
"label": "Output"
}
},
{
"id": "180",
"type": "output",
"position": {
"x": 1927.4448283548331,
"y": 626.8232073271129
},
"data": {
"label": "Output"
}
},
{
"id": "181",
"type": "output",
"position": {
"x": 1928.6552884643377,
"y": 640.1382685316629
},
"data": {
"label": "Output"
}
},
{
"id": "182",
"type": "output",
"position": {
"x": 1926.2343682453286,
"y": 651.0324095172037
},
"data": {
"label": "Output"
}
},
{
"id": "183",
"type": "io",
"position": {
"x": 90.95681502291825,
"y": 657.5373539350423
},
"data": {
"descriptionFile": "GFS_IndicatorsTool>getClimateNicheLand.yml"
}
}
],
"edges": [
{
"source": "178",
"sourceHandle": "GFS_IndicatorsTool>get_pop_poly.yml@5|population_polygons",
"target": "177",
"targetHandle": "pipeline@161",
"id": "reactflow__edge-178GFS_IndicatorsTool>get_pop_poly.yml@5|population_polygons-177pipeline@161"
},
{
"source": "177",
"sourceHandle": "GFS_IndicatorsTool>get_Indicators.yml@162|pm",
"target": "179",
"targetHandle": null,
"id": "reactflow__edge-177GFS_IndicatorsTool>get_Indicators.yml@162|pm-179"
},
{
"source": "177",
"sourceHandle": "GFS_IndicatorsTool>get_Indicators.yml@162|ne500",
"target": "180",
"targetHandle": null,
"id": "reactflow__edge-177GFS_IndicatorsTool>get_Indicators.yml@162|ne500-180"
},
{
"source": "177",
"sourceHandle": "GFS_IndicatorsTool>get_Indicators.yml@162|ne_table",
"target": "181",
"targetHandle": null,
"id": "reactflow__edge-177GFS_IndicatorsTool>get_Indicators.yml@162|ne_table-181"
},
{
"source": "177",
"sourceHandle": "GFS_IndicatorsTool>get_Indicators.yml@162|interactive_plot",
"target": "182",
"targetHandle": null,
"id": "reactflow__edge-177GFS_IndicatorsTool>get_Indicators.yml@162|interactive_plot-182"
},
{
"source": "178",
"sourceHandle": "GFS_IndicatorsTool>get_pop_poly.yml@5|population_polygons",
"target": "183",
"targetHandle": "pop_poly",
"id": "reactflow__edge-178GFS_IndicatorsTool>get_pop_poly.yml@5|population_polygons-183pop_poly"
},
{
"source": "183",
"sourceHandle": "yearly_cover",
"target": "177",
"targetHandle": "GFS_IndicatorsTool>get_Indicators.yml@162|cover_maps",
"id": "reactflow__edge-183yearly_cover-177GFS_IndicatorsTool>get_Indicators.yml@162|cover_maps"
},
{
"source": "183",
"sourceHandle": "climate_map",
"target": "177",
"targetHandle": "pipeline@160",
"id": "reactflow__edge-183climate_map-177pipeline@160"
}
],
"inputs": {
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|ne_nc": {
"description": "Estimated Ne:Nc ratio for the studied species. Multiple values can be provided, separated by a comma.",
"label": "Ne:Nc ratio estimate",
"weight": 0,
"type": "float[]",
"example": [
0.1,
0.2
]
},
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|runtitle": {
"description": "Set a name for the pipeline run.",
"label": "Title of the run",
"weight": 1,
"type": "text",
"example": "Quercus sartorii, Mexico, Habitat decline by tree cover loss, 2000-2023"
},
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|pop_density": {
"description": "Estimated density of the population [number of individuals per km2]. Multiple values can be provided, separated by a comma.",
"label": "Population density",
"weight": 2,
"type": "float[]",
"example": [
50,
100,
1000
]
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|pipeline@12": {
"description": "Scientific name of the species, used to look for occurrences in GBIF. ",
"label": "Species names",
"weight": 3,
"type": "text",
"example": "Quercus sartorii"
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|pipeline@21": {
"description": "Vector of float, bbox coordinates of the bbox in the order xmin, ymin, xmax, ymax",
"label": "Bounding box ",
"weight": 4,
"type": "float[]",
"example": [
"-99",
"22",
"-92",
"29"
]
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|GFS_IndicatorsTool>get_pop_poly.yml@5|buffer_size": {
"description": "Radius size [in km] to determine population presence around the coordinates of species observations.",
"label": "Size of buffer",
"weight": 5,
"type": "float",
"example": 10
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|GFS_IndicatorsTool>get_pop_poly.yml@5|pop_distance": {
"description": "Distance [in km] to separate species observations in different populations.",
"label": "Distance between populations",
"weight": 6,
"type": "float",
"example": 50
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|pipeline@15": {
"description": "Integer, 4 digit year, end date to retrieve occurrences",
"label": "End year",
"weight": 7,
"type": "int",
"example": 2000
},
"GenesFromSpace>ToolComponents>GetPopulationPolygons>GFS_Population_polygons_from_GBIF_occurences_bbox.json@178|pipeline@14": {
"description": "Integer, 4 digit year, start date to retrieve occurrences",
"label": "Start year",
"weight": 8,
"type": "int",
"example": 1980
},
"GFS_IndicatorsTool>getClimateNicheLand.yml@183|start_year": {
"description": "Starting year of species observation extracted from the input JSON file.",
"label": "Starting year of species observation",
"type": "int",
"example": 1990,
"weight": 9
},
"GFS_IndicatorsTool>getClimateNicheLand.yml@183|end_year": {
"description": "Ending year of species observation extracted from the input JSON file.",
"label": "Ending year of species observation",
"type": "int",
"example": 2000,
"weight": 10
},
"GFS_IndicatorsTool>getClimateNicheLand.yml@183|yoi": {
"description": "Years of interest extracted from the input JSON file.",
"label": "Years of interest",
"type": "int[]",
"example": [
2000,
2005,
2010,
2015,
2020
],
"weight": 11
}
},
"outputs": {
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|pm": {
"description": "Estimated proportion of mantained populations, comparing earliest and latest time point. A value of 1 means that no populations went extinct over the time frame.",
"label": "Population maintained indicator",
"weight": 0,
"type": "float"
},
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|ne500": {
"description": "Estimated proportion of populations with Ne>500 at latest time point.",
"label": "Ne>500 indicator",
"weight": 1,
"type": "float"
},
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|ne_table": {
"description": "Estimated effective size of every population, based on the latest time point of the habitat cover map.",
"label": "Effective population size",
"weight": 2,
"type": "text/tab-separated-values"
},
"GenesFromSpace>ToolComponents>GetIndicators>GFS_Indicators.json@177|GFS_IndicatorsTool>get_Indicators.yml@162|interactive_plot": {
"description": "An interactive interface to explore indicators trends across geographical space and time.",
"label": "Interactive plot",
"weight": 3,
"type": "text/html"
}
},
"metadata": {
"name": "Climate niche by populations from GBIF occurrences (bbox)",
"description": "Genes from Space tool. The tool retrieves species occurrence from GBIF, then used to define polygons of population distribution based on geographic proximity. The tool then draws a habitat suitability map over time, based on the presence of land cover classes of interest. Finally, the tool estimates the size of suitable habitat over time for every population, and computes indicators of genetic diversity monitoring accordingly (Ne500 and Populations Maintained indicators). Population maps and genetic diversity indicators are displayed through an interactive interface. ",
"author": [
{
"name": "Oliver Selmoni",
"email": "[email protected]"
}
],
"license": "MIT",
"external_link": "https://teams.issibern.ch/genesfromspace/",
"references": [
{
"text": "Schuman et al., EcoEvoRxiv.",
"doi": "https://doi.org/10.32942/X2RS58"
},
{
"text": "ESA. Land Cover CCI Product User Guide Version 2. Tech. Rep. (2017)",
"doi": "https://maps.elie.ucl.ac.be/CCI/viewer/download/ESACCI-LC-Ph2-PUGv2_2.0.pdf"
}
]
}
}
3 changes: 2 additions & 1 deletion runners/r-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ dependencies:
- r-tidyselect ssh -i ~/.ssh/id_rsa [email protected]
- r-tidyverse
- r-stringr
- r-ecmwfr
- r-ecmwfr
- r-dismo
10 changes: 3 additions & 7 deletions scripts/GFS_IndicatorsTool/getClimateNicheLand.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#### Load packages

packages <- c("dismo", "ecmwfr", "elevatr", "terra", "raster", "foreach", "doParallel", "sf")
packages <- c("ecmwfr")
new.packages <- packages[!(packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)

library(dismo) # for maxent
library(ecmwfr) # to get climate data
library(elevatr) # to get altitude data
library(terra)
library(raster)
library(foreach)
library(doParallel)
library(sf)


Expand Down Expand Up @@ -54,8 +51,7 @@ maxY = max(yoi)
############
############ Get climate data
############
print(packageVersion('ecmwfr') )
options(keyring_backend = "file")
options(keyring_backend = "env")
wf_set_key(user = APIuserID, key = APIkey)

### set name of temporary variables
Expand Down
21 changes: 12 additions & 9 deletions scripts/GFS_IndicatorsTool/getClimateNicheLand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,33 @@ inputs:
pop_poly:
label: Population polygons
description: Population polygons extracted from the input JSON file.
type: text
example: 'Extracted from input JSON'
type: application/geo+json
example: /userdata/population_polygons_switzerland.geojson

start_year:
label: Starting year of species observation
description: Starting year of species observation extracted from the input JSON file.
type: int
example: 'Extracted from input JSON'
example: 1990

end_year:
label: Ending year of species observation
description: Ending year of species observation extracted from the input JSON file.
type: int
example: 'Extracted from input JSON'
example: 2000

yoi:
label: Years of interest
description: Years of interest extracted from the input JSON file.
type: int[]
example: 'Extracted from input JSON'
example: [2000, 2005, 2010, 2015, 2020]

outputs:
climate_map:
label: Climate map
description: Climate map of the species habitat
type: text/tab-separated-values

label: pop_map
description: Population map of the species habitat
type: text
yearly_cover:
label: Yearly cover
description: Yearly cover of the species habitat
type: text
Loading

0 comments on commit c045fcd

Please sign in to comment.