|
1 | 1 | %% |
2 | | -%utility funcions |
3 | | -addpath /home/slab/users/mangstad/repos/Misc_utils/ |
4 | 2 |
|
5 | 3 | NumComp = 250; |
6 | 4 | Perms = 10000; |
|
68 | 66 | results_g_wo_perms = mc_bbs_perm(featuremat(subset2,:),mainpheno(subset2,:),nuisance(subset2,:),folds_sub2,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_white.Aa); |
69 | 67 | results_g_wo_nih_perms = mc_bbs_perm(featuremat(subset2,:),nihpheno(subset2,:),nuisance(subset2,:),folds_sub2,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_white.Aa); |
70 | 68 |
|
71 | | -results_g_all_perms_dsg = mc_bbs_perm(featuremat,losophenoG,nuisance,folds,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_all.Aa); |
72 | | -results_g_all_perms_dss1 = mc_bbs_perm(featuremat,losophenoS1,nuisance,folds,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_all.Aa); |
73 | | -results_g_all_perms_dss2 = mc_bbs_perm(featuremat,losophenoS2,nuisance,folds,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_all.Aa); |
74 | | -results_g_all_perms_dss3 = mc_bbs_perm(featuremat,losophenoS3,nuisance,folds,NumComp,Perms,'LOSOPheno',0,'Scores',results_g_all.Aa); |
75 | | - |
76 | | -%now calculate proper dropsite performance, since LOSOPheno isn't working |
77 | | -%at the moment for permutations |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | -%permute g pheno and measure dmntpn |
83 | | -inmask = zeros(418,418); |
84 | | -for i = 1:max(nets) |
85 | | - inmask(nets==i,nets==i) = 1; |
86 | | -end |
87 | | -inmask = inmask==1; |
88 | | - |
89 | | -dmntpn = zeros(418,418); |
90 | | -idx = [3,5,8,11,12]; |
91 | | -for i = 1:numel(idx) |
92 | | - for j = 1:numel(idx) |
93 | | - dmntpn(nets==idx(i),nets==idx(j)) = 1; |
94 | | - dmntpn(nets==idx(j),nets==idx(i)) = 1; |
95 | | - end |
96 | | -end |
97 | | -dmntpn = (dmntpn - inmask)>0; |
98 | | -inmask = mc_flatten_upper_triangle(inmask); |
99 | | -dmntpn = mc_flatten_upper_triangle(dmntpn); |
100 | | - |
101 | | -mdl_true = fitlm([Aall(good1,1:250) nuisance(good1,:)],dat.G_lavaan(good1)); |
102 | | -zcons = zscore(coeffall(:,1:250)*mdl_true.Coefficients.Estimate(2:251)); |
103 | | - |
104 | | -supra = abs(zcons)>2; |
105 | | -supra = supra'; |
106 | | -100*sum(inmask)/numel(inmask) |
107 | | -100*sum(dmntpn)/numel(dmntpn) |
108 | | -100*sum(supra.*inmask)/sum(supra) |
109 | | -100*sum(supra.*dmntpn)/sum(supra) |
| 69 | +results_g_all_perms_dsg = mc_bbs_perm(featuremat,losophenoG,nuisance,folds,NumComp,Perms,'LOSOPheno',1,'Scores',results_g_all.Aa); |
| 70 | +results_g_all_perms_dss1 = mc_bbs_perm(featuremat,losophenoS1,nuisance,folds,NumComp,Perms,'LOSOPheno',1,'Scores',results_g_all.Aa); |
| 71 | +results_g_all_perms_dss2 = mc_bbs_perm(featuremat,losophenoS2,nuisance,folds,NumComp,Perms,'LOSOPheno',1,'Scores',results_g_all.Aa); |
| 72 | +results_g_all_perms_dss3 = mc_bbs_perm(featuremat,losophenoS3,nuisance,folds,NumComp,Perms,'LOSOPheno',1,'Scores',results_g_all.Aa); |
0 commit comments