Modeling of Conformation and Redox Potentials of Hemes and other Cofactors in Proteins