Autotrophic and heterotrophic mechanisms for ammonia oxidation