Characterizations on bacterial photosynthesis and respiration with optical spectroscopy and magnetic resonance