Skip to content

Commit

Permalink
fix: calculateFfactor can take protData input
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed May 26, 2024
1 parent 5e9ca54 commit 5f3c14d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/geckomat/limit_proteins/calculateFfactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,19 @@
uniprot = uniprotDB.ID(b(a));
level(~a) = [];
clear protData
protData.uniprot = uniprot;
protData.uniprotIDs = uniprot;
protData.level = level;
% Get MW and abundance (unit does not matter, f is fraction)
[~,idx] = ismember(protData.uniprotIDs,uniprotDB.ID);
protData.MW = uniprotDB.MW(idx);
protData.abundances = protData.level .* protData.MW;
end

% Get MW and abundance (unit does not matter, f is fraction)
[~,idx] = ismember(protData.uniprot,uniprotDB.ID);
protData.MW = uniprotDB.MW(idx);
protData.abundance = protData.level .* protData.MW;

totalProt = sum(protData.abundance);
totalProt = sum(protData.abundances);

% Get enzymes in model
enzymesInModel = ismember(protData.uniprot,enzymes);
totalEnz = sum(protData.abundance(enzymesInModel));
enzymesInModel = ismember(protData.uniprotIDs,enzymes);
totalEnz = sum(protData.abundances(enzymesInModel));

f = totalEnz/totalProt;
end

0 comments on commit 5f3c14d

Please sign in to comment.