Quantum phase transition of spin-2 cold bosons in an optical lattice