diff --git a/SS_Clustering_main.m b/SS_Clustering_main.m index a783f03..13663cc 100644 --- a/SS_Clustering_main.m +++ b/SS_Clustering_main.m @@ -1,16 +1,15 @@ % If your code hangs in SS_NormaliseAndFilter remove '-append' from save % command on line 150 in TS_local_clear_remove -% Load your data matrix then normalise and filter it -SS_NormaliseAndFilter('HCTSA_Empirical1000_Aug2015'); +% Set up default run info file +SS_SetupRunInfo; -% % If you have filtered normalised data already -% load('HCTSA_Empirical1000_Aug2015_N_filtered.mat'); -% save('HCTSA_N.mat'); +% Load your data matrix then normalise and filter it +SS_NormaliseAndFilter; % Enter values of K you want to calculate % NB: The largest value of K will automatically be used for the linkage clustering etc -SS_ClusterKMedoids([3,5,10,20]); +SS_ClusterKMedoids; % Calculates residual variance for above clusters SS_ResidVariance; @@ -25,7 +24,7 @@ SS_CorrOpsWithClusters; % Output final clusters to a text file -SS_OutputBestOpsTxtFile('cluster_info.txt'); +SS_OutputBestOpsTxtFile; % Cluster the time series in the reduced operation space to visualise % effectiveness of selected operations diff --git a/SS_SetupRunInfo.m b/SS_SetupRunInfo.m new file mode 100644 index 0000000..dd2e988 --- /dev/null +++ b/SS_SetupRunInfo.m @@ -0,0 +1,37 @@ +function SS_SetupRunInfo( ks , kToUse , op_km_repeats , ts_km_repeats , ... + inMatFileName , outTxtFileName , corr_dist_threshold) + +if nargin < 1 + ks = [5,7,10,20:20:100,200,500,1000]; +end +if nargin < 2 + kToUse = 40; +end +if nargin < 3 + op_km_repeats = 50; +end +if nargin < 4 + ts_km_repeats = 500; +end +if nargin < 5 + inMatFileName = 'HCTSA_new_data'; +end +if nargin < 6 + outTxtFileName = 'cluster_info.txt'; +end +if nargin < 7 + corr_dist_threshold = 0.2; +end + +kIdx = find(ks == kToUse); +if isempty(kIdx) + fprintf('Could not find K = %i in ks - setting kToUse to %i',... + kToUse , ks(length(ks))); + kIdx = length(ks); +end + +save('run_options.mat','ks','kIdx','op_km_repeats','ts_km_repeats',... + 'inMatFileName','outTxtFileName','corr_dist_threshold'); + +end +