Neither version of fractional trophic level described in the previous post can be adapted to trophic networks. There are two obstacles. First, bi-directional links between nodes, representing inter-node predation, introduces recursion that prohibits the calculation of a static value. Second, Pauly’s version, while a very appropriate measure of trophic level, cannot work unless one has knowledge of the fraction of a node’s prey represented by the prey node. Those data are generally unavailable for complex network implementations of food webs (or for most of the species anyway). Many other measures of trophic level in complex trophic networks boil down simply to semi-quantitative assignments based on whether nodes are primary producers, primary consumers, true omnivores, or secondary consumers. The very simple network presented in the previous post could lead to conflicting assignments unless some conventional standard was formulated. But there’s another way.

The network is repeated here, but now with trophic levels assigned to each node. Trophic level was computed as the mean shortest path length from a node’s prey to a primary producer node. Primary producer nodes are therefore assigned a path length of zero (e.g. node 1). The formula, in the spirit of fractional trophic level, is for a node j

where r is the in-degree of node j, and l is the shortest path from prey node i to a primary producer node. The formula is generalized to an entire network as

where, as in many previous posts, is the size of the network, i.e. the number of nodes, and is the ji-th entry of a binary adjacency matrix indicating whether node i is prey to node j.

For example, the trophic level of node 2 is

while that of node 3 is

### Like this:

Like Loading...

*Related*

jebyrnes

said:I’ve been wondering this myself, as my trophic level calculations for kelp forests don’t fit well at all. I’ve long suspected this was due to loops. I wonder – given the number of trophic levels calculated here, and that some species fall out in the same level, how this method compares to, say, the groups that would fall out from Allesina’s grouping method. It’s apples to oranges in some respects, but, given that species feeding on one another can end up at the same trophic level, I think it’s an interesting question.

Your method codes up fairly easily – we’ll see how it works with my data.

#in R using igraph to do the shortest path heavy lifting

library(igraph)

#get the TL of a single species

get_tl<-function(node, shorts, producers){

if(node %in% producers) return(0)

#who are the prey

prey<-which(shorts[,node]==1)

return(1+1/length(prey)*sum(sapply(prey, function(x) min(shorts[producers,x]))))

}

#get the TL of all organisms, calling get_tl for

#each species

get_all_tl<-function(adj.Mat){

producers<-which(rowSums(adj.mat)==0)

g1 <- graph.adjacency(adj.mat)

shorts<-shortest.paths(g1, mode="in")

sapply(1:4, function(x) get_tl(x, shorts, producers))

}

`#for the test graph`

adj.mat<-t(matrix(c( 0, 0, 0, 0,

1, 0, 0, 0,

1, 0, 0, 1,

0, 1, 1, 0), ncol=4))

get_all_tl(adj.mat)

proopnarine

said:Thanks for posting the code Jarrett! Cool. I think that technically, any nodes assigned to the same group by Allesina’s method should be assigned to the same trophic level. I tend to think of aggregation schemes as treating members neutrally, though Allesina’s members can be nested, and my trophic guilds assign species varying link degrees. So perhaps trophic level could be accommodated similarly. Interestingly, the problem did not arise with the coral reef web, which is huge, because of the near absence of loops and strong hierarchy. Instead, I ran into the problem with some ancient terrestrial systems that we’re working with.

jebyrnes

said:I’ve been thinking about this a bit more and wondering – how does cannibalism fit in? It’s a small concern (include or exclude a species in its own diet in the calculation), but an intriguing one.

proopnarine

said:Ah yes. I actually have run into this with a couple of the coral reef fish when calculating fractional trophic level. I ignored cannibalism as a default. Any ideas? 🙂

jebyrnes

said:Well. One could ignore it. Or, again, there is a shortest path from the organism to a primary producer. This would tend to up the trophic level of cannibals a bit. So, it becomes a matter of judgement. Is a canibal at a higher trophic level than a non-canibal feeding on the same diet?

I would say yes. Consider a species that is not a canibal, but is also eating another species at the otherwise shares its diet. Would we not put this intraguild predator at a slightly higher trophic level? I think that’s a valid argument for including canibals in the calculation of their own trophic level.

proopnarine

said:I agree. I ignored cannibalism earlier when calculating fractional trophic level, where you run into the recursion problem.

jebyrnes

said:Hrm. I don’t think there should be a recursion problem, as you’re still searching for a shortest path. The shortest.path algorithm in R defaults to no path from a species to itself. So, I’ve modified the code above a bit, and it gives accurate results, I think.

get_all_tl<-function(adj.Mat){

producers<-which(rowSums(adj.mat)==0)

g1 <- graph.adjacency(adj.mat)

shorts<-shortest.paths(g1, mode="in")

diag(shorts)<-diag(adj.mat) #insert cannibalism

sapply(1:nrow(adj.mat), function(x) get_tl(x, shorts, producers)) #n.b., i've fixed something here as well

}

So, compare your original scenario to one where species 4 is also a canibal

default trophic levels: 0 1 2 2

cannibal trophic levels 0 1 2 2.333

Interesting, no?

Either way, I like this approach, and may have to re-do my analyses with this. The Odum and Heald method didn’t reveal anything of interest, really – poor fits from my models all around. I do wonder how different this method performs from others. Might be interesting to grab a number of canonical food webs and crank them through both, then look at metrics such as the distribution of trophic levels, etc.

proopnarine

said:Go ahead and use it please by all means! Note, however, that when I refer to “fractional trophic level”, as in the previous post, I’m referring specifically to Odum and Heald, and not my method. That’s why I pointed again to the recursion problem. I agree that cannibalism does not suffer that problem with my approach, but I haven’t come up with a name for it yet. It seems to me that you will run into the recursion problem with fractional trophic levels, which granted was not devised for networks. But it seems that the shortest-path approach does not encounter any such problems.

And I would be very interested in giving a shot to a meta-analysis of some canonical webs.