-
Notifications
You must be signed in to change notification settings - Fork 1
/
uniquestrains.m
25 lines (22 loc) · 912 Bytes
/
uniquestrains.m
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
function [strainset,strainsetind]=uniquestrains(model,strains)
% function [strainset,strainsetind]=uniquestrainset(model,strains)
%
% Identify the unique strain sets
% Laurence Yang. Aug 5, 2010
nstrains = length(strains);
strainsetind = 1:nstrains;
[mods,straindef]=uniquemods(model,strains);
% If 2 identical strains are found, then they may still differ in terms of
% their quantitative vl and vu values. So, keep the better strain.
for i=1:nstrains-1
for j= i+1:nstrains
if isempty(setxor(straindef{i},straindef{j})) % If both strains have identical activevl & activevu
strainsetind(j)=strainsetind(i);
% Replace the i strain with the better one found so far
if strains{j}.vprod > strains{i}.vprod
strains(i) = strains(j);
end
end
end
end
strainset=strains(unique(strainsetind));