-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_infomap_HSB_testversion.m
executable file
·48 lines (33 loc) · 1.69 KB
/
run_infomap_HSB_testversion.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Script for running infomap and making models of the functional networks
% in some group of data
%% Initialization
clear;clc;close all;
path_to_code = '/data/wheelock/data1/people/Cindy/BrBx-HSB_infomap_cleanup' % state the directory for this code
cd(path_to_code);
addpath(genpath(path_to_code));
rmpath(genpath('tmp'));
infomappath = fullfile(path_to_code,'ExternalFunctions/infomap');
%% Load parameters
params = get_params_mat_eLABE_Y2_N92_healthyterm(infomappath);
% [params] = get_params_mat_WashU120(infomappath);
%% Use Evan's wrapper?
% Run_Infomap(params.zmat, params.dmat, params.xdist, params.lo:params.step:params.hi, params.binary, params.outputdir, 2,[],500)
%% Wrapper to Infomap
stats=GraphCluster_HSB(params.zmat,params); % this can take 10-20 minutes depending on your data/sever specs
%% Save the results in a stats structure
stats.params.dmat = [];% let's not save the dmat as they might be hugeee for vertex-wise
stats.MuMat = [];% let's not save the matrix as they might be hugeee for vertex-wise
cd(params.outputdir)
save(fullfile(params.outputdir,params.IMap_fn),'stats'); % save infomap output to matrix
%% Calculate some stats
% stats.metrics = Matrix_metrics_HSB(stats.clusters,stats.MuMat,stats.rth,stats.params.binary);
% stats.metrics = Matrix_metrics_HSB_mod(stats);
%% Display something about results
if stats.params.fig
stats.metrics.kdenth = stats.kdenth;stats.metrics.rth = stats.rth;
Plot_InfoMap_Metrics_HSB(stats.metrics,stats.clusters); % Not quite clearly labeled
stats.metrics =rmfield(stats.metrics,{'kdenth','rth'});
end
%% Back up this file
% fn = mfilename('fullpath');
% mfilebackup(fn,params.IMap_fn);