Home > plotting > setOmicDataToRxns.m

setOmicDataToRxns

PURPOSE ^

USAGE:

SYNOPSIS ^

function v1 = setOmicDataToRxns(omics, model)

DESCRIPTION ^

 USAGE:
 v1 = setOmicDataToRxns(omics, model)
 INPUTS:
 omics     two column cell array with genes and log-fold expression changes
 model     model structure
 OUTPUTS:
 v1       vector with expression changes in metabolic genes

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function v1 = setOmicDataToRxns(omics, model)
0002 % USAGE:
0003 % v1 = setOmicDataToRxns(omics, model)
0004 % INPUTS:
0005 % omics     two column cell array with genes and log-fold expression changes
0006 % model     model structure
0007 % OUTPUTS:
0008 % v1       vector with expression changes in metabolic genes
0009 
0010 j = 1;
0011 for i = 1:length(model.genes)
0012     a = find(ismember(omics(:,1), model.genes{i}));
0013     if ~isempty(a)
0014         genesList{j,1} = omics{a,1};
0015         genesList{j,2} = omics{a,2};
0016         j = j + 1;
0017     end
0018 end
0019 rxnsFromGenes = findRxnsFromGenes(model, genesList(:,1));
0020 s = struct2cell(rxnsFromGenes);
0021 k = 1;
0022 for i = 1:length(s)
0023     s1 = s{i};
0024     [l,~]=size(s1);
0025     for j = 1:l
0026         s2=s1{j};
0027         rxnsList{k,1}=s2;
0028         k = k + 1;
0029     end
0030 end
0031 rxnsList = (unique(rxnsList));
0032 
0033 for i = 1:length(rxnsList)
0034     rxnsList {i,2} = findGenesFromRxns(model, rxnsList{i});
0035 end
0036 v1 = zeros(length(model.rxns),1);
0037 for i = 1:length(rxnsList)
0038     rxnGenes = rxnsList{i,2};
0039     indRxnGene = rxnGenes{1,1};
0040     c = 0.0;
0041     for j = 1:length(indRxnGene)
0042         a = find(ismember(genesList(:,1),indRxnGene{j,1}));
0043         if ~isempty(a) && abs(cell2mat(genesList(a,2))) >= c
0044             c = cell2mat(genesList(a,2));
0045         end
0046     end
0047     rxnID = findRxnIDs(model,rxnsList{i,1});
0048     v1(rxnID,1) = c;
0049 end
0050 end

Generated by m2html © 2005