-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipelineAnalyzeNetworksWithGraphlets.m
86 lines (71 loc) · 4.07 KB
/
pipelineAnalyzeNetworksWithGraphlets.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
function [ ] = pipelineAnalyzeNetworksWithGraphlets( marker, dirName, pathFiles )
%PIPELINEANALYZENETWORKSWITHGRAPHLETS Summary of this function goes here
% Detailed explanation goes here
addpath(genpath('src'));
if exist('pathFiles', 'var') == 0
pathFiles = '..\Datos\Data\NuevosCasos160\Casos\';
outputDir = strcat('..\Results\capturingFeatures\Human\NuevosCasos160\MarkersFeatures\', dirName);
else
pathFilesSplitted = strsplit(pathFiles, '\\Data');
outputDir = strcat('..\Results\capturingFeatures\', pathFilesSplitted{end},'\MarkersFeatures\', dirName);
end
basePath = strcat(pathFiles, dirName);
mkdir(outputDir, '\ControlNetwork');
mkdir(outputDir, '\DistanceMatrixWeights');
mkdir(outputDir, '\IterationAlgorithm');
mkdir(outputDir, '\SortingAlgorithm');
mkdir(outputDir, '\MinimumSpanningTree');
mkdir(outputDir, '\GraphletVectors');
mkdir(outputDir, '\GraphletsCount');
if isequal(marker, 'VTN')
getMinimumDistancesFromHexagonalGrid(strcat(basePath, '\Images\'), strcat(marker, '_HEPA_mask'), outputDir);
getMinimumDistancesFromHexagonalGrid(strcat(basePath, '\Images\'), strcat(marker, '_MACR_mask'), outputDir);
%createNetworkMinimumDistance(strcat(basePath, '\Images\'), strcat(marker, '_CELS_'));
compareQuantitiesOfPixelsWithinImages( strcat(outputDir, '\DistanceMatrixWeights\'), strcat(marker, '_HEPA_mask'), strcat(outputDir, '\DistanceMatrixWeights\'), strcat(marker, '_MACR_mask'), basePath );
createMinimumSpanningTreeFromNetworks(strcat(outputDir, '\DistanceMatrixWeights'), marker);
elseif isequal(lower(marker), lower('RET')) || isequal(dirName, 'VasosSanguineos') || isequal(lower(marker), lower('COL')) || isequal(lower(marker), lower('GAGs')) || isequal(lower(marker), lower('CD240')) || isequal(lower(marker), lower('LYVE1'))
%createNetworkMinimumDistance(strcat(basePath, '\Images\'), strcat(marker, '_CELS_'));
getMinimumDistancesFromHexagonalGrid(strcat(basePath, '\Images\'), strcat(marker, '_mask'), outputDir);
createMinimumSpanningTreeFromNetworks(strcat(outputDir, '\DistanceMatrixWeights'), marker);
else
%This functions may not work
createNetworkMinimumDistance(strcat(basePath, '\Images\'), '_POSITIVAS_');
createNetworkMinimumDistance(strcat(basePath, '\Images\'), '_NEGATIVAS_');
end
if isequal(marker, 'VTN')
exportCharacteristicsAsCSV(strcat(outputDir, '\DistanceMatrixWeights'), '_HEPA_');
exportCharacteristicsAsCSV(strcat(outputDir, '\DistanceMatrixWeights'), '_MACR_');
compareNegativeAndPositiveImages(strcat(basePath, '\Images\'), marker, outputDir);
else
exportCharacteristicsAsCSV(strcat(outputDir, '\DistanceMatrixWeights'), []);
end
%Execute minimumDistances.py to get the networks
answer = 'n';
while answer ~= 'y'
answer = input('Have you executed minimumDistance.py? [y/n] ');
end
disp('Leda files...');
disp('Iteration');
calculateLEDAFilesFromDirectory(strcat(outputDir, '\IterationAlgorithm\'));
disp('Sorting');
calculateLEDAFilesFromDirectory(strcat(outputDir, '\SortingAlgorithm\'));
disp('MST');
calculateLEDAFilesFromDirectory(strcat(outputDir, '\MinimumSpanningTree\'));
%Execute ./runGraphletCounter.sh to get graphlets
answer = 'n';
while answer ~= 'y'
answer = input('Have you executed ./runGraphletCounter.sh? [y/n] ');
end
sortBySample(strcat(outputDir, '\GraphletsCount\'), marker);
%Execute ./runNetworkComparisonGraphlets.sh to get the distances between real image and control
answer = 'n';
while answer ~= 'y'
answer = input('Have you executed ./runNetworkComparisonGraphlets.sh? [y/n] ');
end
if isequal(marker, 'VTN')
analyzeGraphletsDistances(strcat(outputDir, '\GraphletsCount\'), 'MACR', 'gdda');
analyzeGraphletsDistances(strcat(outputDir, '\GraphletsCount\'), 'HEPA', 'gdda');
else
analyzeGraphletsDistances(strcat(outputDir, '\GraphletsCount\'), marker, 'gdda');
end
end