-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisolated_base_trips.m
More file actions
26 lines (20 loc) · 849 Bytes
/
isolated_base_trips.m
File metadata and controls
26 lines (20 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function base_trips = isolated_base_trips(arrayToBeChecked)
% First check if any of the new array entries are in the already checked Array.
array = arrayToBeChecked;
% TODO: NEED TO ADD CODE TO THE FIRST PART (once the initial array is generated)
% Next, check if there are any repeated base pairs in the new array.
x = sort(array,2);
outarray = [1,1,1];
% There has to be a more elegant way to do this in terms of vector notation
% TODO: Figure the above out ...
for i=1:size(x,1)
if isempty(intersect(intersect(factor(x(i,1)),factor(x(i,2))),factor(x(i,3))))
% TODO: Preallocate memory for outarray ???
[tf, index]=ismember(outarray,[x(i,1),x(i,2),x(i,3)],'rows');
if (sum(tf) == 0)
outarray=vertcat(outarray,[x(i,1),x(i,2),x(i,3)]);
end;
end
end
outarray(1,:)= [];
base_trips = outarray;