在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:EcoJulia/Diversity.jl开源软件地址:https://github.com/EcoJulia/Diversity.jl开源编程语言:Julia 99.3%开源软件介绍:DiversityA package for measuring and partitioning diversity
SummaryDiversity is a Julia package that provides functionality for measuring alpha, beta and gamma diversity of metacommunities (e.g. ecosystems) and their constituent subcommunities. It uses the diversity measures described in the arXiv paper arXiv:1404.6520 (q-bio.QM), How to partition diversity. It also provides a series of other older diversity measures through sub-modules. Currently these are all ecological diversity measures, but this will be expanded through interfacing to EcoJulia and BioJulia. This package is in beta now, but is cross-validated against our R package boydorr/rdiversity, which is developed independently, so please raise an issue if you find any problems. We now use a DataFrame as the common output format for all of the diversity calculations to provide consistency with our R package rdiversity. The code is not optimised for speed at the moment due to the substantial changes that have happened to it under the hood, and the Phylogenetics submodule is also recently revised, and may need further improvements. InstallationThe package is registered in the (@v1.6) pkg> add Diversity
Resolving package versions...
Updating `~/.julia/environments/v1.6/Project.toml`
[d3d5718d] + Diversity v0.5.5
Updating `~/.julia/environments/v1.6/Manifest.toml`
[d3d5718d] + Diversity v0.5.5
(@v1.6) pkg> Project StatusThe package is confirmed to work against the current LTS Julia v1.4 release and the latest release on Linux, macOS, and Windows. It is also tested against nightly. Contributing and QuestionsContributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems or would just like to ask a question. UsageDiversity MeasuresThe main package provides basic numbers-equivalent diversity measures (described in Hill, 1973), similarity-sensitive diversity measures (generalised from Hill, and described in Leinster and Cobbold, 2012), and related alpha, beta and gamma diversity measures at the level of the metacommunity and its component subcommunities (generalised in turn from Leinster and Cobbold, and described in arXiv:1404.6520 (q-bio.QM)). The diversity functions exist both with unicode names (e.g. ᾱ()), which are not automatically exported as we feel they are too short and with matching ascii names (e.g. NormalisedAlpha()), which are. We also provide a general function for extract any diversity measure for a series of subcommunity relative abundances. Getting startedBefore calculating diversity a # Load the package into Julia
using Diversity
# Example population
pop = [1 1 0; 2 0 0; 3 1 4]
pop = pop / sum(pop)
# Create Metacommunity object
meta = Metacommunity(pop) Calculating diversityFirst we need to calculate the low-level diversity component seperately, by passing a # First, calculate the normalised alpha component
component = NormalisedAlpha(meta) Afterwhich, # Then, calculate species richness of the subcommunities
subdiv(component, 0)
# or the average (alpha) species richness across the whole population
metadiv(component, 0)
# We can also generate a diversity profile by calculating multiple q-values simultaneously
df = subdiv(component, 0:30) In some instances, it may be useful to calculate all subcommunity (or metacommunity) measures. In which case, a # To calculate all subcommunity diversity measures
subdiv(meta, 0:2)
# To calculate all metacommunity diversity measures
metadiv(meta, 0:2) Alternatively, if computational efficiency is not an issue, a single measure of diversity may be calculated directly by calling a wrapper function: norm_sub_alpha(meta, 0:2) A complete list of these functions is shown below:
Phylogenetic diversityPhylogenetic diversity (described here) is
automatically included in the Diversity module when the
The package also provides some other sub-modules for related measures: Diversity.EcologyMany existing ecological diversity measures can be derived from our diversity measures, and so we provide them in the Diversity.Ecology submodule along with generalised versions of them that relate to our general measures of alpha, beta and gamma diversity at subcommunity and metacommunity levels. The generalisations of species richness, Shannon entropy and Simpson's index are the only standard measures we are aware of whose subcommunity components sum directly to the corresponding metacommunity measure (although note that Simpson's index decreases for increased diversity, so small components are more diverse). Documentation for these diversity measures can be found here. Diversity.HillHill numbers are found in the Diversity.Hill sub-module. Documentation for these diversity measures can be found here. Diversity.JostLou Jost's diversity measures are found in the Diversity.Jost sub-module. Documentation for these diversity measures is here. DocumentationDocumentation is generated by the Base documentation in Julia and online via the Documenter package. Using the docsAccessing the documentation in Julia is easy: using Diversity
# Returns any documentation for the subdiv() function
?subdiv The documentation is also available online. Latest releaseThe online documentation for the current stable release is here. Development branchThe online documentation for the latest dev (unreleased) branch is here. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论