Individual contribution

30 views
Skip to first unread message

Dion

unread,
Jun 7, 2019, 12:26:26 AM6/7/19
to brainGraph-help
Hi,


I have calculated the individual contribution using LOO and AOP. But I was wondering if It is possible to also get the individual contribution for the network properties?


Thank you very much,

Dion

Chris Watson

unread,
Jun 8, 2019, 12:48:10 PM6/8/19
to brainGr...@googlegroups.com
Hi Dion, it is not possible with the functions as they are written. You would have to write your own code to get network properties. I could give you some ideas for the code, if you need the help.

I have planned on including it in a future release, but it is not at the top of my list of features to add.

--
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 post to this group, send email to brainGr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/34beb026-6269-42f8-a3ce-449d2dc6448a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

denpasar sesetan

unread,
Jun 11, 2019, 2:40:52 AM6/11/19
to brainGr...@googlegroups.com
I see. Would you mind show me some pointers/idea where to start?


Thanks,

Dion

Chris Watson

unread,
Jun 12, 2019, 11:52:13 PM6/12/19
to brainGr...@googlegroups.com
Sure. You would have to edit the loo and aop functions in this case. For example, loo <- edit(loo)

For loo, in the foreach loop instead of using the Mantel test to calculate differences, it should be just the difference between the graph metric when using all subjects minus the graph metric when using all but one subject.

For example, if you are looking at a global metric (in this example let's say you want global efficiency), in the line after creating new.corrs you would write something like:
g <- graph_from_adjacency_matrix(corrs[[group.vec[i]]]$R, mode='undirected', diag=FALSE)    # Add "weighted=TRUE" if you want a weighted metric
g.new <- graph_from_adjacency_matrix(new.corrs[[1]]$R, mode='undirected', diag=FALSE)
g.eff <- efficiency(g, 'global', use.parallel=FALSE)
g.eff.new <- efficiency(g.new, 'global', use.parallel=FALSE)
g.eff - g.eff.new

And that would be the last line in the loop. If you want to look at a regional metric, you would remove the colSums function, add the first 2 lines from above, and then for example if you want nodal efficiency:
n.eff <- efficiency(g, 'nodal', use.parallel=FALSE)
n.eff.new <- efficiency(g.new, 'nodal', use.parallel=FALSE)
n.eff - n.eff.new

For aop, the changes should be in the "same" places; i.e., where mantel.rtest and colSums are used for global and regional, respectively.

You would change the functions accordingly if you want a different graph metric. Of course these can be generalized and optimized but this will do for specific cases.I don't have time to test this code but it should work. Let me know if you receive any errors.
Chris

Femke Lammertink

unread,
Aug 18, 2020, 4:42:34 PM8/18/20
to brainGraph-help
Dear Chris,

I have a follow-up question. Using the above-mentioned approach, topological measures requiring the distance() function, including global/local efficiency, generated the following error: At structural_properties.c:5313 : cannot run Bellman-Ford algorithm, Negative loop detected while calculating shortest paths. I thought that it might had something to do with the clust.method used, one that can't handle negative weights. However, changing the clust.method into 'spinglass' or 'walktrap' didn't solve the problem. I can't seem to find the issue. Do you have any suggestions? 

Many thanks in advance!!

Best wishes, 

Fem



Chris Watson

unread,
Aug 18, 2020, 5:47:25 PM8/18/20
to brainGr...@googlegroups.com
No, this doesn't involve clustering. You will probably have to remove negative edge weights from your graphs to run them, or check the igraph (or other R-based) forums for another solution.

Reply all
Reply to author
Forward
0 new messages