iMAT (integrative metabolic anĂ¡lisis tool) - MATLAB
0
0
Entering edit mode
12 weeks ago
debocolman • 0

Hi Everyone! I'm a MatLab begginner and I'd like run the iMAT plugin to reach a comparative proteomic analysis. My input is an Excel file with data about 2 growth conditions: Wildtype and Fe-growth.

initCobraToolbox(false)
changeCobraSolver('gurobi');

% Load the expression data from an Excel file
expressionDataFile = 'C:\Users\usuario\cobratoolbox\160824_BP-Fe.xlsx';  % Replace with the correct path
[num, txt, raw] = xlsread(expressionDataFile);

% Load the model .mat file
modelFile = 'C:\Users\usuario\cobratoolbox\iBP1870.mat'; 
load(modelFile);

% Select the columns I want to analyze from the Excel file
geneNames = txt(2:end, 3);
expressionLevels = num(:, 17);

% Check if there are any cells with NaN values
nanIndices = isnan(expressionLevels);
if any(nanIndices)
    warning('There are %d NaN values in the expression levels.', sum(nanIndices));
end

% Remove NaN values from the expression data
expressionLevels = expressionLevels(~any(isnan(expressionLevels), 2), :);

% Assuming `nanIndices` is the index of the elements that were NaN in expressionLevels
% and that you have already used it to remove the NaN values:
% Create indices that are NOT NaN
nanIndices = ~isnan(expressionLevels);

% Filter geneNames using nanIndices, i.e., removing gene names that returned NaN values
filteredGeneNames = geneNames(nanIndices);

% Filter genes and expression levels that are in model.genes
isMember = ismember(filteredGeneNames, model.genes);
if any(~isMember)
    warning('Some genes in expressionDataadjusted are not in model.genes');
end

filteredGenes = filteredGeneNames(isMember);

% Run this:
expressionRxns = mapExpressionToReactions(model, filteredGenes, filteredExpressionLevels);

% Set the expression level thresholds
threshold_ub = 50.0; % Upper threshold for expression levels
threshold_lb = 5.0;  % Lower threshold for expression levels

% This is where I run iMAT:
tissueModel = iMAT(model, expressionRxns, threshold_lb, threshold_ub);

tissueModel = iMAT(model, expressionRxns, threshold_lb, threshold_ub);
Warning: There are 216 NaN values in the expression levels. 
Warning: Some genes in expressionDataadjusted are not in model.genes 
RHindex:
          53
          55
          81
         156
         184
         197
........
RLindex:
           1
           3
           4
           5
           6
           7
           9
          10
          11
          18
          19
          20
          21
          22


        1652
        1653
        1655
        1656
        1658
        1660
        1662
        1664
        1665
        1666
        1667
        1668
        1669
        1672

Verificando lb y ub para NaN o Inf...
Error using iMAT (line 61)
Vector ub contiene NaN o Inf valores

However, I can't run this code because I keep getting error messages relationated to RHindex. There is not Nan o Inf values. It was checked Someone knows how it can solve?

Thanks a lot

DEb

iMAT MATLAB • 243 views
ADD COMMENT

Login before adding your answer.

Traffic: 1857 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6