Controlling the electronic properties of single-wall carbon nanotubes by chemical doping