From 91a6e7832b4c84e59cfbba0735c1ef1e741ad48d Mon Sep 17 00:00:00 2001 From: Eduard Kerkhoven Date: Mon, 23 Dec 2024 14:02:45 +0100 Subject: [PATCH] fix: use readYAMLmodel and writeYAMLmodel in funcs --- code/DepMapGeneEss/PrepDepMapData.m | 2 +- code/modelCuration/GlycolysisCuration.m | 2 +- code/modelCuration/addAAnewRxn20230518.m | 4 ++-- code/modelCuration/addRxnACOD1_20221102.m | 4 ++-- code/modelCuration/changeCompAbbrevs.m | 4 ++-- code/modelCuration/removeDuplicateRxns_issue345.m | 4 ++-- code/test/testMetabolicTasks.m | 2 +- code/updateAnimalGEM.m | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/DepMapGeneEss/PrepDepMapData.m b/code/DepMapGeneEss/PrepDepMapData.m index 36777950..62831a35 100644 --- a/code/DepMapGeneEss/PrepDepMapData.m +++ b/code/DepMapGeneEss/PrepDepMapData.m @@ -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') diff --git a/code/modelCuration/GlycolysisCuration.m b/code/modelCuration/GlycolysisCuration.m index 2dbaab27..f7037223 100644 --- a/code/modelCuration/GlycolysisCuration.m +++ b/code/modelCuration/GlycolysisCuration.m @@ -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; diff --git a/code/modelCuration/addAAnewRxn20230518.m b/code/modelCuration/addAAnewRxn20230518.m index 38a5f702..2f4b69a4 100644 --- a/code/modelCuration/addAAnewRxn20230518.m +++ b/code/modelCuration/addAAnewRxn20230518.m @@ -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; @@ -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'); diff --git a/code/modelCuration/addRxnACOD1_20221102.m b/code/modelCuration/addRxnACOD1_20221102.m index 2c4f38e7..7bd1f27e 100644 --- a/code/modelCuration/addRxnACOD1_20221102.m +++ b/code/modelCuration/addRxnACOD1_20221102.m @@ -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 @@ -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'); diff --git a/code/modelCuration/changeCompAbbrevs.m b/code/modelCuration/changeCompAbbrevs.m index 544dfac6..c1fc35d2 100644 --- a/code/modelCuration/changeCompAbbrevs.m +++ b/code/modelCuration/changeCompAbbrevs.m @@ -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')); @@ -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')); diff --git a/code/modelCuration/removeDuplicateRxns_issue345.m b/code/modelCuration/removeDuplicateRxns_issue345.m index 0b8e82db..3146c7b1 100644 --- a/code/modelCuration/removeDuplicateRxns_issue345.m +++ b/code/modelCuration/removeDuplicateRxns_issue345.m @@ -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 @@ -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); diff --git a/code/test/testMetabolicTasks.m b/code/test/testMetabolicTasks.m index e8288809..917d0a2f 100644 --- a/code/test/testMetabolicTasks.m +++ b/code/test/testMetabolicTasks.m @@ -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); diff --git a/code/updateAnimalGEM.m b/code/updateAnimalGEM.m index 5ce90e94..fb62b78a 100644 --- a/code/updateAnimalGEM.m +++ b/code/updateAnimalGEM.m @@ -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