Effects of heteroatoms on the electronic, sensor, and adsorption properties of graphene