Ab initio studies of electronic and optical properties of graphene and graphene–BN interface