Understanding the response of gene networks to environmental perturbation