tokens: Glucose 6 - phosphate dehydrogenase ( G6PD ) is a cytosolic enzyme encoded by a housekeeping X - linked gene whose main function is to produce NADPH , a key electron donor in the defense against oxidizing agents and in reductive biosynthetic reactions .