A graphical models approach for comparing gene sets