Skip to content

Commit

Permalink
fix: use readYAMLmodel and writeYAMLmodel in funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed Dec 23, 2024
1 parent 1a562ce commit 91a6e78
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion code/DepMapGeneEss/PrepDepMapData.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
save('data/arrayDataDepMap.mat','arrayDataDepMap');

%Generate ftINIT prepData - only needs to be done once. Can take up to an hour to run
model = importYaml('../../model/Human-GEM.yml');
model = readYAMLmodel('../../model/Human-GEM.yml');
[model.grRules, skipped] = simplifyGrRules(model.grRules, true);%takes a few minutes to run
prepData = prepHumanModelForftINIT(model, true, '../../data/metabolicTasks/metabolicTasks_Essential.txt', '../../model/reactions.tsv');
save('data/prepDataGeneSymbols.mat', 'prepData')
2 changes: 1 addition & 1 deletion code/modelCuration/GlycolysisCuration.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
rxnStruct = importTsvFile('../../data/modelCuration/addRxnGly_20230414.tsv');
MetStruct = importTsvFile('../../data/modelCuration/addMetGly_20230414.tsv');

model = importYaml('Human-GEM.yml');
model = readYAMLmodel('Human-GEM.yml');

rxnsToAdd.rxns = rxnStruct.rxnID;
rxnsToAdd.eccodes = rxnStruct.ECNumber;
Expand Down
4 changes: 2 additions & 2 deletions code/modelCuration/addAAnewRxn20230518.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
rxnStruct = importTsvFile('../../data/modelCuration/addRxnAA_20230518.tsv');
MetStruct = importTsvFile('../../data/modelCuration/addMetAA_20230518.tsv');

model = importYaml('Human-GEM.yml');
model = readYAMLmodel('Human-GEM.yml');

rxnsToAdd.rxns = rxnStruct.rxnID;
rxnsToAdd.eccodes = rxnStruct.ECNumber;
Expand Down Expand Up @@ -91,4 +91,4 @@
structure.rxnRetired = [structure.rxnRetired;rxnStruct.emptyID(idx,1) ];

exportTsvFile(structure, '../../model/reactions.tsv')
exportYaml(newModel, 'Human-GEM.yml');
writeYAMLmodel(newModel, 'Human-GEM.yml');
4 changes: 2 additions & 2 deletions code/modelCuration/addRxnACOD1_20221102.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% load model and new reaction info
ihuman = importYaml('../../model/Human-GEM.yml');
ihuman = readYAMLmodel('../../model/Human-GEM.yml');
rxnsToAdd = importTsvFile('../../data/modelCuration/addRxnACOD1_20221102.tsv');

% add new genes to Human-GEM
Expand Down Expand Up @@ -28,6 +28,6 @@
end

% update yaml model and reaction association file
exportYaml(newGEM, '../../model/Human-GEM.yml');
writeYAMLmodel(newGEM, '../../model/Human-GEM.yml');
exportTsvFile(rxnAssoc,'../../model/reactions.tsv');

4 changes: 2 additions & 2 deletions code/modelCuration/changeCompAbbrevs.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
modelname = 'Human-GEM';

% load model and other data files
model = importYaml(fullfile('..', '..', 'model', [modelname '.yml']));
model = readYAMLmodel(fullfile('..', '..', 'model', [modelname '.yml']));
metAssoc = importTsvFile(fullfile('..', '..', 'model', 'metabolites.tsv'));
metAssoc_table = struct2table(metAssoc);
metsDep = importTsvFile(fullfile('..', '..', 'data', 'deprecatedIdentifiers', 'deprecatedMetabolites.tsv'));
Expand All @@ -30,7 +30,7 @@
metAssoc.mets = regexprep(metAssoc.mets, 'p$', 'x');

% export the new model and files
exportYaml(model, fullfile('..', '..', 'model', [modelname '.yml']));
writeYAMLmodel(model, fullfile('..', '..', 'model', [modelname '.yml']));
exportTsvFile(metAssoc, fullfile('..', '..', 'model', 'metabolites.tsv'));
exportTsvFile(metsDep_table, fullfile('..', '..', 'data', 'deprecatedIdentifiers', 'deprecatedMetabolites.tsv'));

Expand Down
4 changes: 2 additions & 2 deletions code/modelCuration/removeDuplicateRxns_issue345.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


% load Human-GEM
model = importYaml('../../model/Human-GEM.yml');
model = readYAMLmodel('../../model/Human-GEM.yml');


% specify pairs of duplicate reactions, where reactions in first column are
Expand Down Expand Up @@ -107,7 +107,7 @@

% delete reactions from model and annotation file
model = removeReactions(model, rxns(:,2));
exportYaml(model, '../../model/Human-GEM.yml');
writeYAMLmodel(model, '../../model/Human-GEM.yml');
rxnAssocTable(rxn_indx(:,2), :) = [];
exportTsvFile(rxnAssocTable, rxnAssocFile);

Expand Down
2 changes: 1 addition & 1 deletion code/test/testMetabolicTasks.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

% Import yaml model
ymlFile=fullfile(modelPath,'model','Human-GEM.yml');
ihuman = importYaml(ymlFile, true);
ihuman = readYAMLmodel(ymlFile);

% parse metabolic tasks
model = addBoundaryMets(ihuman);
Expand Down
2 changes: 1 addition & 1 deletion code/updateAnimalGEM.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
load(matFile);
elseif isfile(ymlFile)
% Load Human-GEM Yaml file
ihuman = importYaml(ymlFile);
ihuman = readYAMLmodel(ymlFile);
else
error('ERROR: No model file is found!');
end
Expand Down

0 comments on commit 91a6e78

Please sign in to comment.