Group_permute edges between networks

25 views
Skip to first unread message

Femke Lammertink

unread,
Sep 17, 2020, 8:37:50 AM9/17/20
to brainGraph-help
Dear Chris,

I was wondering whether it is possible to (statistically) test the difference between network edges, using the permute function. More specifcally, using the  count_inter function I would be able to sum the edges between and within networks (DMN, SN, ECN). I tried to adapt the function (see below) so it incorperates the new measure, but I'm doing something wrong as it gives the following error:   task 1 failed - "error in evaluating the argument 'x' in selecting a method for function 't': inherits(g, "brainGraph") is not TRUE"


strength.diffs.perm <- function(g, densities) {
  meas <- lapply(g, function(x) t(sapply(x, function(y) count_inter(y)$mat[1,1])))
  meas.diff <- sapply(seq_along(V(g[[1]][[1]])), function(x)
    brainGraph:::auc_diff(densities, cbind(meas[[1]][, x], meas[[2]][, x])))
  tmp <- as.data.table(t(meas.diff))
  setnames(tmp, 1:ncol(tmp), V(g[[1]][[1]])$name)
  return(tmp)
}
 
Would it be possible to resolve this issue? Of maybe there's a different approach (e.g. using the "degree" function)? Ideally, I'd like to test the difference between groups (time 1/time 2) within each network, but also test the differences between network edges within one timepoint.

Many thanks in advance.

Best wishes, Femke

Chris Watson

unread,
Sep 18, 2020, 10:24:50 AM9/18/20
to brainGr...@googlegroups.com
I'm not sure what you mean by "test the differences between network edges", but it looks like you are interested in the between-group difference of subgraph sizes/densities (where your subgraphs are the DMN, SN, etc.). Your code looks correct so I am not sure what the error is.
You can first try passing a nested list of graph objects to your custom function and see if that runs without error.

Chris

--
You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/cb46daea-52cf-4124-8c95-2ab5e7699b44n%40googlegroups.com.

Femke Lammertink

unread,
Sep 18, 2020, 10:48:25 AM9/18/20
to brainGr...@googlegroups.com
Dear Chris,

My apologies for not being clear. I'd indeed like to compare the number of connections (at different density levels) between networks. 
How should I construct a nested list of graph objects? Do you have some pointers? 

Femke

Chris Watson

unread,
Sep 18, 2020, 10:55:14 AM9/18/20
to brainGr...@googlegroups.com
Please see the User Guide, Chapter 6.

Reply all
Reply to author
Forward
0 new messages