There and back to the present: a model-based framework to estimate phylogenetically constrained alpha diversity gradients
Leandro Duarte, Gabriel Nakamura, Vanderlei Debastiani, Renan Maestri, Maria João Veloso da Costa Ramos Pereira, Marcus Cianciaruso, José Alexandre F. Diniz-Filho
This repository contains data and R scripts that allows to reproduce the analyses presented in the manuscript entitled “There and back to the present: a model-based framework to estimate phylogenetically constrained alpha diversity gradients”, in which we introduce an individual-based simulation approach coupled with Approximate Bayesian Computation (ABC) that allows to parameterize adaptation rates of species niche positions along the evolution of a monophyletic lineage, as well as the intensity of dispersal limitation between local assemblages potentially connected by dispersal (metacommunity). The analytic tool was implemented in an R package called mcfly. A preprint version of this work can be found here.
Obs -The preprint does not correspond to the most updated version of the study.
If you want to use this repository you can clone or download to your computer machine using the following code:
To clone using github from command line:
git clone https://github.com/GabrielNakamura/Data_MS-mcfly your_repo_titleTo download using R:
download.file(url = "https://github.com/GabrielNakamura/Data_MS-mcfly/archive/main.zip", destfile = "Data_MS-mcfly.zip")The script and data are organized in folders containing files that are described in the next section.
The R folder contains all the scripts needed to read data and
libraries and running the analysis contained in the manuscript.
-
read_data_libraries.Rreads and proccess data before running the analysis for the real communities (Phyllostomidae communities) -
Phyllostomidae.Rperform mcfly analysis using data from Phylostomidae communities accordingly to the parameters passed tomcflyfunction -
RunSimTest_mcfly.Rcontains an R function used to perform the simulations used in this study -
SimulatedData_mcfly.RcallsRunSimTest_mcfly.Rfunction to run the simulation using five degrees of dispersal parameter (w)
The data folder contains all data necessary to run the analysis with
empirical communities (using Phylostomidae communities).
-
comm_phyllostomidae_final.txtis a community matrix with species in the columns and assemblages in the rows -
tree_phyllostomidae_final.treis a newick file containing the phylogenetic tree -
grid_data.txtis a txt file containing coordinates (coords.x1 and coords.x2) and environmental variables used in the analysis of Phylostomidae dataset- Elevation - elevation in meters
- Elev_range - elevation range in meters
- Temp - mean annual temperature in Celcius
- Temp_Seas - temperature seasonality as coefficient of variation in temperature for a year
- Prec - mean anual preciptation in mm
- Prec_Seas - precipitation seasonality as coefficient of variation in precipitation for a year
This folder contains all Figures presented in the manuscript. All the Figures were made using DataGraph software, however all data needed to construct the same figures can be obtained by running the analysis.
As an additional tool we developed the R package mcfly. The latest
development version of the package can be downloaded using:
devtools::install_github(repo = "GabrielNakamura/mcfly", ref = "master")Important: All analyses described in the preprint was done using
previous versions of mcfly
Additionaly to R,
DataGraph
software was used to produce all the Figures present in the manuscript.
Files used in additional software can be found in DataGraph folder.
If you find a problem or a bug, please open an Issue at GitHub with a minimal reproducible example.
