compareBinsOfFluxes

PURPOSE ^

takes the overall sammin and sammax samples, bins them into

SYNOPSIS ^

function [output] = compareBinsOfFluxes(xglc,model,sammin,sammax,metabolites)

DESCRIPTION ^

 takes the overall sammin and sammax samples, bins them into
   separate bin sizes and compares them, then compares the
   results to the largest bin size.
 calls
 [totalz,zscore,mdv1,mdv2] =
 compareTwoSamp(xglc,model,samp1,samp2,measuredMetabolites)
  sammin and sammax each contain bins of fluxes in x.samps(r,1).points
 Wing Choi 3/7/08

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [output] = compareBinsOfFluxes(xglc,model,sammin,sammax,metabolites)
0002 
0003 % takes the overall sammin and sammax samples, bins them into
0004 %   separate bin sizes and compares them, then compares the
0005 %   results to the largest bin size.
0006 % calls
0007 % [totalz,zscore,mdv1,mdv2] =
0008 % compareTwoSamp(xglc,model,samp1,samp2,measuredMetabolites)
0009 %  sammin and sammax each contain bins of fluxes in x.samps(r,1).points
0010 % Wing Choi 3/7/08
0011 
0012 output = 0;
0013 
0014 if (nargin < 4)
0015     disp '[output] = compareBinsOfFluxes(xglc,model,samplo,samphi,metabolites)'
0016     return;
0017 end
0018 
0019 if (nargin < 5)
0020     metabolites = [];
0021 end
0022 
0023 if (isempty(xglc))
0024     % random glucose
0025     %xglc = rand(64,1);
0026     %xglc = xglc/sum(xglc);
0027     %xglc = idv2cdv(6)*xglc;
0028     
0029     glucose = rand(8,1);
0030     glucose = glucose/sum(glucose);
0031     %glc = idv2cdv(6)*glc;
0032 
0033     % glc 1-6 = carbon 1-6
0034     % glc 7 = carbon 1+2 (really 5 and 6)
0035     % glc 8 = unlabeled
0036     % glc 9 = fully labeled
0037     glc = zeros(64,9);
0038     glc(1+1,1) = 1;
0039     glc(2+1,2) = 1;
0040     glc(4+1,3) = 1;
0041     glc(8+1,4) = 1;
0042     glc(16+1,5) = 1;
0043     glc(32+1,6) = 1;
0044     glc(32+16+1,7) = 1;
0045     glc(0+1,8) = 1;
0046     glc(63+1,9) = 1;
0047 
0048     xGlc = zeros(64,1);
0049     for i = 1:8
0050         xGlc = xGlc + glucose(i)*glc(:,i);
0051     end
0052 
0053     xglc = idv2cdv(6)*xGlc;
0054 
0055 end
0056 
0057 nbins = size(sammin.samps,1);
0058 npoints = size(sammin.samps(1,1).points,2);
0059 
0060 disp (sprintf('found %d samples in input',npoints));
0061 disp (sprintf('numbins  : %d',nbins));
0062 
0063 for bin = 1:nbins
0064     samp1.points = sammin.samps(bin,1).points;
0065     samp2.points = sammax.samps(bin,1).points;
0066     [totalz,zscore,mdv1,mdv2] = compareTwoSamp(xglc,model,samp1,samp2,metabolites);
0067     output.totalz(bin,1) = totalz;
0068 end
0069 
0070 return
0071 end

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003