A concept of charge and valence for ab initio wave functions