function [modelUpdated] = patchRecon3D_01(model)
% This function corrects minor issues with Recon3D, released after Nov
% 2017 and before 19th Feb 2018.
% Please obtain the most recent version of Recon3D OR use this patch.
%
% 19.02.2018, Ines Thiele

if isfield(model, 'metCharge')
model.metCharges = model.metCharge;
model = rmfield(model,'metCharge');
end
model.metCharges(strmatch('h[c]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[i]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[m]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[x]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[g]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[r]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[n]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[e]',model.mets,'exact'))=1;
model.metCharges(strmatch('h[l]',model.mets,'exact'))=1;

model.metCharges(strmatch('pi[c]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[i]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[m]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[x]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[g]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[r]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[n]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[e]',model.mets,'exact'))=-2;
model.metCharges(strmatch('pi[l]',model.mets,'exact'))=-2;

model.metCharges(strmatch('3moxtyr[c]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[i]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[m]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[x]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[g]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[r]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[n]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[e]',model.mets,'exact'))=1;
model.metCharges(strmatch('3moxtyr[l]',model.mets,'exact'))=1;

model.metCharges(strmatch('hgentis[c]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[i]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[m]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[x]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[g]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[r]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[n]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[e]',model.mets,'exact'))=-1;
model.metCharges(strmatch('hgentis[l]',model.mets,'exact'))=-1;

model.metCharges(strmatch('biliverd[c]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[i]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[m]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[x]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[g]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[r]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[n]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[e]',model.mets,'exact'))=-2;
model.metCharges(strmatch('biliverd[l]',model.mets,'exact'))=-2;

model.metCharges(strmatch('thrnt[c]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[i]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[m]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[x]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[g]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[r]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[n]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[e]',model.mets,'exact'))=-1;
model.metCharges(strmatch('thrnt[l]',model.mets,'exact'))=-1;

model.metCharges(strmatch('vacc[c]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[i]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[m]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[x]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[g]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[r]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[n]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[e]',model.mets,'exact'))=-1;
model.metCharges(strmatch('vacc[l]',model.mets,'exact'))=-1;

model.metCharges(strmatch('crvnc[c]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[i]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[m]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[x]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[g]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[r]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[n]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[e]',model.mets,'exact'))=-1;
model.metCharges(strmatch('crvnc[l]',model.mets,'exact'))=-1;

model.metCharges(strmatch('normete_L[c]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[i]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[m]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[x]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[g]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[r]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[n]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[e]',model.mets,'exact'))=1;
model.metCharges(strmatch('normete_L[l]',model.mets,'exact'))=1;

model.metCharges(strmatch('bgly[c]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[i]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[m]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[x]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[g]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[r]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[n]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[e]',model.mets,'exact'))=-1;
model.metCharges(strmatch('bgly[l]',model.mets,'exact'))=-1;

model.metCharges(strmatch('pap[c]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[i]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[m]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[x]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[g]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[r]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[n]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[e]',model.mets,'exact'))=-4;
model.metCharges(strmatch('pap[l]',model.mets,'exact'))=-4;

model.rxns(strmatch('EX_HCO2172[e]',model.rxns,'exact'))={'EX_zn2[e]'};

modelUpdated = model;
modelUpdated.version = 'Recon3D_01';
modelUpdated.PleaseCite = 'Brunk et al, Nat Biotech, 2018; doi:10.1038/nbt.4072'

