Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
function configParams = readConfigFile(configFilename)
% READCONFIGFILE
% Reads all the parameter values given in the config file and returns
% a structure of all the params
%
% INPUT PARAMS
% Param 'configFilename' (string)
% Config filename to read the parameter values from.
%
% OUTPUT PARAMS
% configParams
% A struct with all variables
%
% ADDITIONAL NOTES
%
% Author: snikumbh@mpi-inf.mpg.de
fid = fopen(configFilename, 'r');
while feof(fid) == 0
l = fgetl(fid);
if findstr(l, '##') > 0
% skip the comment lines
elseif findstr(l, '=') > 0
l2 = strsplit(l,'=');
switch(l2{1})
case 'POSITIVE_FASTA_FILE'
configParams.givenPosFastaFilename = l2{2};
case 'NEGATIVE_FASTA_FILE'
configParams.givenNegFastaFilename = l2{2};
case 'NUMBER_OF_POSITIVES'
configParams.nPosSequences = str2num(l2{2});
case 'NUMBER_OF_NEGATIVES'
configParams.nNegSequences = str2num(l2{2});
case 'TEST_INDICES'
configParams.testIndices = eval(l2{2});
case 'OUTPUT_FOLDER'
configParams.outputFolder = l2{2};
case 'OLIGO_LEN'
configParams.oligoLen = eval(l2{2});
case 'MAX_DIST'
configParams.maxDist = str2num(l2{2});
case 'SEGMENT_SIZE_IN_BPS'
configParams.segmentSizeInBps = str2num(l2{2});
case 'NUMBER_OF_CLUSTERS'
configParams.nClusterVals = eval(l2{2});
case 'SIGMA_VALUES'
configParams.sigmaVals = eval(l2{2});
case 'COST_VALUES'
configParams.Cs = eval(l2{2});
case 'MKL_NORM'
configParams.mklNorm = str2num(l2{2});
case 'NUMBER_OF_INNER_FOLDS'
configParams.nFolds = str2num(l2{2});
case 'NUMBER_OF_OUTER_FOLDS'
configParams.nOuterFolds = str2num(l2{2});
case 'WHETHER_TO_PLOT_HEATMAP'
configParams.whetherToPlotHeatmap = l2{2};
case 'WHETHER_TO_VISUALIZE_WEIGHT_VECTOR'
configParams.whetherToVisualizeWVector = l2{2};
case 'DEBUG_LEVEL'
configParams.debugLevel = str2num(l2{2});
case 'DEBUG_MSG_LOCATION'
configParams.debugMsgLocation = l2{2};
case 'COMPUTATION_VERSION'
configParams.computationVersion = l2{2};
end % switch ends
else
end % if-else ends
end % while ends
fclose(fid);
end