A predictive model of gene expression reveals the role of network motifs in the mating response of yeast