A mathematical framework for describing and analysing gene regulatory networks