The central role of Gln63 for the hydrogen bonding network and UV-visible spectrum of the AppA BLUF domain. 
In blue-light sensing using flavin (BLUF) domains, the side-chain orientation of key residues close to the flavin chromophore is still under debate.  We report quantum refinements of the wild-type AppA BLUF protein from Rhodobacter sphaeroides starting from two published X-ray structures (1YRX and 2IYG) with different arrangements of the residues around the chromophore.  Quantum refinement uses the same experimental X-ray raw data as conventional refinement, but includes data from quantum mechanics/molecular mechanics (QM/MM) calculations as restraints, which is expected to be more reliable than the normally employed MM data.  In addition to quantum refinement, pure QM/MM geometry optimizations are performed for the 1YRX and 2IYG structures and for five models derived therefrom.  Vertical excitation energies are computed at the QM(DFT/MRCI)/MM level to assess the resulting structures.  The experimental absorption maximum of the dark state of wild-type AppA is well reproduced for structures that contain the Gln63 residue in 1YRX-type orientation.  The computed excitation energies are red-shifted for structures with a flipped Gln63 residue in 2IYG-type orientation.  The calculated 1YRX- and 2IYG-type hydrogen-bonding networks are discussed in detail, particularly with regard to the orientation of the chromophore and the Gln63, Trp104, and Met106 residues.