diff --git a/doc/io/exportModel.html b/doc/io/exportModel.html index dfd36cd4..36c9f1f8 100644 --- a/doc/io/exportModel.html +++ b/doc/io/exportModel.html @@ -200,7 +200,7 @@

SOURCE CODE ^%Generate an empty SBML structure 0140 modelSBML=getSBMLStructure(sbmlLevel,sbmlVersion,sbmlPackages,sbmlPackageVersions); 0141 modelSBML.metaid=model.id; -0142 modelSBML.id=model.id; +0142 modelSBML.id=regexprep(model.id,'([^0-9_a-zA-Z])','__${num2str($1+0)}__'); 0143 modelSBML.name=model.name; 0144 0145 if isfield(model,'annotation') diff --git a/doc/struct_conversion/standardizeModelFieldOrder.html b/doc/struct_conversion/standardizeModelFieldOrder.html index 833e395b..51855324 100644 --- a/doc/struct_conversion/standardizeModelFieldOrder.html +++ b/doc/struct_conversion/standardizeModelFieldOrder.html @@ -51,7 +51,9 @@

CROSS-REFERENCE INFORMATION ^
 <li><a href=ravenCobraWrapper ravenCobraWrapper - +

SUBFUNCTIONS ^

+

SOURCE CODE ^

0001 function orderedModel=standardizeModelFieldOrder(model)
@@ -86,9 +88,36 @@ 

SOURCE CODE ^columnVector(order);columnVector(remainingOrder)]; 0034 orderedModel = orderfields(model,overallOrder); -0035 end

+0035 end +0036 +0037 function vecT = columnVector(vec) +0038 % Converts a vector to a column vector +0039 % +0040 % USAGE: +0041 % +0042 % vecT = columnVector(vec) +0043 % +0044 % INPUT: +0045 % vec: a vector +0046 % +0047 % OUTPUT: +0048 % vecT: a column vector +0049 % +0050 % .. Authors: +0051 % - Original file: Markus Herrgard +0052 % - Minor changes: Laurent Heirendt January 2017 +0053 % - Copied from COBRA Toolbox May 2022 +0054 +0055 [n, m] = size(vec); +0056 +0057 if (m ~= 1 && n < m) || n == 1 +0058 vecT = vec'; +0059 else +0060 vecT = vec; +0061 end +0062 end
Generated by m2html © 2005
\ No newline at end of file diff --git a/doc/testing/unit_tests/mafftTests.html b/doc/testing/unit_tests/mafftTests.html index 4a31ad61..96a9f1fc 100644 --- a/doc/testing/unit_tests/mafftTests.html +++ b/doc/testing/unit_tests/mafftTests.html @@ -80,39 +80,38 @@

SOURCE CODE ^'test_data','yeast_galactosidases.fa'),tmpDIR); 0035 -0036 % Define WSL paths -0037 wslPath.fastaFile=getWSLpath([tmpDIR filesep 'yeast_galactosidases.fa']); -0038 wslPath.outFile=getWSLpath(outFile); -0039 wslPath.mafft=getWSLpath(fullfile(ravenPath,'software','mafft','mafft-linux64','mafft.bat')); -0040 -0041 %% -0042 %Run protein multi-sequence alignment with MAFFT -0043 if ismac -0044 [~, ~]=system(['"' fullfile(ravenPath,'software','mafft','mafft-mac','mafft.bat') '" --auto --anysymbol --thread "' num2str(cores) '" "' fullfile(tmpDIR, 'yeast_galactosidases.fa') '" > "' outFile '"']); -0045 elseif isunix -0046 [~, ~]=system(['"' fullfile(ravenPath,'software','mafft','mafft-linux64','mafft.bat') '" --auto --anysymbol --thread "' num2str(cores) '" "' fullfile(tmpDIR, 'yeast_galactosidases.fa') '" > "' outFile '"']); -0047 elseif ispc -0048 [~, ~]=system(['wsl "' wslPath.mafft '" --auto --anysymbol --quiet --thread "' num2str(cores) '" --out "' wslPath.outFile '" "' wslPath.fastaFile '"']); -0049 end -0050 -0051 %% -0052 %Open actual MAFFT results file -0053 actMafftOutput=importdata(fullfile(outFile)); -0054 -0055 %Remove the old tempfiles -0056 delete([outFile '*']); -0057 -0058 %Remove temporary folder, since testing is finished -0059 [~, ~]=system(['rm "' tmpDIR '" -r']); -0060 -0061 %% -0062 %Check 1a: Check if files for MAFFT results are the same -0063 verifyEqual(testCase,actMafftOutput,expCdhitMafftOutput); -0064 -0065 %Check 1b: Change actual MAFFT results file and check if test fails -0066 actMafftOutput='abc'; -0067 verifyNotEqual(testCase,actMafftOutput,expCdhitMafftOutput); -0068 end +0036 %% +0037 %Run protein multi-sequence alignment with MAFFT +0038 if ismac +0039 [~, ~]=system(['"' fullfile(ravenPath,'software','mafft','mafft-mac','mafft.bat') '" --auto --anysymbol --thread "' num2str(cores) '" "' fullfile(tmpDIR, 'yeast_galactosidases.fa') '" > "' outFile '"']); +0040 elseif isunix +0041 [~, ~]=system(['"' fullfile(ravenPath,'software','mafft','mafft-linux64','mafft.bat') '" --auto --anysymbol --thread "' num2str(cores) '" "' fullfile(tmpDIR, 'yeast_galactosidases.fa') '" > "' outFile '"']); +0042 elseif ispc +0043 % Define WSL paths +0044 wslPath.fastaFile=getWSLpath([tmpDIR filesep 'yeast_galactosidases.fa']); +0045 wslPath.outFile=getWSLpath(outFile); +0046 wslPath.mafft=getWSLpath(fullfile(ravenPath,'software','mafft','mafft-linux64','mafft.bat')); +0047 [~, ~]=system(['wsl "' wslPath.mafft '" --auto --anysymbol --quiet --thread "' num2str(cores) '" --out "' wslPath.outFile '" "' wslPath.fastaFile '"']); +0048 end +0049 +0050 %% +0051 %Open actual MAFFT results file +0052 actMafftOutput=importdata(fullfile(outFile)); +0053 +0054 %Remove the old tempfiles +0055 delete([outFile '*']); +0056 +0057 %Remove temporary folder, since testing is finished +0058 [~, ~]=system(['rm "' tmpDIR '" -r']); +0059 +0060 %% +0061 %Check 1a: Check if files for MAFFT results are the same +0062 verifyEqual(testCase,actMafftOutput,expCdhitMafftOutput); +0063 +0064 %Check 1b: Change actual MAFFT results file and check if test fails +0065 actMafftOutput='abc'; +0066 verifyNotEqual(testCase,actMafftOutput,expCdhitMafftOutput); +0067 end
Generated by m2html © 2005
\ No newline at end of file diff --git a/io/exportModel.m b/io/exportModel.m index 97d835b4..a4fd0129 100755 --- a/io/exportModel.m +++ b/io/exportModel.m @@ -139,7 +139,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings,sortIds) %Generate an empty SBML structure modelSBML=getSBMLStructure(sbmlLevel,sbmlVersion,sbmlPackages,sbmlPackageVersions); modelSBML.metaid=model.id; -modelSBML.id=model.id; +modelSBML.id=regexprep(model.id,'([^0-9_a-zA-Z])','__${num2str($1+0)}__'); modelSBML.name=model.name; if isfield(model,'annotation')