Domain repertoires as a tool to derive protein recognition rules