Skip to content

Commit

Permalink
Merge pull request #356 from SysBioChalmers/fix/exprotModel
Browse files Browse the repository at this point in the history
fix: disable adding prefix 'M_' and 'R_' in exprotModel function
  • Loading branch information
haowang-bioinfo authored Aug 12, 2021
2 parents aeed2e3 + 1c0e32f commit 754ba54
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions io/exportModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
end

if isfield(modelSBML.compartment,'metaid')
if ~isnan(str2double(model.comps(i)))
EM='The compartment IDs are in numeric format. For the compliance with SBML specifications, compartment IDs will be preceded with "c_" string';
dispEM(EM,false);
model.comps(i)=strcat('c_',model.comps(i));
end
modelSBML.compartment(i).metaid=model.comps{i};
end
%Prepare Miriam strings
Expand Down Expand Up @@ -281,13 +276,13 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
end

if isfield(modelSBML.species,'metaid')
modelSBML.species(i).metaid=['M_' model.mets{i}];
modelSBML.species(i).metaid=model.mets{i};
end
if isfield(modelSBML.species, 'name')
modelSBML.species(i).name=model.metNames{i};
end
if isfield(modelSBML.species, 'id')
modelSBML.species(i).id=['M_' model.mets{i}];
modelSBML.species(i).id=model.mets{i};
end
if isfield(modelSBML.species, 'compartment')
modelSBML.species(i).compartment=model.comps{model.metComps(i)};
Expand Down Expand Up @@ -329,7 +324,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
end
end
if ~isempty(model.metMiriams{i}) || hasInchi==true
modelSBML.species(i).annotation=['<annotation><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/"><rdf:Description rdf:about="#meta_M_' model.mets{i} '">'];
modelSBML.species(i).annotation=['<annotation><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/"><rdf:Description rdf:about="#meta_' model.mets{i} '">'];
modelSBML.species(i).annotation=[modelSBML.species(i).annotation '<bqbiol:is><rdf:Bag>'];
if ~isempty(model.metMiriams{i})
modelSBML.species(i).annotation=[modelSBML.species(i).annotation getMiriam(model.metMiriams{i})];
Expand Down Expand Up @@ -475,7 +470,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
end

if isfield(modelSBML.reaction,'metaid')
modelSBML.reaction(i).metaid=['R_' model.rxns{i}];
modelSBML.reaction(i).metaid=model.rxns{i};
end

%Export notes information
Expand Down Expand Up @@ -507,7 +502,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)

%Export annotation information from rxnMiriams
if (~isempty(model.rxnMiriams{i}) && isfield(modelSBML.reaction(i),'annotation')) || ~isempty(model.eccodes{i})
modelSBML.reaction(i).annotation=['<annotation><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/"><rdf:Description rdf:about="#meta_R_' model.rxns{i} '">'];
modelSBML.reaction(i).annotation=['<annotation><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/"><rdf:Description rdf:about="#meta_' model.rxns{i} '">'];
modelSBML.reaction(i).annotation=[modelSBML.reaction(i).annotation '<bqbiol:is><rdf:Bag>'];
if ~isempty(model.eccodes{i})
eccodes=regexp(model.eccodes{i},';','split');
Expand All @@ -522,7 +517,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
modelSBML.reaction(i).name=model.rxnNames{i};
end
if isfield(modelSBML.reaction, 'id')
modelSBML.reaction(i).id=['R_' model.rxns{i}];
modelSBML.reaction(i).id=model.rxns{i};
end

%Add the information about reactants and products
Expand Down Expand Up @@ -574,7 +569,7 @@ function exportModel(model,fileName,exportGeneComplexes,supressWarnings)
modelSBML.groups_group.sboTerm = 633;
tmpStruct=modelSBML.groups_group;

rxns=strcat('R_',model.rxns);
rxns=model.rxns;
if ~any(cellfun(@iscell,model.subSystems))
if ~any(~cellfun(@isempty,model.subSystems))
subSystems = {};
Expand Down

0 comments on commit 754ba54

Please sign in to comment.