A graphical model approach for comparing gene sets