Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GECKO 3.1.2 #358

Merged
merged 8 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions doc/src/geckomat/change_model/applyKcatConstraints.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,25 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0095 modRxns = extractAfter(model.ec.rxns,4);
0096 <span class="comment">% Map ec-reactions to model.rxns</span>
0097 [hasEc,~] = ismember(model.rxns,modRxns);
0098 [~,rxnIdx] = ismember(modRxns,model.rxns);
0099 hasEc = find(hasEc &amp; updateRxns);
0098 hasEc = find(hasEc &amp; updateRxns);
0099 [~,rxnIdx] = ismember(modRxns,model.rxns);
0100 <span class="keyword">for</span> i = 1:numel(hasEc)
0101 <span class="comment">% Get all isozymes per reaction</span>
0102 ecIdx = find(rxnIdx == hasEc(i));
0103 <span class="comment">% Multiply enzymes with their MW (they are then automatically</span>
0104 <span class="comment">% summed per reaction), and divide by their kcat, to get a vector</span>
0105 <span class="comment">% of MW/kcat values.</span>
0106 MWkcat = (model.ec.rxnEnzMat(ecIdx,:) * model.ec.mw) ./ model.ec.kcat(ecIdx);
0107 <span class="comment">% If kcat was zero, MWkcat is Inf. Correct back to zero</span>
0108 MWkcat(abs(MWkcat)==Inf)=0;
0109 <span class="comment">% Select the lowest MW/kcat (= most efficient), and convert to /hour</span>
0110 model.S(prot_pool_idx, hasEc(i)) = -min(MWkcat/3600);
0111 <span class="keyword">end</span>
0112 <span class="keyword">end</span>
0113 <span class="keyword">end</span>
0114</pre></div>
0103 <span class="comment">% ecIdx = strcmp(model.rxns(hasEc(i)),modRxns);</span>
0104 <span class="comment">% Multiply enzymes with their MW (they are then automatically</span>
0105 <span class="comment">% summed per reaction), and divide by their kcat, to get a vector</span>
0106 <span class="comment">% of MW/kcat values.</span>
0107 MWkcat = (model.ec.rxnEnzMat(ecIdx,:) * model.ec.mw) ./ model.ec.kcat(ecIdx);
0108 <span class="comment">% If kcat was zero, MWkcat is Inf. If no enzyme info was found,</span>
0109 <span class="comment">% MWkcat is NaN. Correct both back to zero</span>
0110 MWkcat(isinf(MWkcat) | isnan(MWkcat)) = 0;
0111 <span class="comment">% Select the lowest MW/kcat (= most efficient), and convert to /hour</span>
0112 model.S(prot_pool_idx, hasEc(i)) = -min(MWkcat/3600);
0113 <span class="keyword">end</span>
0114 <span class="keyword">end</span>
0115 <span class="keyword">end</span>
0116</pre></div>
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/src/geckomat/gather_kcats/runDLKcat.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0035 <span class="keyword">end</span>
0036
0037 disp(<span class="string">'Running DLKcat prediction, this may take many minutes, especially the first time.'</span>)
0038 status = system([<span class="string">'docker run --rm -v '</span> fullfile(params.path,<span class="string">'/data'</span>) <span class="string">':/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c &quot;python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv&quot;'</span>]);
0038 status = system([<span class="string">'docker run --rm -v &quot;'</span> fullfile(params.path,<span class="string">'/data'</span>) <span class="string">'&quot;:/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c &quot;python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv&quot;'</span>]);
0039
0040 <span class="keyword">if</span> status == 0 &amp;&amp; exist(fullfile(params.path,<span class="string">'data/DLKcatOutput.tsv'</span>))
0041 delete(fullfile(params.path,<span class="string">'/data/DLKcat.tsv'</span>));
Expand Down
261 changes: 135 additions & 126 deletions doc/src/geckomat/get_enzyme_data/loadDatabases.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/src/geckomat/limit_proteins/calculateFfactor.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0054 fileContent = textscan(fID,<span class="string">'%s %s %f'</span>,<span class="string">'delimiter'</span>,<span class="string">'\t'</span>,<span class="string">'HeaderLines'</span>,headerLines);
0055 genes = fileContent{2};
0056 <span class="comment">%Remove internal geneIDs modifiers</span>
0057 genes = regexprep(genes,<span class="string">'(\d{4}).'</span>,<span class="string">''</span>);
0057 genes = regexprep(genes,<span class="string">'^\d+\.'</span>,<span class="string">''</span>);
0058 level = fileContent{3};
0059 fclose(fID);
0060 [a,b] = ismember(genes,uniprotDB.genes);
Expand Down
10 changes: 6 additions & 4 deletions src/geckomat/change_model/applyKcatConstraints.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@
modRxns = extractAfter(model.ec.rxns,4);
% Map ec-reactions to model.rxns
[hasEc,~] = ismember(model.rxns,modRxns);
[~,rxnIdx] = ismember(modRxns,model.rxns);
hasEc = find(hasEc & updateRxns);
hasEc = find(hasEc & updateRxns);
[~,rxnIdx] = ismember(modRxns,model.rxns);
for i = 1:numel(hasEc)
% Get all isozymes per reaction
ecIdx = find(rxnIdx == hasEc(i));
% ecIdx = strcmp(model.rxns(hasEc(i)),modRxns);
% Multiply enzymes with their MW (they are then automatically
% summed per reaction), and divide by their kcat, to get a vector
% of MW/kcat values.
MWkcat = (model.ec.rxnEnzMat(ecIdx,:) * model.ec.mw) ./ model.ec.kcat(ecIdx);
% If kcat was zero, MWkcat is Inf. Correct back to zero
MWkcat(abs(MWkcat)==Inf)=0;
% If kcat was zero, MWkcat is Inf. If no enzyme info was found,
% MWkcat is NaN. Correct both back to zero
MWkcat(isinf(MWkcat) | isnan(MWkcat)) = 0;
% Select the lowest MW/kcat (= most efficient), and convert to /hour
model.S(prot_pool_idx, hasEc(i)) = -min(MWkcat/3600);
end
Expand Down
2 changes: 1 addition & 1 deletion src/geckomat/gather_kcats/runDLKcat.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function runDLKcat(modelAdapter)
end

disp('Running DLKcat prediction, this may take many minutes, especially the first time.')
status = system(['docker run --rm -v ' fullfile(params.path,'/data') ':/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"']);
status = system(['docker run --rm -v "' fullfile(params.path,'/data') '":/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"']);

if status == 0 && exist(fullfile(params.path,'data/DLKcatOutput.tsv'))
delete(fullfile(params.path,'/data/DLKcat.tsv'));
Expand Down
9 changes: 9 additions & 0 deletions src/geckomat/get_enzyme_data/loadDatabases.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
else
databases.uniprot = [];
end
if ~isempty(databases.uniprot)
[uniqueIDs,uniqueIdx] = unique(databases.uniprot.ID,'stable');
if numel(uniqueIDs) < numel(databases.uniprot.ID)
duplID = setdiff(1:numel(databases.uniprot.ID),uniqueIdx);
dispEM(['Duplicate entries are found for the following proteins. '...
'Manually curate the ''uniprot.tsv'' file, or adjust the uniprot parameters '...
'in the model adapter:'],true,databases.uniprot.ID(duplID));
end
end
end

%% KEGG
Expand Down
2 changes: 1 addition & 1 deletion src/geckomat/limit_proteins/calculateFfactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
fileContent = textscan(fID,'%s %s %f','delimiter','\t','HeaderLines',headerLines);
genes = fileContent{2};
%Remove internal geneIDs modifiers
genes = regexprep(genes,'(\d{4}).','');
genes = regexprep(genes,'^\d+\.','');
level = fileContent{3};
fclose(fID);
[a,b] = ismember(genes,uniprotDB.genes);
Expand Down
Loading