Probably, this is another way:
t=get.venn.partitions(studies, keep.elements = T, force.unique = T)
t$..values..[1] # To get all common genes
t$..set..
[1] "S1∩S2∩S3" "(S2∩S3)∖(S1)" "(S1∩S3)∖(S2)" "(S3)∖(S1∪S2)"
[5] "(S1∩S2)∖(S3)" "(S2)∖(S1∪S3)" "(S1)∖(S2∪S3)"
ol_size
a5 a2 a4 a6 a1 a3 a7
338 148 154 145 60 69 63
lengths(t$..values..[1])
1
338
OP can edit this code for better. Remove lengths to print the gene list:
> for (length in (1:length(t$..set..))) {
+ print (paste(t$..set..[length], lengths(t$..values..[length])), sep="\t")
+ }
[1] "S1∩S2∩S3 338"
[1] "(S2∩S3)∖(S1) 145"
[1] "(S1∩S3)∖(S2) 154"
[1] "(S3)∖(S1∪S2) 63"
[1] "(S1∩S2)∖(S3) 148"
[1] "(S2)∖(S1∪S3) 69"
[1] "(S1)∖(S2∪S3) 60"


Provide example data,
calculate.overlapdoes exactly what you need, try the examples from the manuals. Also, whyBBis repeated twice?If you need just the overlap of genes from 3 sets, try:
Or more generic solution: