function run_analysis(vargin)

% Run BNS_analysis 
% 
%            Created by Slava Chushak   18/2007

clear functions

analysis_constants

elf = findstr(data_file,'_eventlog_1');

if ~isempty(elf)
        ef_core = data_file(1:elf(1)-1);
    if exist(fullfile(data_dir, [ef_core '_parsed_1.mat']),'file')
        data_file = [ef_core '_parsed_1.mat']; 
    else
       done = bns_pe(data_dir, ef_core);
       if done == 0
           disp('Eventlog file has NOT been parsed!!!')
           return
       end
       data_file = [ef_core '_parsed_1.mat']; 
     end
end

eval(analysis_type)
