Huge magnetoresistance induced by half-metal-semiconductor phase transition in a one-dimensional spin chain: a first-principles study.