Computational investigation of proton transfer, pKa shifts and pH-optimum of protein-DNA and protein-RNA complexes.