From 34e6efab9545b31c4caf67e11e6659428ccebf2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Poisot?= Date: Sat, 16 Mar 2024 14:13:44 -0400 Subject: [PATCH] doc: subgraph for bipartite --- src/basics/subgraphs.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/basics/subgraphs.jl b/src/basics/subgraphs.jl index 6200428f..e48e3721 100644 --- a/src/basics/subgraphs.jl +++ b/src/basics/subgraphs.jl @@ -45,6 +45,13 @@ end @test_throws ArgumentError subgraph(N, [:D, :E]) end +""" + subgraph(N::SpeciesInteractionNetwork{<:Bipartite{T}, <:Interactions}, top::Vector{T}, bottom::Vector{T}) where {T} + +We can induce a subgraph from a biparite network by specifying two arrays for +nodes to be included. Note that any array can instead be `:`, in which case the +entire series of nodes for this side of the network is used. +""" function subgraph(N::SpeciesInteractionNetwork{<:Bipartite{T}, <:Interactions}, top::Vector{T}, bottom::Vector{T}) where {T} topindexes = indexin(top, species(N,1)) botindexes = indexin(bottom, species(N,2))