Skip to content

Commit

Permalink
added distributed models for testCreatePanModels
Browse files Browse the repository at this point in the history
  • Loading branch information
almut-heinken committed Nov 6, 2024
1 parent a369b99 commit 15b8766
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@
% create violin plot of model stats
if nargin <5
% have reactions and metabolites in one plot
figure
subplot(1,2,1)
violinplot(data(:,1:2),{'Reactions','Metabolites'});
set(gca, 'FontSize', 12)
% does not work if all data points are the same
if ~numel(unique(data(:,3)))==1
if ~numel(unique(data(:,1)))==1 && ~numel(unique(data(:,2)))==1 && ~numel(unique(data(:,3)))==1
figure
subplot(1,2,1)
violinplot(data(:,1:2),{'Reactions','Metabolites'});
set(gca, 'FontSize', 12)
subplot(1,2,2)
violinplot(data(:,3),{'Microbes'});
set(gca, 'FontSize', 12)
sgtitle('Reaction, metabolite and microbe numbers in microbiome models')
print('MicrobiomeModel_Sizes','-dpng','-r300')
end
set(gca, 'FontSize', 12)
sgtitle('Reaction, metabolite and microbe numbers in microbiome models')
print('MicrobiomeModel_Sizes','-dpng','-r300')

else
% perform statistical analysis if file with stratification is provided
Expand Down
3 changes: 3 additions & 0 deletions src/reconstruction/demeter/src/refinement/createPeriplasmaticSpace.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
transpRxns = findRxnsFromMets(model,exMets{i});
% remove exchange reactions
transpRxns(find(strncmp(transpRxns,'EX_',3)))=[];
% remove reactions that are already periplasmatic
forms = printRxnFormula(model,transpRxns);
transpRxns(find(contains(forms,'[p]')))=[];
for j=1:length(transpRxns)
rxnsToAdd{end+1} = [transpRxns{j} 'pp'];
rxnNames{end+1} = [model.rxnNames{find(strcmp(model.rxns,transpRxns{j}))} ', periplasmatic'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,33 @@
fileDir = fileparts(which('testCreatePanModels'));
cd(fileDir);

% load the AGORA models
websave('AGORA-master.zip','https://github.com/VirtualMetabolicHuman/AGORA/archive/master.zip')
try
unzip('AGORA-master')
end
modPath = [pwd filesep 'AGORA-master' filesep 'CurrentVersion' filesep 'AGORA_1_03' filesep' 'AGORA_1_03_mat'];

modelList={
'Abiotrophia_defectiva_ATCC_49176'
'Acidaminococcus_fermentans_DSM_20731'
'Acidaminococcus_intestini_RyC_MR95'
'Acidaminococcus_sp_D21'
'Acinetobacter_baumannii_AB0057'
'Acinetobacter_calcoaceticus_PHEA_2'
'Acinetobacter_haemolyticus_NIPH_261'
'Acinetobacter_johnsonii_SH046'
'Acinetobacter_junii_SH205'
'Acinetobacter_lwoffii_WJ10621'
'Acinetobacter_pittii_ANC_4052'
'Acinetobacter_radioresistens_NIPH_2130'
};
for i=1:length(modelList)
model = getDistributedModel([modelList{i} '.mat']);
% Save all the models into the modelFolder
save(fullfile(fileDir, modelList{i}), 'model');
end

numWorkers=4;

% create the pan-models on species level
panPath=[pwd filesep 'panSpeciesModels'];

builtTaxa = {'Acinetobacter junii','Bacteroides ovatus','Enterobacter cloacae','Megasphaera elsdenii','Ruminococcus flavefaciens'};
createPanModels(modPath,panPath,'Species','AGORA_infoFile.xlsx',numWorkers,builtTaxa)
builtTaxa = {'Abiotrophia defectiva','Acidaminococcus fermentans','Acidaminococcus intestini','Acidaminococcus sp. D21','Acinetobacter_baumannii','Acinetobacter haemolyticus','Acinetobacter johnsonii','Acinetobacter junii','Acinetobacter lwoffii','Acinetobacter pittii','Acinetobacter radioresistens'};
createPanModels(fileDir,panPath,'Species','AGORA_infoFile.xlsx',numWorkers,builtTaxa)

% test that pan-models can grow
[notGrowing,Biomass_fluxes] = plotBiomassTestResults(panPath, 'pan-models','numWorkers',numWorkers);
Expand All @@ -41,8 +54,8 @@
% create the pan-models on genus level
panPath=[pwd filesep 'panGenusModels'];

builtTaxa = {'Acinetobacter','Butyricimonas','Megasphaera','Ruminococcus'};
createPanModels(modPath,panPath,'Genus','AGORA_infoFile.xlsx',numWorkers,builtTaxa);
builtTaxa = {'Abiotrophia','Acidaminococcus','Acinetobacter'};
createPanModels(fileDir,panPath,'Genus','AGORA_infoFile.xlsx',numWorkers,builtTaxa);

% test that pan-models can grow
[notGrowing,Biomass_fluxes] = plotBiomassTestResults(panPath, 'pan-models','numWorkers',numWorkers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
'Abiotrophia_defectiva_ATCC_49176'
'Acidaminococcus_fermentans_DSM_20731'
'Acidaminococcus_intestini_RyC_MR95'
'Acidaminococcus_sp_D21'
'Acinetobacter_calcoaceticus_PHEA_2'
'Acinetobacter_baumannii_AB0057'
};
for i=1:length(modelList)
model = getDistributedModel([modelList{i} '.mat']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
'Abiotrophia_defectiva_ATCC_49176'
'Acidaminococcus_fermentans_DSM_20731'
'Acidaminococcus_intestini_RyC_MR95'
'Acidaminococcus_sp_D21'
'Acinetobacter_calcoaceticus_PHEA_2'
'Acinetobacter_baumannii_AB0057'
};
for i=1:length(modelList)
model = getDistributedModel([modelList{i} '.mat']);
Expand Down

0 comments on commit 15b8766

Please sign in to comment.