help > Only draw edges of significant nodes
Showing 1-2 of 2 posts
Display:
Results per page:
Nov 28, 2018  09:11 AM | Sandra Hanekamp - Harvard Medical School
Only draw edges of significant nodes
Hello,

First, thank you so much for developing this toolbox!

I would like to only draw edges in the network based on the threshold of the nodes.

I'm using 116 nodes in total and displaying for instance 10 significant nodes. I would like to draw only the edges of those nodes. It seems that the threshold for the edges is based on the values in the matrix. I have played around with the threshold values for the edges, but I can not get it to only show the edges of the nodes shown. How can I threshold the edges/matrix so it only displays the edges of the nodes I'm displaying?

Many thanks,
Sandra
Dec 17, 2018  05:12 PM | Mingrui Xia
RE: Only draw edges of significant nodes
Hi Sandra,

Please consider using the following code to edit your matrix:


Node_id = [1,2,3]; 
%node_id inidcates the node you'd like to display, here, suppose you want to show node 1 to 3, you can change these number as you want

M_mask = zeros(size(M1));
% M1 is the orignial matrix

M_mask(Node_id,Node_id) = 1;
M2 = M1.*M_mask;
% M2 is the matrix with selected edges.

Best,
Mingrui

Originally posted by Sandra Hanekamp:
Hello,

First, thank you so much for developing this toolbox!

I would like to only draw edges in the network based on the threshold of the nodes.

I'm using 116 nodes in total and displaying for instance 10 significant nodes. I would like to draw only the edges of those nodes. It seems that the threshold for the edges is based on the values in the matrix. I have played around with the threshold values for the edges, but I can not get it to only show the edges of the nodes shown. How can I threshold the edges/matrix so it only displays the edges of the nodes I'm displaying?

Many thanks,
Sandra