NicheToolBox second stage functions

In this tutorial I am going to show how to use the second stage functions of nichetoolbox. The work was done for GSOC 2016. Its worth to mention that it also contains some of the work planned for the last stage of the project (workflow reports) because I realized that it was more convenient to develop the functions since this early stage.

Summary

The second stage functions are related to curate spatial occurence data using leaflet maps, generate a workflow report and also to extract the environmental values of the occurrences data to explore and study species niches in the Niche space.

Geographic explorations using Dynamic Maps

We have seen how to curate data using threshold distances and grouping varibales on NicheToolBoox. Now lets see how to use leaflet maps: 1) to display longitude and latitude data, 2) to curate data and 3) to define our study area (M data in allusion to the M concept, which in the niche modeling world is the accesible area where the species can move), 4) Curate data using the M polygon. The above can be done in either the GBIF dataset or the User dataset.

Display longitude and latitude data

Go to Data -> Dynamic Map and on the right panel Select a dataset that you want to work with, in our case lets work with GBIF data.

Data curation using dynamic map

On the right side panel there is an option where you can specify the data point id to clean it from the dataset. Clic on pop-up to see the point id, select it in the select input form from the right panel and press Clean data points button to clean.

Define a map of M

You can use NicheToolBoox to define your study area. Go to Data -> Dynamic Map and in the right side panel turn-on the button Define and work with polygon of M, when activated you can either draw a polygon using the drawing tools (topright part of the map) from NicheToolBoox or select a local shapefile. If you prefer to define the M polygon using NicheToolBoox press the polygon tool and draw it:

Once defined, the polygon can be saved. In the right panel there is a form where you can give a name for your polygon.

Data curation using the M polygon

We can filter the data points that lie inside our polygon. In the right panel just press the button Points in polygon

Saving our workflow

Once specified the workflow directory (AppSettings “go to the first section of the tutorial”“) which is the directory where all the information generated in the app is stored, we just need to press the Save state button in order to save everything!! (in this stage only the geographic data related work).

The workflow report

One of the files generated when you preess Save state is the data_report.html which is an html file with a summary of the geographic data related things that you have done inside NicheToolBoox.

Niche space (steps to make the cluster analysis)

To work on Niche space we need to have loaded our niche raster layers (AppSettings “go to the first section of the tutorial”“) and have a longitude and latitude dataset (GBIF data or User data).

1. Extracting niche values from raster layers

Go to Niche space -> Niche data extraction and select a longitude and latitude dataset. In our case we selected the GBIF dataset, If the dataset its not empty and we have loaded the raster layers the app will not show any message:

On the other hand if we have not loaded either the raster layers or the longitude and latitude data a messages telling us what to do will be displayed.

If the dataset and the layers are in the App memory we can proceed to the next step. In this part we jut need to press the Run button and then a data table with the niche values of our longitude and latitude data will be displayed.

2. Niche explorations

We can explore our niche data using some exciting 3-Dimensional plots. Go to Niche space -> Known niche and play with \(x\), \(y\) and \(z\) variables of the ellipsoid plot.

3. Niche clustering

When studing species niches and distributions, one of the great questions that comes to my mind is whether or not the species are adapting to different niche conditions. One way to explore this question is using clustering algorithms (a statistical tool which aims to see if a multivariate data have a cluster structure in such a way that the data belonging to the same cluster are very similar between them and different with respect to other groups). If the clusters are very different we can think that populations of the same species are responding in different ways to the same set of niche variables (they are adapting to local conditions). This is just a exploratory tool.

Go to Niche clustering -> K-means section and select at least 3 niche variables to make the cluster analysis. In our case as I have selected the bios of the WorldClim database as my niche layers, there are 19 niche variables, but if I want to work with few variables I can erase some of the form (Select at least 3 niche variables section).

Now we have to suggest a number of clusters, the default value is 3 (in some point the app will have algorithms to help you to make the suggestion). Press the Go!!! button and you will see a 3 dimensional plot with some ellipsoids representing the number of clusters that you suggested. Bellow this plot you will see a leaflet map with the geographic projection of the points that fall inside each ellipsoid (colors ids help you to identify to which cluster each data point belongs).

Lets play with the number of cluster (now 4) and see how the results change…

4. Niche correlations

One popular method to select the niche varibles for modeling species niches and distributions is to study correlations between niche variables and filter those varibles that are more correlated. In nichetoolbox you can filter the variables that summarize the environmental information of your presences data according to a correlation threshold; this algorithm suggest which variables to use for the modeling part.

Also you can explore the correlation table and download it in .csv format

An other thing that the user can do is to plot a correleogram…