Terraflux Terraflux
Download

Biodiversity analysis

14 operators. Inputs marked required must be connected or given; the others have defaults.

bio.cluster#

Biodiverse's cluster analysis (landschaft's cluster): groups joined pair by pair by the dissimilarity of their labels (SORENSON, JACCARD, S2, BRAY_CURTIS, PHYLO_SORENSON...; the linkage giving cluster to cluster values), within the first spatial condition first. Ties broken by Biodiverse's Mersenne Twister. The dendrogram, its nodes (Biodiverse's values), the calculations of each node's groups and, with k, k clusters.

InputTypeWhat it is
basedatarequiredbase_datagroups x labels sample counts
treetreea phylogeny for phylogenetic indices (bio.tree)
matrixlabel_matrixa label matrix (bio.matrix)
OutputTypeWhat it is
treetreethe dendrogram: groups at the tips, joins named 0___...
nodestablea row per node (name order): its parent, length, Biodiverse's values, its group
tabletablewith calculations: those of each node's groups
clusterstablewith k: each group's cluster
mapmapwith k: the clusters (groups that are cells of two axes)
SettingTypeWhat it is
indextextthe dissimilarity (SORENSON, default)
linkagetextlink_average (default)...
conditionsanyspatial conditions limiting the pairs (sp_select_all())
definition_querytextonly the groups passing it
calculationsanyindices of each node's groups
seedintegerBiodiverse's prng_seed, of the ties (default 1)
tie_breakerany["random", "maximise"] (default: random shuffles)
clear_singletonsboolleave out groups that joined nothing
kintegercut the dendrogram into k clusters

bio.h3#

A basedata of lon/lat records in H3 cells (landschaft's BaseData.from_h3): the groups the centres of the cells of a resolution holding the records, the cells' ids kept.

InputTypeWhat it is
recordsrequiredanypoints, or a table with lon/lat columns
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
labelrequiredanythe label column(s)
resolutionrequiredintegerH3's resolution, 0 to 15
counttexta count column (default 1 per record)
lontextthe longitude column (default the points, or lon...)
lattextthe latitude column

bio.hex#

A basedata of records in a grid of hexagons (landschaft's BaseData.from_hex): the groups the centres of the hexagons (pointy or flat, of a circumradius) holding the records, so that Biodiverse's distance conditions work on them.

InputTypeWhat it is
recordsrequiredanypoints, or a table with coordinate columns
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
labelrequiredanythe label column(s)
sizerequirednumberfrom a hexagon's centre to its vertices (projected units)
orientationtextpointy (default) or flat
originany[x, y], a hexagon's centre (default 0)
counttexta count column (default 1 per record)
xtextthe x column (default the points, or x, lon...)
ytextthe y column

bio.matrix#

A label matrix from a Biodiverse matrix file (landschaft's read_matrix): full or a triangle (the element of each row from its columns, the values in the rows' order), or sparse pairs; the first value read for a pair wins. For the matrix calculations (matrix_stats, compare_dissim_matrix_values, mx_rao_qe).

OutputTypeWhat it is
matrixlabel_matrixvalues between labels
SettingTypeWhat it is
pathrequiredtextthe matrix file
element_columnsanythe element's columns ([1, 2], default)
values_start_colintegerthe first value column (after the elements)
sparseboolone pair per line
row_columnsanysparse: the row element's columns
col_columnsanysparse: the column element's columns
value_columnanysparse: the value's column
self_similaritynumberthe value of a missing (a, a)
separatortextguess (default), tab, space or a character
quotetextguess (default) or a character

bio.occurrences#

A basedata of occurrence records (landschaft's BaseData.from_occurrences and read_occurrences): a GBIF download (the zip or its table), a Darwin Core Archive (a zip or a folder with meta.xml), a delimited file, or records with Darwin Core columns (sdm.download_gbif's); those without a label or valid coordinates, absent, too uncertain, of other bases of record or with some GBIF issues left out, one per label and place; in cells (degrees, or of to_crs), read a line at a time.

InputTypeWhat it is
occurrencesanyrecords with Darwin Core columns, in place of a file
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
pathtextthe GBIF download, Darwin Core Archive or table
cell_sizesrequiredany[x, y]: degrees, or the units of to_crs
cell_originsany[x, y] (default 0)
to_crstextreproject the records first (EPSG:...)
labelanythe column(s) naming the taxon (default species)
counttextthe column of individuals (individualCount; default 1)
max_uncertaintynumberdrop records less precise (metres)
basis_of_recordanykeep only these bases (HUMAN_OBSERVATION...)
exclude_issuesanydrop records with any of these GBIF issues
present_onlybooldrop the ABSENT records (default true)
drop_duplicatesboolone per label and place (default true)

bio.points#

A basedata of point records read like Biodiverse's feature import (landschaft's BaseData.from_points): each point in the cell holding it, its label the label attributes joined with ':', its count 1 or a count attribute's.

InputTypeWhat it is
pointsrequiredvectorthe records
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
labelrequiredanythe label attribute(s)
counttexta count attribute (default 1 per point)
cell_sizesrequiredany[x, y] in the points' units (0 keeps the coordinates)
cell_originsany[x, y] (default 0)

bio.properties#

Label or group properties of a basedata from a Biodiverse properties file (landschaft's read_properties and set_label_properties / set_group_properties): the element from its columns joined with ':', property names upper-cased, only values that look like numbers (empty fields set but undefined), a later row overriding. They feed the lbprop and gpprop calculations; RANGE and ABUNDANCE set the labels' ranges and abundances.

InputTypeWhat it is
basedatarequiredbase_datagroups x labels sample counts
OutputTypeWhat it is
basedatabase_datawith the properties
SettingTypeWhat it is
pathrequiredtextthe properties file
oftextlabels (default) or groups
element_columnsrequiredanythe element's columns (names or 0-based positions)
property_columnsrequiredanythe property columns (each named by its header)
separatortextguess (default), tab, space or a character
quotetextguess (default) or a character

bio.randomise#

Randomisations of a spatial analysis (landschaft's randomise, Biodiverse's): each iteration randomises the basedata (rand_structured, Biodiverse's default; its spatial forms rand_spatially_structured, rand_diffusion, rand_random_walk; the swaps rand_independent_swaps, rand_independent_swaps_modified, rand_curveball; rand_csr_by_group; rand_nochange), runs the analysis again with the same neighbourhoods and counts how often each observed index exceeds, ties and is compared with the randomised one. The p-ranks, z-scores, the counters (C, P, Q, SUMX, SUMXX, T) and, with pe and phylo_rpe2, CANAPE (0 not significant, 1 neo, 2 palaeo, 3 mixed, 4 super). Biodiverse's Mersenne Twister: the same seed gives its randomisations.

InputTypeWhat it is
basedatarequiredbase_datagroups x labels sample counts
treetreea phylogeny for the phylogenetic indices (bio.tree)
matrixlabel_matrixa label matrix for the matrix indices (bio.matrix)
OutputTypeWhat it is
tabletablethe observed indices
p_ranktablethe p-rank of each index
z_scorestablethe z-score of each index
comparisontablethe counters: C_, P_, Q_, SUMX_, SUMXX_, T_ of each index
canapetableCANAPE (with pe and phylo_rpe2)
mapsstackthe p-ranks, and CANAPE (groups that are cells of two axes)
SettingTypeWhat it is
conditionsrequiredanyone or two spatial conditions (bio.spatial)
calculationsrequiredany["richness", "pe", "phylo_rpe2", ...]
definition_querytextof the analysis: only the groups passing it
seedintegerof the analysis (Biodiverse's prng_seed; default 0)
functiontextrand_structured (default)...
iterationsinteger99 (default)
rand_seedintegerof the randomisations (default 0)
richness_multipliernumberrand_structured: richness targets x (1)
richness_additionnumberrand_structured: richness targets + (0)
spatial_conditions_for_label_allocationtextrand_structured: occurrences around seed groups (sp_select_all() for its spatial forms)
spatial_allocation_ordertextdiffusion, random_walk, random, proximity
label_allocation_backtrackingtextfrom_end, from_start, random
spatial_allocation_reseed_probnumber0 to 1
spatial_conditions_for_seed_locationtextthe seed groups
swap_countintegerswaps (default twice the non-zero cells)
max_swap_attemptsinteger(default 100 times the swaps)
stop_on_all_swappedboolswaps: stop when every cell was swapped
use_max_swapboolcurveball
spatial_conditions_for_subsettextrandomise within subsets of groups
subset_definition_querytextgroups randomised (others kept)
labels_not_to_randomiseanylabels kept in place
randomise_group_props_bytextno_change (default), by_set, by_item
randomise_trees_bytextshuffle_terminal_names

bio.raster#

A basedata of rasters read like Biodiverse's raster import (landschaft's BaseData.from_raster): each layer a label (its name) and the values its counts in the cells' groups (with a threshold, presence from species distribution models), or the values themselves labels, each cell counting 1; the cells snapped to the group cells (default the raster's).

InputTypeWhat it is
rasterrequiredanya stack (a label per layer) or a map
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
labels_as_bandsboola label per layer (default true), else values
thresholdnumbervalues >= it count 1, others 0
cell_sizesany[x, y] of the group cells (default the raster's)
cell_originsany[x, y] (default 0)
given_labeltextone label for every layer
labeltextthe label of a map (default its node's output name)

bio.region_grower#

Biodiverse's region grower (landschaft's region_grower): pairs of groups joined in decreasing order of an index of the pair's groups together (RICHNESS_ALL, PE_WE...), recomputed for each merged region; with one condition selecting every group, joining stops once a region reaches the value of all the groups. The dendrogram, its nodes, the calculations of each node and, with k, k regions.

InputTypeWhat it is
basedatarequiredbase_datagroups x labels sample counts
treetreea phylogeny for phylogenetic indices (bio.tree)
matrixlabel_matrixa label matrix (bio.matrix)
OutputTypeWhat it is
treetreethe dendrogram: groups at the tips, joins named 0___...
nodestablea row per node (name order): its parent, length, Biodiverse's values, its group
tabletablewith calculations: those of each node's groups
clusterstablewith k: each group's cluster
mapmapwith k: the clusters (groups that are cells of two axes)
SettingTypeWhat it is
indextextthe index to maximise (RICHNESS_ALL, default)
conditionsanyspatial conditions limiting the pairs (sp_select_all())
definition_querytextonly the groups passing it
calculationsanyindices of each node's groups
seedintegerBiodiverse's prng_seed, of the ties (default 1)
tie_breakerany["random", "maximise"] (default: random shuffles)
clear_singletonsboolleave out groups that joined nothing
kintegercut the dendrogram into k clusters

bio.spatial#

Biodiverse's spatial analysis (landschaft's spatial_analysis): its indices over the neighbourhood of every group. Neighbourhoods are spatial conditions in Biodiverse's Perl (sp_circle (radius => 200000), sp_block (size => 500000), $D <= 3 && $nbr_y > $y, sp_select_all()...): one, or two (the second leaves out the first) for the indices comparing two sets. Calculations by Biodiverse's names, with or without calc_ (richness, endemism_whole, sorenson, rarity_central, abc_counts...). A table of the indices of each group, and their maps when the groups are cells of two axes.

InputTypeWhat it is
basedatarequiredbase_datagroups x labels sample counts
treetreea phylogeny for the phylogenetic indices (bio.tree)
matrixlabel_matrixa label matrix for the matrix indices (bio.matrix)
OutputTypeWhat it is
tabletablea row per processed group: its coordinates, then each index
mapsstackan index per layer (groups that are cells of two axes)
listsanythe list indices: per list and group, its keys and values (JSON)
SettingTypeWhat it is
conditionsrequiredanyone or two spatial conditions
calculationsrequiredany["richness", "endemism_whole", ...]
definition_querytextonly the groups passing it are processed
seedintegerBiodiverse's prng_seed: the random tips of the expected NTI (trees not ultrametric) and the net VPD (default 0)

bio.table#

A basedata of a delimited text file read like Biodiverse's import (landschaft's BaseData.from_table): group coordinates from the group columns snapped to cells (> 0), kept as given (0) or as text (< 0), labels from the label columns joined with ':', counts summed per group and label (1 per record without count columns). Columns by name or 0-based position; separator and quote guessed.

OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
pathrequiredtextthe file (CSV, tab-separated...)
group_columnsrequiredany["x", "y"]
label_columnsrequiredany["genus", "species"]
count_columnsanysample counts, summed (default 1 per record)
cell_sizesanyper group column (default 0)
cell_originsanyper group column (default 0)
crstextof the coordinates (EPSG:..., WKT)
separatortextguess (default), tab, space or a character
quotetextguess (default) or a character
binariseboolcounts become 1

bio.tree#

A phylogenetic tree of a Newick or Nexus file read as Biodiverse reads it (landschaft's read_tree): unnamed nodes 0___, 1___..., duplicated names __dup1..., the Nexus Translate table applied, all-zero lengths made 1, a forest given a new root.

OutputTypeWhat it is
treetreethe tree
SettingTypeWhat it is
pathrequiredtextthe file (or the Newick text itself)
formattextnexus or newick (default: from the text)
indexanythe tree's number (0, default) or name

bio.vector#

A basedata of vector features read like Biodiverse's feature import (landschaft's BaseData.from_vector): points in the cell holding them; lines and polygons over a fishnet of cells spanning the layer, every cell they touch counting 1, or (measure) the area or length of their part in it (GEOS through GDAL); the labels from attributes joined with ':'.

InputTypeWhat it is
featuresrequiredvectorpoints, lines or polygons
OutputTypeWhat it is
basedatabase_datagroups x labels sample counts
SettingTypeWhat it is
labelrequiredanythe label attribute(s)
cell_sizesrequiredany[x, y] in the features' units (0 keeps point coordinates)
cell_originsany[x, y] (default 0)
countanycount attribute(s), summed (default 1, or the measure)
measuretextnone (the cells touched, default), area or length
binariseboolcounts become 1