Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #2212

Merged
merged 75 commits into from
Jan 10, 2024
Merged

Develop #2212

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
6856b00
typo at addCOBRAVariables.m
silvtal Sep 5, 2023
182c2af
MMT bug: createMultipleSpeciesModel.m ignored the biomasses argument …
silvtal Sep 5, 2023
c881bd7
Fixing bug for xomicsTomodelm
rosieluo2021 Sep 21, 2023
0b1316a
fixing bug
rosieluo2021 Sep 21, 2023
0655842
Fix file location path
bramnap Oct 12, 2023
e217468
Update modelExtraction.m
CodeGeasrb Nov 6, 2023
1eed7f6
recent edits
ithiele Nov 7, 2023
23ea87f
Merge pull request #2182 from CodeGeasrb/master
rmtfleming Nov 7, 2023
3532645
Merge pull request #2183 from ithiele/it_10_10_2023
rmtfleming Nov 7, 2023
fade501
Merge pull request #2179 from bramnap/updateMexFastFVA
rmtfleming Nov 7, 2023
59ce33b
Merge pull request #2177 from rosieluo2021/metaPD
rmtfleming Nov 7, 2023
b9cc060
Merge pull request #2175 from silvtal/master
rmtfleming Nov 7, 2023
deea412
Update individualised lab report
annasheehy Nov 20, 2023
238c584
Update createNewMetaboliteStructure.m
farid-zare Nov 20, 2023
527e73a
Update testFluxShifts.m
farid-zare Nov 20, 2023
4d3bace
Update calculateFluxShifts.m
farid-zare Nov 20, 2023
02b8c62
Update filterNonFluxReactions.m
farid-zare Nov 20, 2023
0ac5440
Update testNonFluxReactions.m
farid-zare Nov 20, 2023
62bf2f2
Update testRateLimittingReactions.m
farid-zare Nov 21, 2023
8ff55a5
Update filterRateLimittingReactions.m
farid-zare Nov 21, 2023
56b6f1b
updated paths in tutorials and added VMH reaction data
trjhensen Nov 21, 2023
a610c82
Update testCheckModelPreFBA.m
farid-zare Nov 21, 2023
dafa69e
Update testPrintFluxVector.m
farid-zare Nov 21, 2023
2471695
Update printFluxVector.m
farid-zare Nov 21, 2023
2d540a0
Update refData_printFluxVectorFormula.txt
farid-zare Nov 21, 2023
24d1f0d
Merge pull request #2188 from trjhensen/develop
ithiele Nov 21, 2023
d5ff360
Merge pull request #2186 from FaridZare17/MetabAnnotaor1
ithiele Nov 21, 2023
a8dcaee
Merge pull request #2185 from annasheehy/indLabReport-fix
ithiele Nov 21, 2023
cb58328
changes to reportTemplate
ithiele Nov 21, 2023
805e7f8
Merge pull request #2189 from ithiele/it_21_11_2023
ithiele Nov 21, 2023
2ffac47
changes to generateMetaboScore
ithiele Nov 21, 2023
a1fc095
Merge pull request #2191 from ithiele/it_21_11_2023c
ithiele Nov 21, 2023
ca253b4
Update refData_printFluxVectorFormula.txt
farid-zare Nov 22, 2023
2c3e238
Update printFluxVector.m
farid-zare Nov 22, 2023
8fa2401
Update testPrintFluxVector.m
farid-zare Nov 22, 2023
6686d35
Update testCheckModelPreFBA.m
farid-zare Nov 22, 2023
0a047de
Fixing bugs for testChangeCobraSolverm and testMergeTwoModelsm
rosieluo2021 Nov 22, 2023
d786887
Fixing a bug where ATN does not match the reference
hadjar11 Nov 27, 2023
fa8dedb
Merge pull request #2194 from hadjar11/testMoieties
rmtfleming Nov 27, 2023
4014e52
Merge pull request #2193 from rosieluo2021/metaPD
rmtfleming Nov 27, 2023
608246f
Merge pull request #2187 from FaridZare17/Debug_testAll_function
rmtfleming Nov 27, 2023
429d3b6
Added option to create boxplots in mgPipe
almut-heinken Nov 28, 2023
4d02c6f
Added option to create boxplots in mgPipe
almut-heinken Nov 28, 2023
b5f0a6d
new function for eshcer map
Yanjun2021 Nov 29, 2023
277c6fd
Update getFormulaAndChargeFromInChI.m
Sami990 Nov 30, 2023
18c8df6
Update testFindRxnsFromGenes.m
Sami990 Nov 30, 2023
ed841b7
Update getFormulaAndChargeFromInChI.m
Sami990 Nov 30, 2023
4b3f392
Update testFindRxnsFromGenes.m
Sami990 Nov 30, 2023
b8800fd
testPrintConstraintm
Yanjun2021 Nov 30, 2023
f123e88
debug testPrintConstraintsm
Yanjun2021 Nov 30, 2023
864db3b
Debug testBiomassPrecursorCheck function
hadjar11 Nov 30, 2023
fea7522
Merge pull request #2199 from Yanjun2021/newFunc_escherMap
rmtfleming Nov 30, 2023
72f5834
Merge pull request #2201 from Yanjun2021/testPrintConstraint
rmtfleming Nov 30, 2023
a9f7b2b
Merge pull request #2202 from hadjar11/231129
rmtfleming Nov 30, 2023
9317682
Update testPrintFluxVector.m
farid-zare Dec 8, 2023
a95bb4a
Update refData_printFluxVectorFormula.txt
farid-zare Dec 8, 2023
9068ce7
Update printFluxVector.m
farid-zare Dec 8, 2023
b1a1277
Update testCheckModelPreFBA.m
farid-zare Dec 8, 2023
b3cad97
update function in XomicsToModel
Yanjun2021 Dec 14, 2023
6d64af1
adding MatGPT to CobraToolbox
Dec 17, 2023
0c2646a
test
Dec 17, 2023
a862a58
remove folders
Dec 17, 2023
196f8e6
remove unwanted files
Dec 17, 2023
a30f813
test
Dec 17, 2023
c8db84c
remove test
Dec 17, 2023
50be405
FastLeakTest modification
Yanjun2021 Dec 18, 2023
a0d8a88
Merge pull request #2208 from Yanjun2021/FastLeakTest-modification
rmtfleming Dec 19, 2023
f8e9ef7
Merge pull request #2207 from farid-zare/MatGPT
rmtfleming Dec 19, 2023
46f9a63
Add MatGPT
farid-zare Jan 8, 2024
a98bdee
Merge pull request #2211 from farid-zare/MatGPT_submodule
rmtfleming Jan 9, 2024
c102c2a
Merge pull request #2205 from Yanjun2021/update-function-in-XomicsToM…
rmtfleming Jan 10, 2024
fddd334
Merge pull request #2196 from almut-heinken/addPlotOption
rmtfleming Jan 10, 2024
23f477a
Merge pull request #2200 from Sami990/Debug-testAll-function
rmtfleming Jan 10, 2024
8c0dc17
Merge pull request #2204 from farid-zare/update-testAll-function2
rmtfleming Jan 10, 2024
20467cf
Merge branch 'master' into develop
rmtfleming Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@
[submodule "external/base/io/xlread"]
path = external/base/io/xlread
url = https://github.com/tpfau/xlread
[submodule "external/visualization/MatGPT"]
path = external/visualization/MatGPT
url = [email protected]:toshiakit/MatGPT.git
2 changes: 1 addition & 1 deletion external/analysis/octave-networks-toolbox
Submodule octave-networks-toolbox updated 59 files
+14 −0 PriceModel.m
+22 −19 README.md
+18 −0 leafNodes.m
+23 −0 linkDensity.m
+17 −0 loops3rev2.m
+69 −0 louvainCommunityFinding.m
+24 −0 masterEquationGrowthModel.m
+17 −0 minSpanTree.m
+34 −1 modularityMetric.m
+16 −0 multiEdges.m
+9 −0 nestedHierarchiesModel.m
+20 −0 newmanCommFast.m
+51 −0 newmanEigenvectorMethod.m
+18 −0 newmanGastner.m
+23 −0 newmanGirvan.m
+42 −0 nodeBetweenness.m
+10 −0 nodeBetweennessFaster.m
+22 −0 numConnComp.m
+22 −0 numConnTriples.m
+16 −0 numCycles.m
+18 −0 numEdges.m
+21 −0 numNodes.m
+16 −0 numStarMotifs.m
+21 −0 pdfCdfRank.m
+25 −0 pearson.m
+8 −1 pearsonW.m
+22 −0 preferentialAttachment.m
+7 −0 radialPlot.m
+18 −1 randomDirectedGraph.m
+41 −0 randomGraph.m
+60 −0 randomGraphDegreeDist.m
+21 −1 randomGraphFromDegreeSequence.m
+88 −0 randomModularGraph.m
+25 −0 rewire.m
+22 −0 rewireAssort.m
+25 −0 rewireDisassort.m
+35 −0 rewireThisEdge.m
+24 −0 richClubMetric.m
+10 −0 run_tests.m
+16 −1 sMetric.m
+16 −0 selfLoops.m
+27 −0 shortestPathDP.m
+12 −0 signlessLaplacian.m
+23 −0 simpleDijkstra.m
+23 −0 simpleSpectralPartitioning.m
+34 −0 smoothDiameter.m
+16 −0 sortNodesByMaxNeighborDegree.m
+17 −0 sortNodesBySumNeighborDegrees.m
+12 −0 str2adj.m
+2 −0 strongConnComp.m
+15 −0 subgraph.m
+18 −0 symmetrize.m
+24 −1 symmetrizeEdgeL.m
+96 −0 tarjan.m
+0 −1,162 testAllFunctions.m
+18 −0 transitivity.m
+15 −0 vertexEccentricity.m
+6 −0 weightedClustCoeff.m
+4 −0 weightedRandomSample.m
1 change: 1 addition & 0 deletions external/visualization/MatGPT
Submodule MatGPT added at 61dea6
2 changes: 1 addition & 1 deletion src/analysis/FVA/fastFVA/mex/generateMexFastFVA.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function generateMexFastFVA(rootPathCPLEX, printLevel)
eval(['mex -setup c' compVerboseMode]);

% define the name of the source code
filename = [CBTDIR filesep 'external' filesep 'analysis' filesep 'fastFVAmex' filesep 'cplexFVA.c'];
filename = [CBTDIR filesep 'src' filesep 'analysis' filesep 'FVA' filesep 'fastFVA' filesep 'mex' filesep 'cplexFVA.c'];

% generation of MEX string with compiler options
if isunix
Expand Down
59 changes: 30 additions & 29 deletions src/analysis/calculateFluxShifts/calculateFluxShifts.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function calculateFluxShifts(source, target)
% Compares reaction flux values (min, max) between two models or more models
% in resultsPostOptimization\contextSpecificModels folder and writes the
% in resultsPostOptimization/contextSpecificModels folder and writes the
% comparison results ('up', 'down', 1) in a new column in the target model
%
% USAGE:
Expand All @@ -16,22 +16,23 @@ function calculateFluxShifts(source, target)
% .. Authors:
% - Kristina Grausa 05/16/2022
% - Kristina Grausa 08/23/2022 - standard header and formatting
% - Farid Zare 20/11/2023 - Repository addresses are corrected, standard variable names

% Get target model/-s
destTarget = {};
if string(target) == "All"
destTarget = string(strcat('resultsPostOptimization\contextSpecificModels\*.xls'));
destTarget = string(strcat('resultsPostOptimization/contextSpecificModels/*.xls'));
else
destTarget = string(strcat('resultsPostOptimization\contextSpecificModels\*',char(target),'*.xls'));
destTarget = string(strcat('resultsPostOptimization/contextSpecificModels/*',char(target),'*.xls'));
end
T = dir(destTarget);
xlsFilesInfo = dir(destTarget);

% Source model
destSource = string(strcat('resultsPostOptimization\contextSpecificModels\*',char(source),'*.xls'));
destSource = string(strcat('resultsPostOptimization/contextSpecificModels/*',char(source),'*.xls'));
S = dir(destSource);
sheetName = 'Reaction List';
filename = strcat(S.folder, '\', S.name);
dataSource=readtable(filename,'Sheet',sheetName);
filename = strcat(S.folder, '/', S.name);
dataSource = readtable(filename,'Sheet',sheetName);

% Get minFlux and MaxFlux columns from source model
minFluxSource = dataSource.MinFlux;
Expand All @@ -47,59 +48,59 @@ function calculateFluxShifts(source, target)
end

% Get min and max flux data from target model file
for i=1:1:length(T)
if ~contains(T(i).name,char(source))
for i=1:length(xlsFilesInfo)

filename = strcat(T(i).folder, '\', T(i).name);
if ~contains(xlsFilesInfo(i).name,char(source))
filename = strcat(xlsFilesInfo(i).folder, '/', xlsFilesInfo(i).name);
data=readtable(filename,'Sheet',sheetName);

try
% Get minFlux and MaxFlux columns from target model file
minFlux = data.MinFlux;
maxFlux = data.MaxFlux;
minFluxTarget = data.MinFlux;
maxFluxTarget = data.MaxFlux;

% Create and fill cell arrays (min, max) with rounded flux
% values from target model
minFlux_r = cell(height(minFlux),1);
maxFlux_r = cell(height(maxFlux),1);
minFluxTarget_r = cell(height(minFluxTarget),1);
maxFluxTarget_r = cell(height(maxFluxTarget),1);

for k=1:1:height(data)
minFlux_r{k} = round(str2double(minFlux{k}),6);
maxFlux_r{k} = round(str2double(maxFlux{k}),6);
minFluxTarget_r{k} = round(str2double(minFluxTarget{k}),6);
maxFluxTarget_r{k} = round(str2double(maxFluxTarget{k}),6);
end

% Create and fill flux ratio cell arrays (target/source)
MinFluxRatio = cell(height(minFlux),1);
MaxFluxRatio = cell(height(minFlux),1);
MinFluxRatio = cell(height(minFluxTarget),1);
MaxFluxRatio = cell(height(minFluxTarget),1);

% Calculate ratios for all reaction fluxes
for n=1:1:length(minFlux)
minRatio = minFlux_r{n}/minFluxSource_r{n};
maxRatio = maxFlux_r{n}/maxFluxSource_r{n};
for n=1:1:length(minFluxTarget)
minRatio = minFluxTarget_r{n}/minFluxSource_r{n};
maxRatio = maxFluxTarget_r{n}/maxFluxSource_r{n};
minRatio = round(minRatio,6);
maxRatio = round(maxRatio,6);

% Source flux is 0
if minFluxSource_r{n} == 0 && minFlux_r{n} ~= 0
if minFluxSource_r{n} == 0 && minFluxTarget_r{n} ~= 0
minRatio = 'up';
end
if maxFluxSource_r{n} == 0 && maxFlux_r{n} ~= 0
if maxFluxSource_r{n} == 0 && maxFluxTarget_r{n} ~= 0
maxRatio = 'up';
end

% Target flux is 0
if minFlux_r{n} == 0 && minFluxSource_r{n} ~= 0
if minFluxTarget_r{n} == 0 && minFluxSource_r{n} ~= 0
minRatio = 'down';
end
if maxFlux_r{n} == 0 && maxFluxSource_r{n} ~= 0
if maxFluxTarget_r{n} == 0 && maxFluxSource_r{n} ~= 0
maxRatio = 'down';
end

% Both are 0
if minFlux_r{n} == 0 && minFluxSource_r{n} == 0
if minFluxTarget_r{n} == 0 && minFluxSource_r{n} == 0
minRatio = 1;
end
if maxFlux_r{n} == 0 && maxFluxSource_r{n} == 0
if maxFluxTarget_r{n} == 0 && maxFluxSource_r{n} == 0
maxRatio = 1;
end

Expand All @@ -108,7 +109,7 @@ function calculateFluxShifts(source, target)
end

% Save results
folderName = 'resultsPostOptimization\fluxShifts\';
folderName = 'resultsPostOptimization/fluxShifts/';
if ~exist(folderName, 'dir')
mkdir(folderName)
end
Expand All @@ -117,7 +118,7 @@ function calculateFluxShifts(source, target)
ratioData.Properties.VariableNames = {strcat('MinFlux_',source{1}), strcat('MaxFlux_',source{1}), 'MinFluxRatio', 'MaxFluxRatio'};
newData = [data ratioData];

temp = split(T(i).name,".");
temp = split(xlsFilesInfo(i).name,".");
resultFileName = strcat(temp(1),'_flux_shifts.xls');
fullResultFilePath = strcat(folderName, resultFileName);
writetable(newData,fullResultFilePath{1},'AutoFitWidth',false);
Expand Down
16 changes: 12 additions & 4 deletions src/analysis/exploration/biomassPrecursorCheck.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
% (returned only if checkConservedQuantities = true)
%
% .. Authors: - Pep Charusanti & Richard Que (July 2010)
% - Hadjar Rahou (Nov 2023) (fix a bug)

if ~exist('checkCoupling','var') || isempty(checkCoupling)
checkCoupling = 0;
Expand Down Expand Up @@ -118,12 +119,19 @@
EMV = findElementaryMoietyVectors(model);
else
% atom transition network is supplied.
EMV = identifyConservedMoieties(model, ATN);
types = classifyMoieties(EMV, model.S);
EMV = EMV(:, strcmp(types, 'Internal'));
%EMV = identifyConservedMoieties(model, ATN);
%types = classifyMoieties(EMV, model.S);
%EMV = EMV(:, strcmp(types, 'Internal'));
arm = identifyConservedMoieties(model, ATN); %Hadjar
L=arm.L;
types = classifyMoieties(L, model.S);
L = L(strcmp(types, 'Internal'),:);
EMV=L';
end
% biomass metabolites that contain conserved moieties
mCofactor = any(model.S(:, colS_biomass) ~= 0, 2) & any(EMV, 2);
%mCofactor = any(model.S(:, colS_biomass) ~= 0, 2) & any(EMV, 2);
mCofactor = (any(model.S(:, colS_biomass) < 0, 2) & any(EMV, 2)); %Hadjar
%pause(2);
% elementary moieties involved in biomass production
cofactorPairMatrix = EMV(:, any(EMV(mCofactor, :), 1));
% each cell of cofactorPair stores the set of cofactor metabolites to be produced.
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/exploration/printConstraints.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function printConstraints(model, minInf, maxInf, rxnSelection, modelAfter, print
%

% .. Authors:
% - Ines Thiele 02/09, Ronan Fleming 2020
% - Ines Thiele 02/09, Ronan Fleming 2020, Yanjun Liu 2023

if ~exist('minInf','var')|| isempty(minInf)
minInf=-Inf;
Expand Down Expand Up @@ -67,7 +67,7 @@ function printConstraints(model, minInf, maxInf, rxnSelection, modelAfter, print


if ~any(closedRxnBool | reversibleRxnBool | fwdRxnBool0b | revRxnBool0b | fwdRxnBoolNon0b | revRxnBoolNon0b)
boolRemainder = rxnSelection & ~(closedRxnBool | reversibleRxnBool | fwdRxnBool | revRxnBool);
boolRemainder = rxnSelection & ~(closedRxnBool | reversibleRxnBool | fwdRxnBool0b | revRxnBool0b | fwdRxnBoolNon0b | revRxnBoolNon0b);
warning('no subset with bounds between [minInf maxInf]')
else
boolRemainder=0;
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/exploration/printFluxVector.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function printFluxVector(model, fluxData, nonZeroFlag, excFlag, sortCol, fileNam
%

% .. Authors:
% - Markus Herrgard, Ronan Fleming
% - Markus Herrgard, Ronan Fleming
% - Farid Zare 21/11/2023 Corrected outputing multiple rxn names

if isempty(fluxData)
return
Expand Down Expand Up @@ -70,7 +71,6 @@ function printFluxVector(model, fluxData, nonZeroFlag, excFlag, sortCol, fileNam
% Add reaction formulas
if formulaFlag
if nonZeroFlag
labels = [model.rxns,model.rxns];
%only generate the formulas for the nonzero entries
labels(bool,end+1) = printRxnFormula(model, labels(bool), false, false);
else
Expand Down
7 changes: 4 additions & 3 deletions src/analysis/filterNonFluxReactions/filterNonFluxReactions.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ function filterNonFluxReactions(phenotype)
% .. Authors:
% - Kristina Grausa 05/16/2022
% - Kristina Grausa 08/23/2022 - standard header and formatting
% - Farid Zare 20/11/2023 - Repository addresses are correcteds

dest = string(strcat('resultsPostOptimization\contextSpecificModels\*', phenotype, '*.*'));
dest = string(strcat('resultsPostOptimization/contextSpecificModels/*', phenotype, '*.*'));
S = dir(dest);
count = length(S);

Expand All @@ -27,7 +28,7 @@ function filterNonFluxReactions(phenotype)

for i=1:1:count
sheetName = 'Reaction List';
filename = strcat(S(i).folder, '\', S(i).name);
filename = strcat(S(i).folder, '/', S(i).name);
data=readtable(filename,'Sheet',sheetName);

% Copy headers
Expand Down Expand Up @@ -75,7 +76,7 @@ function filterNonFluxReactions(phenotype)
end

% Save results
folderName = 'resultsPostOptimization\nonFluxReactions\';
folderName = 'resultsPostOptimization/nonFluxReactions/';
if ~exist(folderName, 'dir')
mkdir(folderName)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ function filterRateLimittingReactions(phenotype)
%
% USAGE:
%
% filterRateLimittingReactions(phenotype)
% filterRateLimittingReactions(phenotype)
%
% INPUTS:
% phenotype: char representing the phenotype name provided
% in each model name of the same phanotype
% phenotype: char representing the phenotype name provided
% in each model name of the same phanotype
%
% .. Authors:
% - Kristina Grausa 05/16/2022
% - Kristina Grausa 08/23/2022 - standard header and formatting
% - Farid Zare 11/21/2023 - Correction of repository address format
%

dest = string(strcat('resultsPostOptimization\contextSpecificModels\*', phenotype, '*.xls'));
dest = string(strcat('resultsPostOptimization/contextSpecificModels/*', phenotype, '*.xls'));
S = dir(dest);
count = length(S);

Expand All @@ -27,7 +29,7 @@ function filterRateLimittingReactions(phenotype)

for i=1:1:count
sheetName = 'Reaction List';
filename = strcat(S(i).folder, '\', S(i).name);
filename = strcat(S(i).folder, '/', S(i).name);
data=readtable(filename,'Sheet',sheetName);

% Copy headers
Expand Down Expand Up @@ -79,7 +81,7 @@ function filterRateLimittingReactions(phenotype)
end

% Save results
folderName = 'resultsPostOptimization\rateLimittingReactions\';
folderName = 'resultsPostOptimization/rateLimittingReactions/';
if ~exist(folderName, 'dir')
mkdir(folderName)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
spName = spAbbr;
end
if isfield(infoCom, 'spBm')
indCom.spBm = modelCom.rxns(infoCom.spBm);
indCom.spBm = modelCom.rxns(infoCom.spBm); %modelCom.infoCom.spBm
end
if isfield(infoCom,'spATPM')
indCom.spATPM = modelCom.rxns(infoCom.spATPM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ function analyzeMgPipeResults(infoFilePath,resPath,varargin)
% statistical analysis are saved
% violinPath: char with path of directory where violin plots are
% saved
% plotType Type of plot to be created: violin plot (default)
% or boxplot. Allowed entries: "ViolinPlot","Boxplot"
% sampleGroupHeaders list of one or more column headers in file with the
% sample information that should be analyzed
% (e.g., disease status, age). If not provided, the
% second column will be used.
%
%
% .. Author: Almut Heinken, 12/2020

Expand All @@ -34,6 +37,7 @@ function analyzeMgPipeResults(infoFilePath,resPath,varargin)
parser.addRequired('resPath', @ischar);
parser.addParameter('statPath', [pwd filesep 'Statistics'], @ischar);
parser.addParameter('violinPath', [pwd filesep 'ViolinPlots'], @ischar);
parser.addParameter('plotType', 'ViolinPlot', @ischar);
parser.addParameter('sampleGroupHeaders', '', @iscellstr);

parser.parse(infoFilePath, resPath, varargin{:});
Expand All @@ -42,8 +46,13 @@ function analyzeMgPipeResults(infoFilePath,resPath,varargin)
resPath = parser.Results.resPath;
statPath = parser.Results.statPath;
violinPath = parser.Results.violinPath;
plotType = parser.Results.plotType;
sampleGroupHeaders = parser.Results.sampleGroupHeaders;

if ~any(strcmp(plotType,{'ViolinPlot','Boxplot'}))
error('Invalid entry for plot type!')
end

% create the folders
mkdir(statPath)
mkdir(violinPath)
Expand Down Expand Up @@ -108,13 +117,13 @@ function analyzeMgPipeResults(infoFilePath,resPath,varargin)
writetable(cell2table(significantFeatures),[statPath filesep filename '_' sampleGroupHeaders{j} '_SignificantFeatures'],'FileType','text','WriteVariableNames',false,'Delimiter','tab');
end

% create violin plots
% create plots
currentDir=pwd;
cd(violinPath)

% create violin plots for net uptake and secretion files
if any(contains(fileList{i,1},{'net_uptake_fluxes.csv','net_secretion_fluxes.csv'}))
makeViolinPlots(sampleData, infoFile, 'stratification',sampleGroupHeaders{j}, 'plottedFeature', filename, 'unit', 'mmol/person/day')
makeViolinPlots(sampleData, infoFile, 'stratification',sampleGroupHeaders{j}, 'plotType' , plotType, 'plottedFeature', filename, 'unit', 'mmol/person/day')
end
cd(currentDir)
end
Expand Down
Loading
Loading