Molecular detection based on conductance quantization of nanowires