-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkogene.m
More file actions
24 lines (19 loc) · 735 Bytes
/
Copy pathkogene.m
File metadata and controls
24 lines (19 loc) · 735 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
function treestrs=kogene(treestrs, knockout)
%KOGENE Utility function to knock out "genes" from a cell array of GP expressions.
%
% TREESTRS=KOGENE(TREESTRS, KNOCKOUT) removes genes from the cell array
% TREESTRS with a boolean vector KNOCKOUT which must be the same length
% as TREESTRS. GENES corresponding to a an entry of 'true' are removed.
%
%
% (c) Dominic Searson 2009
%
% v1.0
if numel(knockout)~=numel(treestrs)
error('Knockout must be a vector the same length as the number of genes in the supplied individual');
end
knockout=boolean(knockout);
treestrs(knockout)=[];
if isempty(treestrs)
error('Cannot perform knockout. There are no genes left in the selected individual.');
end