Tuning the magnetic behavior and transport property of graphene by introducing dopant and defect: A first-principles study