This is a static copy of a profile report

Home

extract_radius_ratio_old (1 call, 2.513 sec)
Generated 05-Nov-2014 07:52:31 using cpu time.
function in file /usr0/home/jenkins/workspace/cellorganizer-demo3D11-glnx64/utilities/3D/vesicles/3D/extract_radius_ratio_old.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
train_cell_shape_model3function1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
45
load(fname)
2011.722 s68.5%
84
save('./temp/cell_shape_eigen/...
10.210 s8.4%
58
curr_nuc = interp1(h,curr_nuc,...
1080.100 s4.0%
43
if exist(fname,'file')
2010.090 s3.6%
61
curr_cell = interp1(h,curr_cel...
1080.060 s2.4%
All other lines  0.330 s13.1%
Totals  2.513 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
interp1function2160.150 s6.0%
ml_dirfunction10.020 s0.8%
filesepfunction2020.010 s0.4%
Self time (built-ins, overhead, etc.)  2.333 s92.8%
Totals  2.513 s100% 
Code Analyzer results
Line numberMessage
1Function name 'extract_radius_ratio' is known to MATLAB by its file name: 'extract_radius_ratio_old'.
33The value assigned to variable 'n' might be unused.
46The value assigned to variable 'baseplane' might be unused.
46The variable 'baseplane' appears to change size on every loop iteration. Consider preallocating for speed.
49The value assigned to variable 'stack' might be unused.
50Variable 'cellcodes' is used, but might be unset.
57The variable 'curr_nuc' appears to change size on every loop iteration. Consider preallocating for speed.
60The variable 'curr_cell' appears to change size on every loop iteration. Consider preallocating for speed.
64The variable 'nucdist' appears to change size on every loop iteration. Consider preallocating for speed.
65The variable 'nucelldist' appears to change size on every loop iteration. Consider preallocating for speed.
68The variable 'r' appears to change size on every loop iteration. Consider preallocating for speed.
70The variable 'r' appears to change size on every loop iteration. Consider preallocating for speed.
75The variable 'distratio' appears to change size on every loop iteration. Consider preallocating for speed.
76The variable 'cellnucratios' appears to change size on every loop iteration. Consider preallocating for speed.
77The variable 'nucbottomslices' appears to change size on every loop iteration. Consider preallocating for speed.
85Best practice is for CATCH to be followed by an identifier that gets the error information.
Coverage results
[ Show coverage for parent directory ]
Total lines in function86
Non-code lines (comments, blank lines)44
Code lines (lines that can run)42
Code lines that did run42
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function [rad_ratio,cellnucratios,nucbottomslices] = extract_radius_ratio(cellcodepath)
2 % From the cellcodes, extract the radius ratio of nuclear radius over cell
3 % radius under cylindrical systerm
4
5 % Author: Tao Peng
6 % Edited: Ivan E. Cao-Berg
7 %
8 % Copyright (C) 2011 Murphy Lab
9 % Lane Center for Computational Biology
10 % School of Computer Science
11 % Carnegie Mellon University
12 %
13 % This program is free software; you can redistribute it and/or modify
14 % it under the terms of the GNU General Public License as published
15 % by the Free Software Foundation; either version 2 of the License,
16 % or (at your option) any later version.
17 %
18 % This program is distributed in the hope that it will be useful, but
19 % WITHOUT ANY WARRANTY; without even the implied warranty of
20 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 % General Public License for more details.
22 %
23 % You should have received a copy of the GNU General Public License
24 % along with this program; if not, write to the Free Software
25 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 % 02110-1301, USA.
27 %
28 % For additional information visit http://murphylab.web.cmu.edu or
29 % send email to murphy@cmu.edu
30
31 % Constants
32 %protype = {'DNA','LAM','Nuc','Gia','Gpp','Mit','TfR'};
1 33 n = 360;
1 34 H = -pi:(2*pi/360):pi;
1 35 k = 0;
36
37 % Calculate radius ratios and combining them
1 38 distratio = []; cellnucratios = []; nucbottomslices = [];
0.02 1 39 celllist = ml_dir([cellcodepath filesep 'cellcodes_*']);
40
0.01 1 41 for i = 1:length(celllist)
0.02 201 42 fname = [cellcodepath filesep celllist{i}];
0.09 201 43 if exist(fname,'file')
0.01 201 44 k = k + 1;
1.72 201 45 load(fname)
201 46 baseplane(k) = equatorZ;
201 47 nucdist = [];
201 48 nucelldist = [];
201 49 stack = [];
201 50 for s = 1:length(cellcodes)
51 % disp(['s:' num2str(s)]);
0.04 3015 52 if ~isempty(cellcodes{s})
0.01 3015 53 curr_nuc = cellcodes{s}.nucdist;
0.02 3015 54 curr_cell = cellcodes{s}.nucelldist;
0.03 3015 55 if length(curr_nuc) ~= 360
108 56 h = -pi:(2*pi/length(curr_nuc)):pi;
108 57 curr_nuc(end+1) = curr_nuc(1);
0.10 108 58 curr_nuc = interp1(h,curr_nuc,H);
108 59 curr_nuc(end) = [];
108 60 curr_cell(end+1) = curr_cell(1);
0.06 108 61 curr_cell = interp1(h,curr_cell,H);
108 62 curr_cell(end) = [];
108 63 end
0.05 3015 64 nucdist = [nucdist;curr_nuc];
0.04 3015 65 nucelldist = [nucelldist;curr_cell];
3015 66 end
0.03 3015 67 end
0.02 201 68 r{i} = nucdist ./ nucelldist;
69
201 70 r{i}(isinf(r{i}(:))) = max(r{i}(~isinf(r{i}(:))));
71
72 % if any()
73 % 1;
74 % end
0.02 201 75 distratio = [distratio,r{i}(:)];
201 76 cellnucratios = [cellnucratios;cellnucheightratio];
201 77 nucbottomslices = [nucbottomslices;nucbottomslice];
201 78 end
201 79 end
80
0.01 1 81 rad_ratio = distratio';
82
1 83 try
0.21 1 84 save('./temp/cell_shape_eigen/radius_ratio.mat','rad_ratio','cellnucratios','nucbottomslices')
85 catch
1 86 end