https://github.com/shigekiwatanabe/SynapsEM
Raw File
Tip revision: 969166d39a15496221ac67dc266e4e733bcc2e46 authored by shigekiwatanabe on 31 March 2022, 21:42:43 UTC
Add files via upload
Tip revision: 969166d
distribution_dp_all_SV.m
function distribution_data = distribution_dp_all_SV (vesicle_distribution_dp)
% this function will count the number of all vesicles at certain distances from
% the dense projection (based on the bin you choose) and generate a summary
% table that has an average number of vesicles at each bin. 

% a new addition 6/25/2020. the function now calculates the normalized
% distribution by dividing the number in each bin by the total. 

% the column 1: bin
% the column 2: average
% the column 3: std
% the column 4: sem
% the column 5: sum
% the column 6: normalized abundance
[a,b] = size(vesicle_distribution_dp.docked_SV);

distribution_data = zeros(a,b);

for i = 1:a
    
    distribution_data (i,1) = vesicle_distribution_dp.docked_SV(i,1);
    
end

for i = 1:a
    
    for j = 7:b
        
        distribution_data (i,j) = vesicle_distribution_dp.docked_SV(i,j)...
                                + vesicle_distribution_dp.tethered_SV(i,j)...
                                + vesicle_distribution_dp.cytosolic_SV(i,j);
                            
    end
end


for i = 1:a
    
    distribution_data(i,2) = mean(distribution_data(i,7:b));
    distribution_data(i,3) = std(distribution_data(i,7:b));
    distribution_data(i,4) = distribution_data(i,2)/sqrt(b-6);
    distribution_data(i,5) = sum(distribution_data(i,7:b));
    
end

%calculating the total number of vesicles
total_num = sum(distribution_data(:,5));

%calculating the nomralized abundance at each bin
for i = 1:a
    distribution_data(i,6) = (distribution_data(i,5)/total_num);
end
end
        
    
    
back to top