First-principles study of spin orbit coupling contribution to anisotropic magnetic interaction