Skip to content

Commit

Permalink
just SO3 test; update full model (SE3) to note that discrepancy is no…
Browse files Browse the repository at this point in the history
…t too bad
  • Loading branch information
rhiju committed Jun 7, 2020
1 parent e734b65 commit 9e18c7e
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 42 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 85 additions & 25 deletions notes/ToyFold3D_NOTES.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -287,32 +287,42 @@ And for 2-mr [cyclic dinucleotide] there may be only one solution:\
\cf0 \
\
\
\ul Let\'92s work through how to do KDE\'92s for SO(3) \
\ulnone Check volume element.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ul Let\'92s work through how to do KDE\'92s for SO(3) \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ulnone Check volume element.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab560\pardirnatural\partightenfactor0

\i check_rotations_test.
\i \cf0 check_rotations_test.
\i0 [copied from loop_close/ GitHub repo]\
\
Use \ul SpinCalc\ulnone to generate\

\i \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\i0 \cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.29.30 PM.png \width7800 \height7240
}¬}{{\NeXTGraphic Screen Shot 2020-06-02 at 1.29.26 PM.png \width7640 \height6720
}¬}{{\NeXTGraphic Screen Shot 2020-06-02 at 1.29.34 PM.png \width10180 \height7980
}¬}\
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.29.26 PM.png \width7640 \height6720
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.29.34 PM.png \width10180 \height7980
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\
\
\
OK!\
\ul How does KDE do?\
\ulnone Depends on number of samples. Interestingly, overestimates/underestimates depending on number of samples, which seems OK.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ul How does KDE do?\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ulnone Depends on number of samples. Interestingly, overestimates/underestimates depending on number of samples, which seems OK.\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.50.50 PM.png \width7080 \height9500
}¬}{{\NeXTGraphic Screen Shot 2020-06-02 at 1.50.44 PM.png \width6980 \height9420
}¬}{{\NeXTGraphic Screen Shot 2020-06-02 at 1.50.37 PM.png \width6960 \height9620
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.50.44 PM.png \width6980 \height9420
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 1.50.37 PM.png \width6960 \height9620
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
In bottom panels above, also tried b transform to make space uniform:\
\
Expand All @@ -323,22 +333,22 @@ Note systematic downturn at high rotation vectors, due to boundary effects at ed
So just try to do KDE, dividing by (1/8pi^2) x sinc(v/2)^2. This corrects for downturn at high rotation vectors to give \'91true\'92 probability density per phase space volume, dp/domega.\
\
OK updated my KDE overlap code for circularization \'97 better agreement between overlap-based calcs and return-to-origin calcs, which used to be off by ~2x!:\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 2.17.55 PM.png \width11120 \height5380
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 2.17.43 PM.png \width10940 \height5460
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 2.18.10 PM.png \width10800 \height5420
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 2.17.24 PM.png \width11380 \height5380
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\
Though there\'92s still a systematic underestimation based on overlap. \
Expand All @@ -347,17 +357,67 @@ Is distribution too \'91spiky\'92 to be handled well by multivariate KDE? Lots o
* Check if re-centering helps?\
* Another cross-check \'97> create samples based on multi-jointed chain, where I know answer analytically from Fourier transforms.\
* Note that circularize to origin may also be biased to be high. Probably only way to check would be lots of compute and grid-based calculations, rather than KDE.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 Also tried isometric v->b transformation before KDE. Nope \'97 leads to even *worse* underestimation. So turn off that \'91isometric\'92 flag in
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
Also tried isometric v->b transformation before KDE. Nope \'97 leads to even *worse* underestimation. So turn off that \'91isometric\'92 flag in
\f3\fs20 get_C_eff_from_pts_6D
\fs24 \

\f2 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-02 at 2.31.28 PM.png \width10020 \height8040
}¬}\
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
Actually rerun above with lots of replicates\'96 after some bug fixes caught below \'97 its not too bad!\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.46.56 PM.png \width13440 \height6720
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\
\
For 10-mer \'97 actually not too bad \'97 biggest error is 1<\'97>9. \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.53.34 PM.png \width13280 \height6740
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ul 6 June, 2020\
just_so3_test.m\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ulnone How about just SO(3) part? Can we isolate the issue?\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ul \ulc2 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab560\pardirnatural\partightenfactor0
\cf0 \ulnone \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab560\pardirnatural\partightenfactor0
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.13.11 PM.png \width10180 \height8040
}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.12.53 PM.png \width10580 \height8020
}¬}\
\
Some variation, though look at axis limits \'97 not much (10-20%). \
\
Still, may be useful. Recompute 20-mer. Caught an error where sin(q/2)/(q/2) gives nan, throws off computation of last points (circularization of 20-mer forward or reverse, back to origin)\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.28.39 PM.png \width10380 \height7920
}¬}\
Note how off first point is for red. Can sort of see why \'97 trying to compare a very concentrated distribution (red, R) and diffuse distribution (blue). But discrepancy is
\i opposite
\i0 of problem in SE(3) where KDE overlap underestimates \'91true\'92 [?]. Also in different direction in repeat compared to original data.\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 {{\NeXTGraphic Screen Shot 2020-06-06 at 7.28.31 PM.png \width9620 \height7840
}¬}\
}
31 changes: 31 additions & 0 deletions runs/just_so3_test.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
% Try to do projection for a 'pseudochain' that lives only in rotation
% space SO(3)

%% The rotation part of the SE(3) rotation/translation transform
% is just m' = R*m, same SO(3). So I can use prebuilt chains or transforms
% for SE(3) if I just pull out the rotation vectors.
%load toyfold3_test.mat t R all_pts_f all_pts_r

Nmax = 20; NITER = 1000;
[all_pts_f, all_pts_r] = get_all_pts( Nmax, NITER, t, R );

%% Show overlap
figure(2)
N = 20;
just_SO3 = 1;
[C_eff_overlap_f, C_eff_overlap_r] = get_C_eff_overlap( N, all_pts_f, all_pts_r, just_SO3 ); clf;
plot( [C_eff_overlap_f; C_eff_overlap_r]' ); hold on
%plot( N,mean( C_eff(find(which_N==N)) ),'x' );
h = legend( 'C_eff_overlap_f','C_eff_overlap_r','overlap at 0'); set(h,'interpreter','none');
set(gca,'fontweight','bold'); xlabel( 'n steps for overlap'); ylabel('C_{eff} (M)');
title(sprintf('Forward/reverse overlap molarity for circularization of %d-mer',N) );
set(gcf, 'PaperPositionMode','auto','color','white');

%% take a look at the points.
figure(3)
pts = all_pts_f{19}(:,4:6);
plot3( pts(:,1), pts(:,2), pts(:,3), '.' ); axis equal; axis vis3d
hold on
pts = all_pts_r{1}(:,4:6);
plot3( pts(:,1), pts(:,2), pts(:,3), '.' ); axis equal; axis vis3d
legend( 'F 19-mer','R 1-mer');
Binary file added runs/just_so3_test.mat
Binary file not shown.
7 changes: 4 additions & 3 deletions runs/toyfold3_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Let's get some statistics, and estimate return probability
% (C_eff for circular RNA)
which_N = [2:9 10:5:40, 2:9 10:5:40, 50:10:100]; NITER = 100000;
which_N = [2:19 20:5:40, 2:19 20:5:40, 2:19, 2:19, 50:10:100]; NITER = 5000;
%which_N = [2:12, 2:12]; NITER = 100000;
C_eff = compute_C_eff_circular(NITER, which_N, t, R);
%%
Expand All @@ -30,12 +30,12 @@
[all_pts_f, all_pts_r] = get_all_pts( Nmax, NITER, t, R );

%% Show overlap
N = 10;
N = 5;
[C_eff_overlap_f, C_eff_overlap_r] = get_C_eff_overlap( N, all_pts_f, all_pts_r ); clf;
plot( [C_eff_overlap_f; C_eff_overlap_r]' ); hold on
plot( N,mean( C_eff(find(which_N==N)) ),'x' );
h = legend( 'C_eff_overlap_f','C_eff_overlap_r','overlap at 0'); set(h,'interpreter','none');
set(gca,'fontweight','bold'); xlabel( 'n steps for overlap'); ylabel('C_{eff} (M)');
set(gca,'fontweight','bold','xgrid','on'); xlabel( 'n steps for overlap'); ylabel('C_{eff} (M)');
title(sprintf('Forward/reverse overlap molarity for circularization of %d-mer',N) );

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand All @@ -49,4 +49,5 @@
plot( N_overlap, C_eff_overlap_halfway); hold on
set(gca,'fontweight','bold');xlabel('N');ylabel('C_{eff} (M)');
legend( 'circularize to origin','overlap of forward/reverse' );
set(gcf, 'PaperPositionMode','auto','color','white');

Binary file modified runs/toyfold3_test.mat
Binary file not shown.
25 changes: 16 additions & 9 deletions scripts/C_eff/get_C_eff_from_pts_6D.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
function C_eff = get_C_eff_from_pts_6D( pts_f, pts_r);
% C_eff = get_C_eff_from_pts_6D( pts_f, pts_r);
function C_eff = get_C_eff_from_pts_6D( pts_f, pts_r, just_SO3);
% C_eff = get_C_eff_from_pts_6D( pts_f, pts_r, just_SO3);
%
% INPUTS
% pts_f = sampled (x,y,z,v_x,v_y_v_z) for forward chain segment
% pts_r = sampled (x,y,z,v_x,v_y,v_z) for reverse chain segment
% just_SO3 = only look at rotation part of translation+rotation;
%
% OUTPUT
% C_eff = Effective molarity for chain closure between forward samples
Expand All @@ -12,29 +13,35 @@
% MATLAB's KDE estimator.
%
% (C) R. Das, Stanford University, 2020
if ~exist( 'just_SO3','var') just_SO3 = 0; end;

isometric = 0; % leads to systematic underestimation
if isometric
pts_f = convert_v_to_b(pts_f);
pts_r = convert_v_to_b(pts_r);
end
if just_SO3
pts_f = pts_f(:,4:6);
pts_r = pts_r(:,4:6);
end

s = get_kde_bandwidth( pts_f );

% phase space factor for integration with euler vectors
% WAIT -- should I apply this or the inverse of it?
% Think through this more.

p = mvksdensity( pts_f, pts_r,'Bandwidth',s);
p = mvksdensity( pts_f, pts_r,'Bandwidth',s);

if isometric
C_eff = mean(p)/(1/(8*pi^2)*6.022e23/1e27 );
else
% correct for phase space volume
v = sqrt( sum(pts_r(:,4:6).^2, 2) ); % rotation angle
v = sqrt( sum(pts_r(:,end-2:end).^2, 2) ); % rotation angle
w = (sin(v/2)./(v/2)).^2;
w( find( v == 0 ) ) = 1;
C_eff = mean(p./(w/(8*pi^2)))/ (6.022e23/1e27);
end
if just_SO3
% don't need to conversion to molarity.
C_eff = C_eff * (6.022e23/1e27);
end


function b = convert_v_to_b(v);
% isometric rescaling so uniform distribution in
Expand Down
12 changes: 7 additions & 5 deletions scripts/C_eff/get_C_eff_overlap.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [C_eff_overlap_f, C_eff_overlap_r] = get_C_eff_overlap( N, all_pts_f, all_pts_r );
function [C_eff_overlap_f, C_eff_overlap_r] = get_C_eff_overlap( N, all_pts_f, all_pts_r, just_SO3 );
% [C_eff_overlap_f, C_eff_overlap_r] = get_C_eff_overlap( N, all_pts_f, all_pts_r );
%
%
Expand All @@ -8,6 +8,7 @@
% [6 x NITER] points in 6D SE(3) space: x, y, z, v_x, v_y, v_z
% all_pts_r = cell of Nmax arrays of reverse samples, each with
% [6 x NITER] points in 6D SE(3) space: x, y, z, v_x, v_y, v_z
% just_SO3 = only look at rotation part of translation+rotation;
%
% Outputs
%
Expand All @@ -17,9 +18,10 @@
% reverse from 1, 2, ... N
%
% (C) R. Das, Stanford University 2020
if ~exist( 'just_SO3','var') just_SO3 = 0; end;
for i = 1:N-1
C_eff_overlap_f(i) = get_C_eff_from_pts_6D(all_pts_f{i},all_pts_r{N-i});
C_eff_overlap_r(i) = get_C_eff_from_pts_6D(all_pts_r{i},all_pts_f{N-i});
C_eff_overlap_f(i) = get_C_eff_from_pts_6D(all_pts_f{i},all_pts_r{N-i},just_SO3);
C_eff_overlap_r(i) = get_C_eff_from_pts_6D(all_pts_r{i},all_pts_f{N-i},just_SO3);
end
C_eff_overlap_f(N) = get_C_eff_from_pts_6D(all_pts_f{N},[0,0,0,0,0,0]);
C_eff_overlap_r(N) = get_C_eff_from_pts_6D(all_pts_r{N},[0,0,0,0,0,0]);
C_eff_overlap_f(N) = get_C_eff_from_pts_6D(all_pts_f{N},[0,0,0,0,0,0],just_SO3);
C_eff_overlap_r(N) = get_C_eff_from_pts_6D(all_pts_r{N},[0,0,0,0,0,0],just_SO3);

0 comments on commit 9e18c7e

Please sign in to comment.