title: R "Error in draw.quad.venn, Impossible: produces negative area" despite numbers being correct
body: <p>I'm trying to generate a four way Venn diagram using draw.quad.venn in the VennDiagram package in R, but it keeps throwing up the error message:</p>
  
  <pre><code>ERROR [2019-05-14 11:28:24] Impossible: a7  &lt;- n234 - a6 produces negative area
  Error in draw.quad.venn(length(gene_lists[[1]]), length(gene_lists[[2]]),  : 
    Impossible: a7  &lt;- n234 - a6 produces negative area
  </code></pre>
  
  <p>I'm using 4 different lists of genes as the input. calculate.overlap works fine, then I get the numbers by using the length(x) function over the overlap values, parsed as a list. I pass all of the overlap values, along with the appropriate total group sizes, to the draw.quad.venn function, but it keeps claiming that one of the groups is impossible because it generates a negative number.</p>
  
  <p>I've checked the numbers manually and they clearly add up to the correct values. I've also tested the script on a random set of 20000 genes, generated using something similar to the script below, and it works fine i.e. generates a four way Venn diagram. There are no differences between the randomly generated gene lists and the ones I've curated from actual results files, apart from their sizes. A minimal working example can be seen below:</p>
  
  <pre><code># working example that fails
  # get vector of 10000 elements (representative of gene list)
  values &lt;- c(1:10000)
  # generate 4 subsets by random sampling
  list_1 &lt;- sample(values, size = 5000, replace = FALSE)
  list_2 &lt;- sample(values, size = 4000, replace = FALSE)
  list_3 &lt;- sample(values, size = 3000, replace = FALSE)
  list_4 &lt;- sample(values, size = 2000, replace = FALSE)
  # compile them in to a list
  lists &lt;- list(list_1, list_2, list_3, list_4)
  # find overlap between all possible combinations (11 plus 4 unique to each list = 15 total)
  overlap &lt;- calculate.overlap(lists)
  # get the lengths of each list - these will be the numbers used for the Venn diagram
  overlap_values &lt;- lapply(overlap, function(x) length(x))
  # rename overlap values (easier to identify which groups are intersecting)
  names(overlap_values) &lt;- c("n1234", "n123", "n124", "n134", "n234", "n12", "n13", "n14", "n23", "n24", "n34", "n1", "n2", "n3", "n4")
  # generate the venn diagram
  draw.quad.venn(length(lists[[1]]), length(lists[[2]]), length(lists[[3]]), length(lists[[4]]), overlap_values$n12,
                 overlap_values$n13, overlap_values$n14, overlap_values$n23, overlap_values$n24, overlap_values$n34,
                 overlap_values$n123, overlap_values$n124, overlap_values$n134, overlap_values$n234, overlap_values$n1234)
  </code></pre>
  
  <p>I expect a four way Venn diagram regardless of whether or not some groups are 0, they should still be there, but labelled as 0. This is what it should look like:</p>
  
  <p><a href="https://i.stack.imgur.com/IjlCk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IjlCk.png" alt="Four way Venn diagram, with gene list sizes in each group"></a></p>
  
  <p>I'm not sure if it's because I have 0 values in the real data i.e. certain groups where there is no overlap? Is there any way to force draw.quad.venn() to take any values? If not, is there another package that I can use to achieve the same results? Any help greatly appreciated!</p>