Skip to content

Commit

Permalink
doc: updateDocumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed Oct 25, 2021
1 parent 8dd899d commit 274eb29
Show file tree
Hide file tree
Showing 14 changed files with 2,202 additions and 1,976 deletions.
282 changes: 156 additions & 126 deletions doc/core/permuteModel.html

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions doc/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/io/SBMLFromExcel.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings)">exportModel</a> exportModel</li><li><a href="importExcelModel.html" class="code" title="function model=importExcelModel(fileName,removeExcMets,printWarnings,ignoreErrors)">importExcelModel</a> importExcelModel</li></ul>
<li><a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings,sortIds)">exportModel</a> exportModel</li><li><a href="importExcelModel.html" class="code" title="function model=importExcelModel(fileName,removeExcMets,printWarnings,ignoreErrors)">importExcelModel</a> importExcelModel</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
Expand Down Expand Up @@ -86,7 +86,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0026
0027 model=<a href="importExcelModel.html" class="code" title="function model=importExcelModel(fileName,removeExcMets,printWarnings,ignoreErrors)">importExcelModel</a>(fileName,false,printWarnings);
0028 printModelStats(model,printWarnings,false);
0029 <a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings)">exportModel</a>(model,outputFileName,toCOBRA,true);
0029 <a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings,sortIds)">exportModel</a>(model,outputFileName,toCOBRA,true);
0030 <span class="keyword">end</span></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>
Expand Down
163 changes: 79 additions & 84 deletions doc/io/exportForGit.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings)">exportModel</a> exportModel</li><li><a href="exportToExcelFormat.html" class="code" title="function exportToExcelFormat(model,filename)">exportToExcelFormat</a> exportToExcelFormat</li><li><a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a> getToolboxVersion</li><li><a href="writeYaml.html" class="code" title="function writeYaml(model,name,preserveQuotes,sortIds)">writeYaml</a> writeYaml</li></ul>
<li><a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings,sortIds)">exportModel</a> exportModel</li><li><a href="exportToExcelFormat.html" class="code" title="function exportToExcelFormat(model,filename,sortIds)">exportToExcelFormat</a> exportToExcelFormat</li><li><a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a> getToolboxVersion</li><li><a href="sortIdentifiers.html" class="code" title="function newModel = sortIdentifiers(model)">sortIdentifiers</a> exportModel</li><li><a href="writeYaml.html" class="code" title="function writeYaml(model,name,preserveQuotes,sortIds)">writeYaml</a> writeYaml</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
Expand Down Expand Up @@ -114,98 +114,93 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0047 <span class="keyword">end</span>
0048
0049 <span class="comment">%Sort reactions, metabolites and genes alphabetically</span>
0050 [~,I]=sort(model.rxns);
0051 model=permuteModel(model,I,<span class="string">'rxns'</span>);
0052 [~,I]=sort(model.mets);
0053 model=permuteModel(model,I,<span class="string">'mets'</span>);
0054 [~,I]=sort(model.genes);
0055 model=permuteModel(model,I,<span class="string">'genes'</span>);
0056
0057 <span class="comment">%Get versions or commits of toolboxes:</span>
0058 RAVENver = <a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a>(<span class="string">'RAVEN'</span>,<span class="string">'ravenCobraWrapper.m'</span>,masterFlag);
0059 COBRAver = <a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a>(<span class="string">'COBRA'</span>,<span class="string">'initCobraToolbox.m'</span>,masterFlag);
0060
0061 <span class="comment">%Retrieve libSBML version:</span>
0062 <span class="keyword">try</span> <span class="comment">% 5.17.0 and newer</span>
0063 libSBMLver=OutputSBML;
0050 model=<a href="sortIdentifiers.html" class="code" title="function newModel = sortIdentifiers(model)">sortIdentifiers</a>(model);
0051
0052 <span class="comment">%Get versions or commits of toolboxes:</span>
0053 RAVENver = <a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a>(<span class="string">'RAVEN'</span>,<span class="string">'ravenCobraWrapper.m'</span>,masterFlag);
0054 COBRAver = <a href="getToolboxVersion.html" class="code" title="function version = getToolboxVersion(toolbox,fileID,masterFlag)">getToolboxVersion</a>(<span class="string">'COBRA'</span>,<span class="string">'initCobraToolbox.m'</span>,masterFlag);
0055
0056 <span class="comment">%Retrieve libSBML version:</span>
0057 <span class="keyword">try</span> <span class="comment">% 5.17.0 and newer</span>
0058 libSBMLver=OutputSBML;
0059 libSBMLver=libSBMLver.libSBML_version_string;
0060 <span class="keyword">catch</span> <span class="comment">% before 5.17.0</span>
0061 fid = fopen(<span class="string">'tempModelForLibSBMLversion.xml'</span>,<span class="string">'w+'</span>);
0062 fclose(fid);
0063 evalc(<span class="string">'[~,~,libSBMLver]=TranslateSBML(''tempModelForLibSBMLversion.xml'',0,0)'</span>);
0064 libSBMLver=libSBMLver.libSBML_version_string;
0065 <span class="keyword">catch</span> <span class="comment">% before 5.17.0</span>
0066 fid = fopen(<span class="string">'tempModelForLibSBMLversion.xml'</span>,<span class="string">'w+'</span>);
0067 fclose(fid);
0068 evalc(<span class="string">'[~,~,libSBMLver]=TranslateSBML(''tempModelForLibSBMLversion.xml'',0,0)'</span>);
0069 libSBMLver=libSBMLver.libSBML_version_string;
0070 delete(<span class="string">'tempModelForLibSBMLversion.xml'</span>);
0071 <span class="keyword">end</span>
0072
0073 <span class="comment">% Make models folder, no warnings if folder already exists</span>
0074 <span class="keyword">if</span> subDirs
0075 path=fullfile(path,<span class="string">'model'</span>);
0076 filePath=strcat(path,filesep,{<span class="string">'txt'</span>,<span class="string">'yml'</span>,<span class="string">'mat'</span>,<span class="string">'xlsx'</span>,<span class="string">'xml'</span>});
0077 [~,~,~]=mkdir(path);
0078 <span class="keyword">for</span> i = 1:length(formats)
0079 [~,~,~]=mkdir(fullfile(path,formats{i}));
0080 <span class="keyword">end</span>
0081 <span class="keyword">else</span>
0082 filePath=cell(1,5); filePath(:)={path};
0083 <span class="keyword">end</span>
0084
0085
0086 <span class="comment">% Write TXT format</span>
0087 <span class="keyword">if</span> ismember(<span class="string">'txt'</span>, formats)
0088 fid=fopen(fullfile(filePath{1},strcat(prefix,<span class="string">'.txt'</span>)),<span class="string">'w'</span>);
0089 eqns=constructEquations(model,model.rxns,false,false,false,true);
0090 eqns=strrep(eqns,<span class="string">' =&gt; '</span>,<span class="string">' -&gt; '</span>);
0091 eqns=strrep(eqns,<span class="string">' &lt;=&gt; '</span>,<span class="string">' &lt;=&gt; '</span>);
0092 eqns=regexprep(eqns,<span class="string">'&gt; $'</span>,<span class="string">'&gt;'</span>);
0093 grRules=regexprep(model.grRules,<span class="string">'\((?!\()'</span>,<span class="string">'( '</span>);
0094 grRules=regexprep(grRules,<span class="string">'(?&lt;!\))\)'</span>,<span class="string">' )'</span>);
0095 fprintf(fid, <span class="string">'Rxn name\tFormula\tGene-reaction association\tLB\tUB\tObjective\n'</span>);
0096 <span class="keyword">for</span> i = 1:numel(model.rxns)
0097 fprintf(fid, <span class="string">'%s\t'</span>, model.rxns{i});
0098 fprintf(fid, <span class="string">'%s \t'</span>, eqns{i});
0099 fprintf(fid, <span class="string">'%s\t'</span>, grRules{i});
0100 fprintf(fid, <span class="string">'%6.2f\t%6.2f\t%6.2f\n'</span>, model.lb(i), model.ub(i), model.c(i));
0101 <span class="keyword">end</span>
0102 fclose(fid);
0065 delete(<span class="string">'tempModelForLibSBMLversion.xml'</span>);
0066 <span class="keyword">end</span>
0067
0068 <span class="comment">% Make models folder, no warnings if folder already exists</span>
0069 <span class="keyword">if</span> subDirs
0070 path=fullfile(path,<span class="string">'model'</span>);
0071 filePath=strcat(path,filesep,{<span class="string">'txt'</span>,<span class="string">'yml'</span>,<span class="string">'mat'</span>,<span class="string">'xlsx'</span>,<span class="string">'xml'</span>});
0072 [~,~,~]=mkdir(path);
0073 <span class="keyword">for</span> i = 1:length(formats)
0074 [~,~,~]=mkdir(fullfile(path,formats{i}));
0075 <span class="keyword">end</span>
0076 <span class="keyword">else</span>
0077 filePath=cell(1,5); filePath(:)={path};
0078 <span class="keyword">end</span>
0079
0080
0081 <span class="comment">% Write TXT format</span>
0082 <span class="keyword">if</span> ismember(<span class="string">'txt'</span>, formats)
0083 fid=fopen(fullfile(filePath{1},strcat(prefix,<span class="string">'.txt'</span>)),<span class="string">'w'</span>);
0084 eqns=constructEquations(model,model.rxns,false,false,false,true);
0085 eqns=strrep(eqns,<span class="string">' =&gt; '</span>,<span class="string">' -&gt; '</span>);
0086 eqns=strrep(eqns,<span class="string">' &lt;=&gt; '</span>,<span class="string">' &lt;=&gt; '</span>);
0087 eqns=regexprep(eqns,<span class="string">'&gt; $'</span>,<span class="string">'&gt;'</span>);
0088 grRules=regexprep(model.grRules,<span class="string">'\((?!\()'</span>,<span class="string">'( '</span>);
0089 grRules=regexprep(grRules,<span class="string">'(?&lt;!\))\)'</span>,<span class="string">' )'</span>);
0090 fprintf(fid, <span class="string">'Rxn name\tFormula\tGene-reaction association\tLB\tUB\tObjective\n'</span>);
0091 <span class="keyword">for</span> i = 1:numel(model.rxns)
0092 fprintf(fid, <span class="string">'%s\t'</span>, model.rxns{i});
0093 fprintf(fid, <span class="string">'%s \t'</span>, eqns{i});
0094 fprintf(fid, <span class="string">'%s\t'</span>, grRules{i});
0095 fprintf(fid, <span class="string">'%6.2f\t%6.2f\t%6.2f\n'</span>, model.lb(i), model.ub(i), model.c(i));
0096 <span class="keyword">end</span>
0097 fclose(fid);
0098 <span class="keyword">end</span>
0099
0100 <span class="comment">% Write YML format</span>
0101 <span class="keyword">if</span> ismember(<span class="string">'yml'</span>, formats)
0102 <a href="writeYaml.html" class="code" title="function writeYaml(model,name,preserveQuotes,sortIds)">writeYaml</a>(model,fullfile(filePath{2},strcat(prefix,<span class="string">'.yml'</span>)));
0103 <span class="keyword">end</span>
0104
0105 <span class="comment">% Write YML format</span>
0106 <span class="keyword">if</span> ismember(<span class="string">'yml'</span>, formats)
0107 <a href="writeYaml.html" class="code" title="function writeYaml(model,name,preserveQuotes,sortIds)">writeYaml</a>(model,fullfile(filePath{2},strcat(prefix,<span class="string">'.yml'</span>)));
0105 <span class="comment">% Write MAT format</span>
0106 <span class="keyword">if</span> ismember(<span class="string">'mat'</span>, formats)
0107 save(fullfile(filePath{3},strcat(prefix,<span class="string">'.mat'</span>)),<span class="string">'model'</span>);
0108 <span class="keyword">end</span>
0109
0110 <span class="comment">% Write MAT format</span>
0111 <span class="keyword">if</span> ismember(<span class="string">'mat'</span>, formats)
0112 save(fullfile(filePath{3},strcat(prefix,<span class="string">'.mat'</span>)),<span class="string">'model'</span>);
0110 <span class="comment">% Write XLSX format</span>
0111 <span class="keyword">if</span> ismember(<span class="string">'xlsx'</span>, formats)
0112 <a href="exportToExcelFormat.html" class="code" title="function exportToExcelFormat(model,filename,sortIds)">exportToExcelFormat</a>(model,fullfile(filePath{4},strcat(prefix,<span class="string">'.xlsx'</span>)));
0113 <span class="keyword">end</span>
0114
0115 <span class="comment">% Write XLSX format</span>
0116 <span class="keyword">if</span> ismember(<span class="string">'xlsx'</span>, formats)
0117 <a href="exportToExcelFormat.html" class="code" title="function exportToExcelFormat(model,filename)">exportToExcelFormat</a>(model,fullfile(filePath{4},strcat(prefix,<span class="string">'.xlsx'</span>)));
0115 <span class="comment">% Write XML format</span>
0116 <span class="keyword">if</span> ismember(<span class="string">'xml'</span>, formats)
0117 <a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings,sortIds)">exportModel</a>(model,fullfile(filePath{5},strcat(prefix,<span class="string">'.xml'</span>)));
0118 <span class="keyword">end</span>
0119
0120 <span class="comment">% Write XML format</span>
0121 <span class="keyword">if</span> ismember(<span class="string">'xml'</span>, formats)
0122 <a href="exportModel.html" class="code" title="function exportModel(model,fileName,exportGeneComplexes,supressWarnings)">exportModel</a>(model,fullfile(filePath{5},strcat(prefix,<span class="string">'.xml'</span>)));
0123 <span class="keyword">end</span>
0124
0125 <span class="comment">%Save file with versions:</span>
0126 fid = fopen(fullfile(path,<span class="string">'dependencies.txt'</span>),<span class="string">'wt'</span>);
0127 fprintf(fid,[<span class="string">'MATLAB\t'</span> version <span class="string">'\n'</span>]);
0128 fprintf(fid,[<span class="string">'libSBML\t'</span> libSBMLver <span class="string">'\n'</span>]);
0129 fprintf(fid,[<span class="string">'RAVEN_toolbox\t'</span> RAVENver <span class="string">'\n'</span>]);
0130 <span class="keyword">if</span> ~isempty(COBRAver)
0131 fprintf(fid,[<span class="string">'COBRA_toolbox\t'</span> COBRAver <span class="string">'\n'</span>]);
0132 <span class="keyword">end</span>
0133 <span class="keyword">if</span> isfield(model,<span class="string">'modelVersion'</span>)
0134 fields = fieldnames(model.modelVersion);
0135 <span class="keyword">for</span> i = 1:length(fields)
0136 value = model.modelVersion.(fields{i});
0137 fprintf(fid,[fields{i} <span class="string">'\t'</span> num2str(value) <span class="string">'\n'</span>]);
0138 <span class="keyword">end</span>
0139 <span class="keyword">end</span>
0140 fclose(fid);
0141 <span class="keyword">end</span></pre></div>
0120 <span class="comment">%Save file with versions:</span>
0121 fid = fopen(fullfile(path,<span class="string">'dependencies.txt'</span>),<span class="string">'wt'</span>);
0122 fprintf(fid,[<span class="string">'MATLAB\t'</span> version <span class="string">'\n'</span>]);
0123 fprintf(fid,[<span class="string">'libSBML\t'</span> libSBMLver <span class="string">'\n'</span>]);
0124 fprintf(fid,[<span class="string">'RAVEN_toolbox\t'</span> RAVENver <span class="string">'\n'</span>]);
0125 <span class="keyword">if</span> ~isempty(COBRAver)
0126 fprintf(fid,[<span class="string">'COBRA_toolbox\t'</span> COBRAver <span class="string">'\n'</span>]);
0127 <span class="keyword">end</span>
0128 <span class="keyword">if</span> isfield(model,<span class="string">'modelVersion'</span>)
0129 fields = fieldnames(model.modelVersion);
0130 <span class="keyword">for</span> i = 1:length(fields)
0131 value = model.modelVersion.(fields{i});
0132 fprintf(fid,[fields{i} <span class="string">'\t'</span> num2str(value) <span class="string">'\n'</span>]);
0133 <span class="keyword">end</span>
0134 <span class="keyword">end</span>
0135 fclose(fid);
0136 <span class="keyword">end</span></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>
Loading

0 comments on commit 274eb29

Please sign in to comment.