Hi Chiara,
In most cases, it is simple. 20 will show 10 positive and 10 negative sorted by FDR. It could be 10 positive and 5 negative if there are just 5 significant gene sets in the negative direction.
In your case, I think it is related to something I had to add later to make sure representatives of the clusters from redundancy reduction methods also in the reported list, or they will be broken if affinity propagation or weighted set cover is chosen. So if the database is highly redundant like GO and the reportNum parameter is small, it could turn out to be more than the set threshold. And it seems after rescuing these representatives, the result list is not sorted again. The latter can be fixed quickly, but we are going to change the redundancy reduction in a new version soon. I will make a GitHub issue for this problem.
The bottom line is the text file or the data frame returned by the R function call is always the correct result. The reporNum is just used to filter for some top results to show in the HTML report with some caveats.
Yuxing