Title: | Detecting Trait Clustering in Environmental Gradients |
---|---|
Description: | The Randomized Trait Community Clustering method (Triado-Margarit et al., 2019, <doi:10.1038/s41396-019-0454-4>) is a statistical approach which allows to determine whether if an observed trait clustering pattern is related to an increasing environmental constrain. The method 1) determines whether exists or not a trait clustering on the sampled communities and 2) assess if the observed clustering signal is related or not to an increasing environmental constrain along an environmental gradient. Also, when the effect of the environmental gradient is not linear, allows to determine consistent thresholds on the community assembly based on trait-values. |
Authors: | Mateu Menendez-Serra, Vicente J. Ontiveros, Emilio O. Casamayor, David Alonso |
Maintainer: | Mateu Menendez-Serra <[email protected]> |
License: | GPL-3 |
Version: | 0.1.1 |
Built: | 2024-11-06 03:56:22 UTC |
Source: | https://github.com/cran/RTCC |
A dataset containing genomic data of 544 genomes that matched 16s rRNA data from saline lagoons of the Monegros desert area.
group_information
group_information
A data frame with 544 rows and 14 variables:
Genome IMG code
Genome size
GC percentage
Conding base percentage
CDS percentage
RNA percentage
rRNA count
Transporter proteins percentage
Signal peptide percentage
Transmembrane proteins percentage
Gene count
Minimum environmental value where the organism has been observed
Minimum environmental value where the organism has been observed
Relative abundance of the organism on the metacommunity
...
Triadó-Margarit, X., Capitán, J.A., Menéndez-Serra, M. et al. A Randomized Trait Community Clustering approach to unveil consistent environmental thresholds in community assembly. ISME J 13, 2681–2689 (2019).
A dataset containing salinity values of 136 lagoons on the Monegros desert area.
metadata
metadata
A data frame with 136 rows and 2 variables:
Sample internal code
Sample salinity value
Triadó-Margarit, X., Capitán, J.A., Menéndez-Serra, M. et al. A Randomized Trait Community Clustering approach to unveil consistent environmental thresholds in community assembly. ISME J 13, 2681–2689.2019.
A set of functions which allows to determine if the observed traits present clustering/overdispersion patterns on the observed samples, and if so, to stablish if the observed pattern is linked to the effect of an environmental gradient.
The study of phenotypic similarities and differences within species along environmental gradients might be used as a powerful tool complementing taxon-based approaches when assesing the contribution of stochastic and deterministic processes in community assembly. For this, this package allows an easy implementation of a method for detecting clustering/overdispersion patterns along an environmental gradient (Triado-Margarit et al., 2019). A first function assesses if the observed traits exhibit a clustering/overdispersion pattern on the tested samples. If positive, two subsequent functions determine whether the observed pattern is linked to the effect of an environmental varible and its statistical significance.
The data consists on presence-absence observations along a measured environmental gradient and trait quantitative information of the observed organisms.
Triado-Margarit, X., Capitan, J.A., Menendez-Serra, M. et al. (2019) A Randomized Trait Community Clustering approach to unveil consistent environmental thresholds in community assembly. ISME J 13, 2681–2689 . https://doi.org/10.1038/s41396-019-0454-4
This function determines whether the selected traits exhibit or not a clustering/overdispersion signal on the tested samples. For each trait, compares the observed Mean Pairwise Distance (MPD) of each sample against a distribution of synthetic commmunities MPDs obtained by a randomization test. Each synthetic community is build maintaining the original sample richness and randomly selecting organisms form the global pool.
rtcc1(table1, table2, table3, traits_columns, repetitions)
rtcc1(table1, table2, table3, traits_columns, repetitions)
table1 |
A data frame containing organisms names on the first column and its trait values on the consecutive ones. It also has to contain two columns with the maximum and the minimum values of the tested environmental variable where the organisms have been observed. |
table2 |
A presence-absence observations table with the organisms names on the first column and the sample names as consecutive colnames. |
table3 |
A dataframe containing sample names on the first column and environmental parameters on the consecutive ones. |
traits_columns |
Table 1 column numbers where different trait values appear. |
repetitions |
Number of simulated synthetic communities distributions. |
The function returns a dataframe with trait names as colnames and the p-value distribution of the different traits.
data(group_information) data(table_presence_absence) data(metadata) rtcc1(group_information, table_presence_absence, metadata, 2:11, 100)
data(group_information) data(table_presence_absence) data(metadata) rtcc1(group_information, table_presence_absence, metadata, 2:11, 100)
For a given trait, this function determines whether the observed trait clustering/overdispersion on the metacommunity is linked to an environmental gradient. For this, it sequentially remove samples in decreasing order of the environmental variable and computes at each step the remaining metacommunity h-index. This index is based on the percentage of samples on a metacommunity presenting significant trait clustering/overdispersion.
rtcc2( table1, table2, table3, species_abundances, trait_col_number, min_env_col, max_env_col, env_var_col, h_iteration, repetitions, model )
rtcc2( table1, table2, table3, species_abundances, trait_col_number, min_env_col, max_env_col, env_var_col, h_iteration, repetitions, model )
table1 |
A data frame containing organisms names on the first column and its trait values on the consecutive ones. It also has to contain two columns with the maximum and the minimum values of the tested environmental variable where the organisms have been observed. |
table2 |
A presence-absence observations table with the organisms names on the first column and the sample names as consecutive colnames. |
table3 |
A dataframe containing sample names on the first column and environmental parameters on the consecutive ones. |
species_abundances |
A vector containing the relative abundance of the organisms on the whole data set on the same order as appear on Table 1. |
trait_col_number |
Table 1 column number of the tested trait. |
min_env_col |
Table 1 column number indicating the minimum value of the environmental variable were each organism has been observed. |
max_env_col |
Table 1 column number indicating the maximum value of the environmental variable were each organism has been observed. |
env_var_col |
Table 2 column number indicating the tested environmental variable. |
h_iteration |
Number of h-index calculations for computing a confidence interval. |
repetitions |
Number of simulated synthetic communities distributions. |
model |
Model selection. All models build synthetic communities based on the organisms richness of the observed communities. - Model 1: organism are selected randomly from the global pool. - Model 2: organism are selected randomly with a probability based on its relative abundance on the global pool. - Model 3: organism are selected randomly, but only those whose environmental range includes the value of the simulated community are elegible. - Model 4: organism are selected randomly, but only those whose environmental range includes the value of the simulated community are elegible and the selection probability is based on its relative abundance on the global pool. |
The function returns a dataframe with the maximum of the environmental variable on the remaining metacommunity after the sequential removal, h-index calculation for each environmental value, and its confidence standard deviation.
data(group_information) data(table_presence_absence) data(metadata) rtcc2(group_information, table_presence_absence, metadata, group_information$sums, 9, 12, 13, 2, 100, 100, model = 1)
data(group_information) data(table_presence_absence) data(metadata) rtcc2(group_information, table_presence_absence, metadata, group_information$sums, 9, 12, 13, 2, 100, 100, model = 1)
For a given trait and environmental variable, this function creates a null model of the clustering/overdispersion pattern in order to test if the observed pattern statistically differs from the expected by random. For this, it sequentially remove random samples from the metacommunity and computes at each step the remaining metacommunity h-index. This index is based on the percentage of samples on a metacoomunity presenting significant trait clustering/overdispersion. After h iterations, computes a 95 obtained h-index for each point of the environmental gradient.
rtcc3( table1, table2, table3, species_abundances, trait_col_number, min_env_col, max_env_col, env_var_col, h_iteration, repetitions, model )
rtcc3( table1, table2, table3, species_abundances, trait_col_number, min_env_col, max_env_col, env_var_col, h_iteration, repetitions, model )
table1 |
A data frame containing organisms names on the first column and its trait values on the consecutive ones. It also has to contain two columns with the maximum and the minimum values of the tested environmental variable where the organisms have been observed. |
table2 |
A presence-absence observations table with the organisms names on the first column and the sample names as consecutive colnames. |
table3 |
A dataframe containing sample names on the first column and environmental parameters on the consecutive ones. |
species_abundances |
A vector containing the relative abundance of the organisms on the whole data set on the same order as appear on Table 1. |
trait_col_number |
Table 1 column number of the tested trait. |
min_env_col |
Table 1 column number indicating the minimum value of the environmental variable were each organism has been observed. |
max_env_col |
Table 1 column number indicating the maximum value of the environmental variable were each organism has been observed. |
env_var_col |
Table 2 column number indicating the tested environmental variable. |
h_iteration |
Number of h-index calculations for computing a confidence interval. |
repetitions |
Number of simulated synthetic communities distributions. |
model |
Model selection. All models build synthetic communities based on the organisms richness of the observed communities. - Model 1: organism are selected randomly from the global pool. - Model 2: organism are selected randomly with a probability based on its relative abundance on the global pool. - Model 3: organism are selected randomly, but only those whose environmental range includes the value of the simulated community are elegible. - Model 4: organism are selected randomly, but only those whose environmental range includes the value of the simulated community are elegible and the selection probability is based on its relative abundance on the global pool. |
The function returns a dataframe with the maximum value of environmental variable corresponding to the same number of samples on the ordered remova, h-index calculation for each environmental value, and the percentiles 0.025, 0.5 and 0.975 of the obtained distribution for each point (mean value and 95
data(group_information) data(table_presence_absence) data(metadata) rtcc3(group_information, table_presence_absence, metadata, group_information$sums, 9, 12, 13, 2, 50, 20, model = 1)
data(group_information) data(table_presence_absence) data(metadata) rtcc3(group_information, table_presence_absence, metadata, group_information$sums, 9, 12, 13, 2, 50, 20, model = 1)
A dataset containing presence-absence data of 544 genomes on 136 saline lagoons of the Monegros desert area.
table_presence_absence
table_presence_absence
A data frame with 544 rows and 137 variables:
Genome IMG code
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
Sample presence-absence observations
...
Triadó-Margarit, X., Capitán, J.A., Menéndez-Serra, M. et al. A Randomized Trait Community Clustering approach to unveil consistent environmental thresholds in community assembly. ISME J 13, 2681–2689 (2019).