Metabolic rewiring in response to genetic and environmental preturbations in cancer