Skip to content

Disconnected species

Abstract

When generating networks, in particular when using randomdraws following nullmodel, there is a chance that some species will have no interactions. In some cases, it may be relevant to identify and remove these species. The methods presented in this page offer a way to do this.

Detection of disconnected species

# SpeciesInteractionNetworks.isdisconnectedFunction.

isdisconnected(N::SpeciesInteractionNetwork{Bipartite{T}, <:Interactions}, sp::T) where {T}

Returns true if the species has no interaction.

source

isdisconnected(N::SpeciesInteractionNetwork{Unipartite{T}, <:Interactions}, sp::T, allow_self_interactions::Bool=true) where {T}

Returns true if the species has no interaction; the last argument (allow_self_interactions, defaults to true) indicates whether self-interactions are allowed. If false, species that only interact with themselves are considered to be disconnected.

source

# SpeciesInteractionNetworks.isdegenerateFunction.

isdegenerate(N::SpeciesInteractionNetwork{<:Bipartite, <:Interactions})

A bipartite network is degenerate if it has species with no interactions.

source

isdegenerate(N::SpeciesInteractionNetwork{<:Unipartite, <:Interactions}, allow_self_interactions::Bool=true)

A unipartite network is degenerate if it has species with no interactions. In some cases, it is useful to consider that a species with only self-interactions is disconnected from the network – this can be done by using false as the second argument (the default is to allow species with only self interactions to remain).

source

Simplification of networks with disconnected species

# SpeciesInteractionNetworks.simplifyFunction.

simplify(N::SpeciesInteractionNetwork{<:Bipartite, <:Interactions})

Returns a copy of a network containing only the species with interactions. Internally, this calls isdisconnected.

source

simplify(N::SpeciesInteractionNetwork{<:Unipartite, <:Interactions}, allow_self_interactions::Bool=true)

Returns a copy of a network containing only the species with interactions. Internally, this calls isdisconnected – see this documentation for the consequences of allow_self_interactions.

source

Where is simplify!

In the EcologicalNetworks.jl package, the simplify! function would drop species from a network. In this package, because we try to keep networks as immutable as possible, we have not implemented this function. If you really want to reproduce this behavior, you can wrap whatever command will create the network in simplify.