API
The Diversity.API submodule provides the API that must be extended for new AbstractTypes
, AbstractPartition
and AbstractMetacommunity
subtypes.
Usage
Providing additional code to extend the functionality of the system is simple:
using Diversity.Phylogenetics importall Diversity.API function _counttypes(phy::Phylogeny) return phy.nancestral end
extends Diversity.API._counttypes()
(and therefore the directly accessible counttypes()
interface) to handle the Phylogeny
subtype of AbstractTypes
.
#
Diversity.API
— Module.
The Diversity.API submodule should be import
ed if you want to create a new type, partition or metacommunity subtype. Otherwise it can be ignored.
#
Diversity.API.AbstractMetacommunity
— Type.
AbstractMetacommunity{FP <: AbstractFloat, ARaw <: AbstractArray, AProcessed <: AbstractMatrix{FP}, Sim <: AbstractTypes, Part <: AbstractPartition}
AbstractMetacommunity is the abstract supertype of all metacommunity types. AbstractMetacommunity subtypes allow you to define how to partition your total metacommunity (e.g. an ecosystem) into smaller components (e.g. subcommunities), and how to assess similarity between individuals within it.
#
Diversity.API.AbstractPartition
— Type.
AbstractPartition
Abstract supertype for all partitioning types. AbstractPartition subtypes allow you to define how to partition your total metacommunity (e.g. an ecosystem) into smaller components (e.g. subcommunities).
#
Diversity.API.AbstractTypes
— Type.
AbstractTypes
Abstract supertype for all similarity types. Its subtypes allow you to define how similarity is measured between individuals.
#
Diversity.API._calcabundance
— Function.
_calcabundance(t::AbstractTypes, a::AbstractArray)
Calculates the abundance a for AbstractTypes, t (if necessary). May be implemented by each AbstractTypes subtype.
#
Diversity.API._calcordinariness
— Function.
_calcordinariness(t::AbstractTypes, a::AbstractArray, scale::Real)
Calculates the ordinariness of abundance a from AbstractTypes, t. May be implemented by each AbstractTypes subtype.
#
Diversity.API._calcsimilarity
— Function.
_calcsimilarity(t::AbstractTypes, scale::Real)
Retrieves (and possibly calculates) a similarity matrix from t. Must be implemented by each AbstractTypes subtype.
#
Diversity.API._countsubcommunities
— Function.
_countsubcommunities(::AbstractPartition)
Returns number of subcommunities in a partition, p. May be implemented by each AbstractPartition subtype. Default is to count length of subcommunity name vector.
#
Diversity.API._counttypes
— Function.
_counttypes(::AbstractTypes, raw::Bool)
Returns number of types in an AbstractTypes object, t. May be implemented by each AbstractTypes subtype. raw
determines whether to count the number of raw or processed types, which varies, for instance, when the types are determined by a phylogeny. Default is to count length of corresponding types name vector.
#
Diversity.API._getabundance
— Function.
_getabundance(m::AbstractMetacommunity, raw::Bool)
Returns the abundances array of the metacommunity. Must be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getmetaabundance
— Function.
_getmetaabundance(m::AbstractMetacommunity, raw::Bool)
Returns the metacommunity abundances of the metacommunity. May be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getmetaordinariness!
— Function.
_getmetaordinariness!(m::AbstractMetacommunity)
Returns (and possibly calculates) the ordinariness of the metacommunity as a whole. May be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getordinariness!
— Function.
_getordinariness!(m::AbstractMetacommunity)
Returns (and possibly calculates) the ordinariness array of the subcommunities. May be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getpartition
— Function.
_getpartition(::AbstractMetacommunity)
Returns the AbstractPartition component of the metacommunity. Must be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getscale
— Function.
_getscale(m::AbstractMetacommunity)
Returns a scaling factor for the metacommunity (needed for phylogenetics). Normally ignored. Must be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getsubcommunitynames
— Function.
_getsubcommunitynames(p::AbstractPartition)
Returns the names of the subcommunities in the partition object. Must be implemented by each AbstractPartition subtype.
#
Diversity.API._gettypenames
— Function.
_gettypenames(t::AbstractTypes, raw::Bool)
Returns the names of the types in an AbstractTypes object. Must be implemented by each AbstractTypes subtype. raw
determines whether to count the number of raw or processed types, which varies, for instance, when the types are determined by a phylogeny.
#
Diversity.API._gettypes
— Function.
_gettypes(::AbstractMetacommunity)
Returns the AbstractTypes component of the metacommunity. Must be implemented by each AbstractMetacommunity subtype.
#
Diversity.API._getweight
— Function.
_getweight(m::AbstractMetacommunity)
Returns the subcommunity weights of the metacommunity. May be implemented by each AbstractMetacommunity subtype.
#
Diversity.API.floattypes
— Function.
floattypes(t)
This function returns a set containing the floating point types that are compatible with the Diversity-related object, t.
#
Diversity.API.mcmatch
— Function.
mcmatch(procm::AbstractArray, sim::AbstractTypes, part::AbstractPartition)
Checks for type and size compatibility for elements contributing to a Metacommunity
#
Diversity.API.typematch
— Method.
typematch(args...)
Checks whether the types of a variety of Diversity-related objects have compatible types (using floattypes()).
Diversity
Diversity.API
Diversity.Ecology
Diversity.Hill
Diversity.Jost
Diversity.individualDiversity
Diversity.metacommunityDiversity
Diversity.subcommunityDiversity
Diversity.API.AbstractMetacommunity
Diversity.API.AbstractPartition
Diversity.API.AbstractTypes
Diversity.DiversityLevel
Diversity.DiversityMeasure
Diversity.Gamma
Diversity.GeneralTypes
Diversity.Metacommunity
Diversity.NormalisedAlpha
Diversity.NormalisedBeta
Diversity.NormalisedRho
Diversity.Onecommunity
Diversity.PowerMeanMeasure
Diversity.RawAlpha
Diversity.RawBeta
Diversity.RawRho
Diversity.RelativeEntropyMeasure
Diversity.Species
Diversity.Subcommunities
Diversity.Taxonomy
Diversity.UniqueTypes
Diversity.API._calcabundance
Diversity.API._calcordinariness
Diversity.API._calcsimilarity
Diversity.API._countsubcommunities
Diversity.API._counttypes
Diversity.API._getabundance
Diversity.API._getmetaabundance
Diversity.API._getmetaordinariness!
Diversity.API._getordinariness!
Diversity.API._getpartition
Diversity.API._getscale
Diversity.API._getsubcommunitynames
Diversity.API._gettypenames
Diversity.API._gettypes
Diversity.API._getweight
Diversity.API.floattypes
Diversity.API.mcmatch
Diversity.API.typematch
Diversity.Ecology.generalisedjaccard
Diversity.Ecology.generalisedrichness
Diversity.Ecology.generalisedshannon
Diversity.Ecology.generalisedsimpson
Diversity.Ecology.jaccard
Diversity.Ecology.richness
Diversity.Ecology.shannon
Diversity.Ecology.simpson
Diversity.Hill.hillnumber
Diversity.Jost.jostalpha
Diversity.Jost.jostbeta
Diversity.calcsimilarity
Diversity.countsubcommunities
Diversity.counttypes
Diversity.diversity
Diversity.getASCIIName
Diversity.getFullName
Diversity.getName
Diversity.getabundance
Diversity.getmetaabundance
Diversity.getmetaordinariness!
Diversity.getordinariness!
Diversity.getpartition
Diversity.getsubcommunitynames
Diversity.gettypenames
Diversity.gettypenames
Diversity.gettypes
Diversity.getweight
Diversity.inddiv
Diversity.metadiv
Diversity.qD
Diversity.qDZ
Diversity.subdiv