Creating sparse normalised networks

Submitted by thomascope on

I am new to using GraphVar. I would like to create some graphs normalised to random networks. My problem is that the minimum network density threshold in the GUI seems to be 0.1. This seems a very dense starting point. I would like to look at networks with a lower density. Is there a way I can modify the code to allow lower density thresholds to be selected in the GUI?

Thanks

Thomas

thomascope

Wed, 10/05/2016 - 18:50

A more expert reponse is clearly required, but in the absence of a more elegant solution, in case it’s of any interest, I think that I have succeeded in forcing GraphVar to produce relative thresholds below 0.1. I was totally unable to make these selectable in the GUI, but I’ve created a really nasty hack where in the calculation script and the export script the selected thresholds are halved. (i.e. select 0.1, 0.2 and 0.3 if you really want 0.05, 0.1 and 0.15). Clearly if even lower thresholds were required the appropriate divisor could be added.

 

If you have any desire to replicate this in future, the necessary changes were in:

GraphVar-1.0/src/calc/CalcVars.m

 

At the first line of Part 2: Do the Thresholding/Binarizer (line 252 for me) add:

thresholds = thresholds/2; % XXX HACK TO ALLOW LOWER THRESHOLDS

 

and

 

GraphVar-1.0/src/gui/GraphVar/GraphVar_CalcExport_Callback.m

 

Immediately after: [~,dialogData] = GraphVar_getDialogData(handles,0,1); (line 59 for me) add:

dialogData.thresholds = dialogData.thresholds/2; % XXX HACK TO ALLOW LOWER THRESHOLDS

Johann Kruschwitz

Wed, 10/12/2016 - 14:53

Hi,

this is a nice HACK :) - however, it is explained in the GraphVar Manual (page 33) how to change the thresholds (these changes will have to be made in the script "GraphVar_OpeningFcn.m" but are subsequently visible in the GUI).

Here is what the manual says:

Change the threshold range/steps (relative/absolute):
- Open the script “GraphVar_OpeningFcn.m” (src\gui\GraphVarfolder)
- Search for the first “thr_str”


Refers to proportional thresholding:

for
i = 0.1:0.01:0.5         %%%%%%%%%%%%%% THRESHOLD RANGE
thr_str{count} = num2str(i);
count = count + 1 ;
end


Refers to absolute thresholding:

count = 1;
for
i = 0.05:0.01:1        %%%%%%%%%%%%%% THRESHOLD RANGE
thr_str2{count} = num2str(i);
count = count + 1 ;
end
 

Forums