CorrelateFluxWithTaxonAbundance ERROR

13 views
Skip to first unread message

MARINA MURILLO

unread,
Dec 22, 2019, 11:53:20 AM12/22/19
to COBRA Toolbox
I am trying to run CorrelateFluxWithTaxonAbundance 

But I am getting this:

Error in correlateFluxWithTaxonAbundance (line 150)
    xlabels = FluxCorrelations.(TaxonomyLevels{t})(1, 2:end);

The two first steps are done:
Calculating the relative abundances on all taxon levels. 
Calculating the correlations between fluxes and abundances. 

But when  I try to do this part is when I get the error:

% Plot the calculated correlations.
for t = 1:length(TaxonomyLevels)
xlabels = FluxCorrelations.(TaxonomyLevels{t})(1, 2:end);
ylabels = FluxCorrelations.(TaxonomyLevels{t})(2:end, 1);
data = string(FluxCorrelations.(TaxonomyLevels{t})(2:end, 2:end));
data = str2double(data);
figure;
imagesc(data)
colormap('cool')
colorbar
if length(xlabels) < 50
set(gca, 'xtick', 1:length(xlabels));
xticklabels(xlabels);
xtickangle(90)
end
if length(ylabels) < 50
set(gca, 'ytick', 1:length(ylabels));
yticklabels(ylabels);
end
set(gca, 'TickLabelInterpreter', 'none');
title(TaxonomyLevels{t})
end
end

Almut Heinken

unread,
Dec 26, 2019, 6:14:37 AM12/26/19
to cobra-...@googlegroups.com
Hi Marina,
I am off until the 2nd ofJanuary. I'll take a look at your problem then.
Best,
Almut

--

---
You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/e37f611b-8c20-455a-ba05-3143f2055a19%40googlegroups.com.

Almut Heinken

unread,
Jan 2, 2020, 10:53:48 AM1/2/20
to cobra-...@googlegroups.com
Hi Marina,
I do not get this error when I run the function. Can you please tell me what exactly the error message is saying, and what your input files look like?
Thank you!
Best regards,
Almut

MARINA MURILLO

unread,
Jan 3, 2020, 5:03:46 PM1/3/20
to cobra-...@googlegroups.com
Hi,
I have done this tutorial Creation and simulation of personalized microbiota models through metagenomic data integration. At the end of this tutorial I obtained a file with the fluxes and I used it  in order to perform the function of CorrelateFluxWithTaxonAbundance.

Cobra version: The COBRA Toolbox - 2020
Matlab: MATLAB R2018b
Solver Cplex: CPLEX_Studio128

The command that I use is:

[FluxCorrelations, PValues] = correlateFluxWithTaxonAbundance(abundancePath, fluxes)

Input files:
abundancePath --> the file is normCoverageReduced.csv
fluxes path --> sDiet_allFlux.csv
(Both files are attached)

This is the error:
>> [FluxCorrelations, PValues] = correlateFluxWithTaxonAbundance(abundancePath, fluxes)

Calculating the relative abundances on all taxon levels.
Calculating the correlations between fluxes and abundances.
Undefined function or variable 'FluxCorrelations'.


Error in correlateFluxWithTaxonAbundance (line 150)
    xlabels = FluxCorrelations.(TaxonomyLevels{t})(1, 2:end);


Thank you,

Marina.


Missatge de Almut Heinken <almut....@gmail.com> del dia dj., 2 de gen. 2020 a les 16:53:
normCoverageReduced.csv
sDiet_allFlux.csv

Almut Heinken

unread,
Jan 8, 2020, 8:41:32 AM1/8/20
to cobra-...@googlegroups.com
Hi Marina,
the input "fluxes" is expected as a Matlab cell array, not a .csv file. I can see why this would be confusing so I will consider changing that.
Moreover, the file sDiet_allFlux has multiple flux values for each sample, but the input variable for fluxes needs to have only one flux value per sample with the name of the sample as the column name. Otherwise, the namespace will not match with the input file with the organism abundances. I will add a line to the tutorial that summarizes the computed fluxes accordingly.
Best,
Almut

Reply all
Reply to author
Forward
0 new messages