function [PDC,COH,DTF,ep_times,E,freq] = MainPDC

% Initial function to start the PDC analysis. 
% You choose the type of work you want to do


disp('Choose the type of data to work with: [1~LFPs] or [2~spike trains], to pool results [3], to plot processed data [4] or to run a demo [5].');
disp(' ')
disp('        LFP data -> 1');                                              % Specify the desired type of analysis. Work with LFPs...
disp('Spike train data -> 2');                                              % work with spike trains...
disp('    Pool results -> 3');                                              % pool results...
disp('   Plotting only -> 4');                                              % or just plot results.
disp('        Run Demo -> 5');
work_type = input('');


if work_type == 1                                                           % According to to each work-type...
   [PDC,Signif,S,H,COH,DTF,DC,pCOH,ep_times,E,freq] = MainPDC_LFP;          % call the corresponding function.
   
   
elseif work_type == 2
    disp('Choose the type of analysis you want to work with.');             % If spike trains are chosen...
    disp('Work with PCA of spike train times -> 1');                        % ask to work with spike times...
    disp('     Work with PCA of firing rates -> 2');                        % or firing rates.
    spike_type = input('');
    
    if spike_type == 1
        [PDC,Signif,S,H,COH,DTF,dDTF,pCOH,ep_times,E,freq] = MainPDC_spikes_times;               
    elseif spike_type == 2
        [PDC,Signif,S,H,COH,DTF,dDTF,pCOH,ep_times,E,freq] = MainPDC_spikes_rates;
    else
        error('You have to choose one of the above!')
    end
    

elseif work_type == 3
    PooledPDC;
        
        
elseif work_type == 4
    Plotting;

elseif work_type == 5
    DEMO;
    
else
    error('You have to choose one of the three options!')
end