function [modelNew,rxnList]=mapMutantFluxDifference(model,sol0,sol1,removeMets,compSymbol,compNameList,fileName)

% This function maps the flux difference between wild-type cells and mutant cells.
% 
% Writes a new model in structure formate which is later
% written into *.xml format. This file is then transported to Cell Designer.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % Written By Chintan Joshi on 7/4/2014 % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

c=0;
for i=1:length(sol0)
    if abs(sol0(i,1)-sol1(i,1))>=10^-2
        c=c+1;
        ind(c,1)=i;
        flux(c,1)=sol1(i,1)-sol0(i,1);
    end
end

rxnList=model.rxns(ind,1);

[modelNew]=convert4Mapping(model,flux,rxnList,removeMets);
[modelNew,~]=createNetwork4CellDesigner(modelNew,rxnList);

convertCOBRA2XML(modelNew,compSymbol,compNameList,fileName);