Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Added code that generates the actual venn diagram images. Needs source files with...
authorelserj <elserj@localhost>
Thu, 12 Jun 2014 23:14:14 +0000 (23:14 +0000)
committerelserj <elserj@localhost>
Thu, 12 Jun 2014 23:14:14 +0000 (23:14 +0000)
svn path=/; revision=576

Personnel/elserj/.gitignore [deleted file]
Personnel/elserj/venn_sources/3_set_venn_source.png [new file with mode: 0644]
Personnel/elserj/venn_sources/3_set_venn_source.svg [new file with mode: 0644]
Personnel/elserj/venn_sources/4_set_venn_source.png [new file with mode: 0644]
Personnel/elserj/venn_sources/4_set_venn_source.svg [new file with mode: 0644]
Personnel/elserj/venn_sources/5_set_venn_source.png [new file with mode: 0644]
Personnel/elserj/venn_sources/5_set_venn_source.svg [new file with mode: 0644]
interactome_scripts/create_venn_diagram.pl

diff --git a/Personnel/elserj/.gitignore b/Personnel/elserj/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Personnel/elserj/venn_sources/3_set_venn_source.png b/Personnel/elserj/venn_sources/3_set_venn_source.png
new file mode 100644 (file)
index 0000000..facff77
Binary files /dev/null and b/Personnel/elserj/venn_sources/3_set_venn_source.png differ
diff --git a/Personnel/elserj/venn_sources/3_set_venn_source.svg b/Personnel/elserj/venn_sources/3_set_venn_source.svg
new file mode 100644 (file)
index 0000000..474e0b8
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1058.4805"
+   height="795.18939"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="3_set_venn_source.png"
+   inkscape:export-filename="/home/justin/scripts/jaiswallab/Personnel/elserj/venn_sources/3_set_venn_source.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.0055809"
+     inkscape:cx="339.38725"
+     inkscape:cy="479.78106"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="1680"
+     inkscape:window-height="1032"
+     inkscape:window-x="1676"
+     inkscape:window-y="-6"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(52.098343,-36.78281)">
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot4331"
+       style="font-size:18px;font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:0px;word-spacing:0px;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Times New Roman;-inkscape-font-specification:Times New Roman"
+       transform="translate(324.26787,770.58937)"><flowRegion
+         id="flowRegion4333"><rect
+           id="rect4335"
+           width="73.589302"
+           height="85.522705"
+           x="315.24066"
+           y="-104.69035" /></flowRegion><flowPara
+         id="flowPara4337" /></flowRoot>    <path
+       sodipodi:type="arc"
+       style="opacity:0.78205124;fill:#ff0000;fill-opacity:0.4906542;stroke:#ff0008;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path4571"
+       sodipodi:cx="320.71014"
+       sodipodi:cy="265.64471"
+       sodipodi:rx="159.60924"
+       sodipodi:ry="159.60924"
+       d="m 480.31938,265.64471 c 0,88.14975 -71.45949,159.60924 -159.60924,159.60924 -88.14974,0 -159.60923,-71.45949 -159.60923,-159.60924 0,-88.14974 71.45949,-159.60923 159.60923,-159.60923 88.14975,0 159.60924,71.45949 159.60924,159.60923 z"
+       transform="translate(70.423237,198.38096)" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:0.78205124000000004;fill:#0000cb;fill-opacity:0.45641026;stroke:#0000ff;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path4571-0"
+       sodipodi:cx="320.71014"
+       sodipodi:cy="265.64471"
+       sodipodi:rx="159.60924"
+       sodipodi:ry="159.60924"
+       d="m 480.31938,265.64471 c 0,88.14975 -71.45949,159.60924 -159.60924,159.60924 -88.14974,0 -159.60923,-71.45949 -159.60923,-159.60924 0,-88.14974 71.45949,-159.60923 159.60923,-159.60923 88.14975,0 159.60924,71.45949 159.60924,159.60923 z"
+       transform="translate(253.61068,198.38096)"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <path
+       sodipodi:type="arc"
+       style="opacity:0.78205124000000004;fill:#00a700;fill-opacity:0.45128204999999999;stroke:#007808;stroke-width:2.50000000000000000;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path4571-9"
+       sodipodi:cx="320.71014"
+       sodipodi:cy="265.64471"
+       sodipodi:rx="159.60924"
+       sodipodi:ry="159.60924"
+       d="m 480.31938,265.64471 c 0,88.14975 -71.45949,159.60924 -159.60924,159.60924 -88.14974,0 -159.60923,-71.45949 -159.60923,-159.60924 0,-88.14974 71.45949,-159.60923 159.60923,-159.60923 88.14975,0 159.60924,71.45949 159.60924,159.60923 z"
+       transform="translate(162.01696,49.06915)" />
+  </g>
+</svg>
diff --git a/Personnel/elserj/venn_sources/4_set_venn_source.png b/Personnel/elserj/venn_sources/4_set_venn_source.png
new file mode 100644 (file)
index 0000000..80b03d4
Binary files /dev/null and b/Personnel/elserj/venn_sources/4_set_venn_source.png differ
diff --git a/Personnel/elserj/venn_sources/4_set_venn_source.svg b/Personnel/elserj/venn_sources/4_set_venn_source.svg
new file mode 100644 (file)
index 0000000..310a409
--- /dev/null
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1352.9224"
+   height="962.08618"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="4_set_venn_source.png"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0"
+   inkscape:export-filename="/home/justin/BPP_research/Orthology_software/interactome/Matrix/venn_diagram_monococcum.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.85899615"
+     inkscape:cx="682.67994"
+     inkscape:cy="546.73033"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1680"
+     inkscape:window-height="1032"
+     inkscape:window-x="1676"
+     inkscape:window-y="-6"
+     inkscape:window-maximized="1"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(419.20615,167.20644)">
+    <rect
+       style="opacity:0.41666667;fill:#0000cc;fill-opacity:1;stroke:#0000cc;stroke-width:67.40000153;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect2383"
+       width="543.28711"
+       height="216.22006"
+       x="-326.3165"
+       y="404.2673"
+       transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" />
+    <rect
+       style="opacity:0.41666667;fill:#00d600;fill-opacity:1;stroke:#00d600;stroke-width:67.40000153;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3157"
+       width="543.28711"
+       height="216.22006"
+       x="-777.43323"
+       y="-160.4384"
+       transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" />
+    <rect
+       style="opacity:0.41666667;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:67.40000153;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3159"
+       width="543.28711"
+       height="216.22006"
+       x="-230.03403"
+       y="-761.28229"
+       transform="matrix(-0.7071068,0.7071068,-0.7071068,-0.7071068,0,0)" />
+    <rect
+       style="opacity:0.41666667;fill:#000e00;fill-opacity:1;stroke:#000e00;stroke-width:67.40000153;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3161"
+       width="543.28711"
+       height="216.22006"
+       x="-765.15149"
+       y="-311.31918"
+       transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" />
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="692.83801"
+       y="198.64247"
+       id="text3215"><tspan
+         sodipodi:role="line"
+         id="tspan3217"
+         x="692.83801"
+         y="198.64247" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="-258.85556"
+       y="204.64247"
+       id="text3219"><tspan
+         sodipodi:role="line"
+         id="tspan3221"
+         x="-258.85556"
+         y="204.64247" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="407.17426"
+       y="18.739897"
+       id="text3223"><tspan
+         sodipodi:role="line"
+         id="tspan3225"
+         x="407.17426"
+         y="18.739897" /></text>
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3227"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"><flowRegion
+         id="flowRegion3229"><rect
+           id="rect3231"
+           width="166.95473"
+           height="87.582809"
+           x="496.75873"
+           y="-107.15757" /></flowRegion><flowPara
+         id="flowPara3233" /></flowRoot>    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="121.47682"
+       y="26.845354"
+       id="text3235"><tspan
+         sodipodi:role="line"
+         id="tspan3237"
+         x="121.47682"
+         y="26.845354" /></text>
+  </g>
+</svg>
diff --git a/Personnel/elserj/venn_sources/5_set_venn_source.png b/Personnel/elserj/venn_sources/5_set_venn_source.png
new file mode 100644 (file)
index 0000000..cda697e
Binary files /dev/null and b/Personnel/elserj/venn_sources/5_set_venn_source.png differ
diff --git a/Personnel/elserj/venn_sources/5_set_venn_source.svg b/Personnel/elserj/venn_sources/5_set_venn_source.svg
new file mode 100644 (file)
index 0000000..b778e39
--- /dev/null
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1058.4805"
+   height="795.18939"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="5_set_venn_source.png"
+   inkscape:export-filename="/home/justin/lab_share/justin/monococcum/venn/5_set_urartu_DV92_G3116_Aegilops_Hordeum.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.0055809"
+     inkscape:cx="485.57141"
+     inkscape:cy="289.98654"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="1680"
+     inkscape:window-height="1032"
+     inkscape:window-x="1676"
+     inkscape:window-y="-6"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(52.098343,-36.78281)">
+    <path
+       style="opacity:0.78205124;fill:#000ea0;fill-opacity:0.51643192;stroke:#000e00;stroke-width:4.22557354;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 335.79348,299.45193 c -84.33868,0 -152.71875,56.09401 -152.71875,125.28125 0,69.18724 68.38007,125.25 152.71875,125.25 54.70632,0 126.54511,-58.58668 129.65625,-59.0625 108.01982,-2.2188 189.21875,-14.02872 189.21875,-66.78125 0,-48.58835 -81.80127,-63.12218 -189.25,-65.65625 -2.32087,0.73642 -74.93664,-59.03125 -129.625,-59.03125 z"
+       id="path2985"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ssscscs" />
+    <path
+       style="opacity:0.78205124;fill:#00b500;fill-opacity:0.36448598;stroke:#005000;stroke-width:4.22557354;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="M 583.98281,284.00721 C 557.92072,203.79637 483.44154,156.09708 417.64059,177.47714 c -65.80101,21.37997 -97.98924,103.73766 -71.92717,183.94849 16.90519,52.0288 94.82384,102.24726 96.23775,105.05916 35.49018,102.04733 71.81393,175.62253 121.98456,159.32113 46.21028,-15.0146 34.75479,-97.3034 3.96135,-200.27634 -1.41758,-1.9797 32.98535,-89.51064 16.08573,-141.52237 z"
+       id="path2985-9"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ssscscs" />
+    <path
+       style="opacity:0.78205124;fill:#4d0000;fill-opacity:0.51643192;stroke:#3c0000;stroke-width:4.22557354;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 671.75523,494.15145 c 68.2314,-49.57303 90.5808,-135.14683 49.9136,-191.12048 -40.6673,-55.97366 -128.94077,-61.13658 -197.17213,-11.56355 -44.25836,32.15556 -67.94077,121.77896 -70.17805,123.99259 -86.0857,65.2875 -144.83531,122.56946 -113.82816,165.24715 28.55952,39.30881 103.28091,2.98535 191.69825,-58.12133 1.44476,-1.95995 95.32269,3.71063 139.56649,-28.43438 z"
+       id="path2985-8"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ssscscs" />
+    <path
+       style="opacity:0.78205124000000004;fill:#ffff0f;fill-opacity:0.74299064999999986;stroke:#c6b008;stroke-width:4.22557354000000007;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 473.86927,644.44951 c 68.23142,49.573 156.52329,44.3848 197.19053,-11.5889 40.66724,-55.9736 18.29947,-141.52214 -49.93196,-191.09517 C 576.8695,409.60987 484.31431,414.7817 481.51767,413.33797 392.82362,351.64056 320.19061,313.46746 289.18345,356.14514 c -28.55952,39.30881 29.07632,99.1485 114.51469,164.35539 2.31047,0.76839 25.92732,91.80388 70.17113,123.94898 z"
+       id="path2985-4"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ssscscs" />
+    <path
+       style="opacity:0.78205124;fill:#ff8d00;fill-opacity:0.51643192;stroke:#df6300;stroke-width:4.22557354;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 277.9932,506.84119 c -26.06208,80.21085 6.15588,162.57817 71.95686,183.9582 65.80098,21.38007 140.25043,-26.32893 166.31252,-106.53979 16.90518,-52.0288 -16.61465,-138.45583 -16.10579,-141.56174 31.26975,-103.4186 45.1297,-184.29283 -5.04093,-200.59426 -46.21027,-15.01463 -85.31075,58.2918 -120.92428,159.69855 -0.0168,2.43484 -79.29875,53.02732 -96.19838,105.03904 z"
+       id="path2985-88"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ssscscs" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot4331"
+       style="font-size:18px;font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:0px;word-spacing:0px;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Times New Roman;-inkscape-font-specification:Times New Roman"
+       transform="translate(324.26787,770.58937)"><flowRegion
+         id="flowRegion4333"><rect
+           id="rect4335"
+           width="73.589302"
+           height="85.522705"
+           x="315.24066"
+           y="-104.69035" /></flowRegion><flowPara
+         id="flowPara4337" /></flowRoot>  </g>
+</svg>
index 1aed2428f4f175dddbec91f2e8180858829edd9c..d9bb4ce973870121a0e548f534aafa1ee0796e1e 100755 (executable)
@@ -3,19 +3,39 @@
 use strict;
 use warnings;
 
+use GD; # required for image creation
+use GD::Text::Align; # required for formatting 
+use Number::Format qw(:subs); # required for adding commas to numbers
+
 use lib "$ENV{HOME}/scripts/jaiswallab/interactome_scripts";
 
 use DbiFloret;
 
+print "User credentials for the supercluster database\n";
 my $dbh = DbiFloret::dbconnect;
 
-my @species_array = ("Vitis_vinifera", "Eucalyptus_grandis", "Arabidopsis_thaliana", "Populus_trichocarpa");
-my $array_size = @species_array;
+# create the database handler to get the total number of gene models in the fasta file
+#   Assumes the fasta has been loaded to the protein sequences database
+print "User credentials for the protein sequences database\n";
+my $dbh_seq = DbiFloret::dbconnect;
+
+my @species_array = ("Aegilops_tauschii", "Hordeum_vulgare", "TmDV92", "TmG3116", "Triticum_urartu");
+#my @species_array = ("Aegilops_tauschii", "Hordeum_vulgare", "TmDV92", "TmG3116");
+#my @species_array = ("Aegilops_tauschii", "Hordeum_vulgare", "TmDV92");
+my $species_array_size = @species_array;
 
 my %gene_hash;
 my %super_hash;
 
-my $sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]'");
+my $sth;
+
+if ($species_array_size == 3) {
+$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]'");
+}elsif ($species_array_size == 4) {
+$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]'");
+}elsif ($species_array_size == 5) {
+$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]' or `species` = '$species_array[4]'");
+}
 
 my $rv = $sth->execute();
 
@@ -54,7 +74,7 @@ my %clust_hash;
 foreach my $super_id (keys %super_hash) {
        if(defined($clust_hash{$super_id})) {
                my $oldhash = $clust_hash{$super_id};
-               for (my $i=0;$i<$array_size;$i++) {
+               for (my $i=0;$i<$species_array_size;$i++) {
                        if($super_hash{$super_id}->{'species'} =~ /$species_array[$i]/) {
                                if($clust_hash{$super_id} !~ /$species_array[$i]/) {
                                        $oldhash = "$oldhash\t$species_array[$i]";
@@ -66,7 +86,7 @@ foreach my $super_id (keys %super_hash) {
                
                
        }else{
-               for (my $i=0;$i<$array_size;$i++) {
+               for (my $i=0;$i<$species_array_size;$i++) {
                        if($super_hash{$super_id}->{'species'} =~ /$species_array[$i]/) {
                                if(defined($clust_hash{$super_id})) {
                                        $clust_hash{$super_id} = "$clust_hash{$super_id}\t$species_array[$i]";
@@ -91,18 +111,10 @@ foreach my $clust_id (keys %clust_hash) {
        }
 }
 
-# print "\nTotal number of genes for each species\n";
-# 
-# for (my $k = 0; $k<$array_size; $k++) {
-       # my $gene_count = 0;
-       # foreach my $super_id (keys %super_hash) {
-               # while($super_hash{$super_id}->{'species'} =~ /$species_array[$k]/g) {
-                       # $gene_count++;
-               # }
-       # }
-       # print "$species_array[$k]\t$gene_count\n";
-# }
-#print "\n\nCluster counts and gene counts for each Venn set\n";
+# variables needed for venn diagram printing
+my %venn_hash;
+
+
 print "\n\n";
 foreach my $key (keys %count_hash) {
        my @gene_array = split ("\t", $count_hash{$key}->{'genes'});
@@ -127,18 +139,83 @@ foreach my $key (keys %count_hash) {
        }
        close(output_file);
        
-
+       # try to set the variable for printing to the venn diagram
+       my $string = "spec_";
+       my $sub_count_string = "";
+       for (my $i = 0; $i < $species_array_size; $i++) {
+                       if ($key =~ $species_array[$i]) {
+                               $sub_count_string = $sub_count_string . $i+1;
+                       }
+       }
+       my $count_string = $string . $sub_count_string . "_count";
+       my $formatted_id_size = format_number($id_array_size);
+       my $formatted_gene_size = format_number($gene_array_size);
+       $formatted_gene_size = "($formatted_gene_size)";
+       # pad the numbers so that they appear center aligned
+       my $pad_size = ((length $formatted_gene_size) - (length $formatted_id_size))/2;
+       my $spaces = "";
+       for (my $i = 0; $i < $pad_size; $i++) {
+                       $spaces = $spaces . " ";
+       }
+       
+       $venn_hash{$count_string} = "$spaces$formatted_id_size\n$formatted_gene_size";
 }
 
+
+
 my $sth_get_species_cluster_count=$dbh->prepare("select count(distinct super_id) from super_clust where species like ?");
-my $sth_get_species_gene_count=$dbh->prepare("select count(gene) from super_clust where species like?");
+my $sth_get_species_gene_count=$dbh->prepare("select count(gene) from super_clust where species like ?");
+
 
-foreach my $species (@species_array) {
-               $sth_get_species_cluster_count->execute($species);
+for (my $i = 0; $i < $species_array_size; $i++) {
+               $sth_get_species_cluster_count->execute($species_array[$i]);
                my $species_count = $sth_get_species_cluster_count->fetchrow_array();
-               $sth_get_species_gene_count->execute($species);
+               $sth_get_species_gene_count->execute($species_array[$i]);
                my $species_gene_count = $sth_get_species_gene_count->fetchrow_array();
-               print "\nFor species $species, there were $species_count unique clusters with $species_gene_count genes\n";
+               
+               my $safe_species_table = $dbh_seq->quote_identifier("$species_array[$i]");
+               my $sth_get_gene_model_count=$dbh_seq->prepare("select count(gene_id) from $safe_species_table");
+               $sth_get_gene_model_count->execute();
+               my $species_gene_model_count = $sth_get_gene_model_count->fetchrow_array();
+               
+               
+               print "\nFor species $species_array[$i], there were $species_count unique clusters with $species_gene_count genes from $species_gene_model_count genes in the fasta file\n";
+               
+               # make the text to put on the venn diagram
+               my $j = $i + 1;
+               my $det_string_line_1 = "spec_". $j . "_det_line_1";
+               my $det_string = "spec_" . $j . "_det";
+               my $formatted_species = format_number($species_count);
+               my $formatted_genes = format_number($species_gene_count);
+               my $formatted_gene_model_count = format_number($species_gene_model_count);
+               
+               my $species;
+               # this will change the species name to be genus initial followed by a dot then species
+               ($species = $species_array[$i]) =~ s/(\w)\w*_(\w*)/$1\. $2/;
+               
+               if ($i == 1) {
+                               my $det_text = "$formatted_gene_model_count gene models in fasta\n$formatted_species clusters\n$formatted_genes gene models in clusters";
+                               # pad the text so that it appears center aligned
+                               my $pad_size = ((length "$formatted_genes gene models in clusters") - (length $species))/2;
+                               my $spaces = "";
+                               for (my $k = 0; $k < $pad_size; $k++) {
+                                               $spaces = $spaces . " ";
+                               }
+                               
+                               $venn_hash{$det_string_line_1} = "$spaces$species";
+                               $venn_hash{$det_string} = $det_text;
+               }else{
+                               # pad the text so that it appears center aligned
+                               my $pad_size = ((length $species) - (length $formatted_gene_model_count))/2;
+                               my $spaces = "";
+                               for (my $k = 0; $k < $pad_size; $k++) {
+                                               $spaces = $spaces . " ";
+                               }
+                               my $det_text = "$spaces$formatted_gene_model_count\n$spaces$formatted_species\n$spaces$formatted_genes";
+                               
+                               $venn_hash{$det_string_line_1} = $species;
+                               $venn_hash{$det_string} = $det_text;
+               }
 }
 
 my $sth_get_total_cluster_count=$dbh->prepare("select count(distinct super_id) from super_clust");
@@ -152,14 +229,301 @@ print "\nTotal number of clusters across all species was $tot_count across $tot_
                
 
 my $tot_count_clusters = keys %clust_hash;
-print "\nTotal number of clusters among the $array_size species = $tot_count_clusters\n";
+print "\nTotal number of clusters among the $species_array_size species = $tot_count_clusters\n";
 
+# make the strings to store this info to put on the figure
+my $formatted_tot_count = format_number($tot_count);
+my $formatted_tot_count_clusters = format_number($tot_count_clusters);
 
+my $tot_clust_string = "$formatted_tot_count total unique\ngene clusters identified\nin sequenced genomes\nof $tot_species_count species";
+my $tot_string = "$formatted_tot_count_clusters clusters had a\nmember in at least one\nof these $species_array_size species";
 
 
 
+###############################################################################
+#  The below portion will draw the venn diagram                               #
+###############################################################################
+my $img;
+
+if($species_array_size == 3) {
+               
+               # Open the venn diagram png file that already has the shapes
+               $img = newFromPng GD::Image('/home/justin/scripts/jaiswallab/Personnel/elserj/venn_sources/3_set_venn_source.png',1);
+               
+               # make some colors
+               my $white = $img->colorAllocateAlpha(255,255,255,127);
+               my $black = $img->colorAllocate(0,0,0);
+               my $red = $img->colorAllocate(255,0,0);
+               my $blue = $img->colorAllocate(0,0,255);
+               my $green = $img->colorAllocate(0,212,0);
+               
+               #$img->transparent($white);
+               $img->interlaced('true');
+               $img->alphaBlending(1);
+               $img->saveAlpha(1);
+               
+               #define the locations for text to go
+               # species details
+               my @spec_1_det = (60,375);
+               my @spec_2_det = (370,22);
+               my @spec_3_det = (800,375);
+               
+               my $spec_1_det = "$venn_hash{spec_1_det_line_1}\n$venn_hash{spec_1_det}";
+               my $spec_2_det = "$venn_hash{spec_2_det_line_1}\n$venn_hash{spec_2_det}";
+               my $spec_3_det = "$venn_hash{spec_3_det_line_1}\n$venn_hash{spec_3_det}";
+               
+               
+               $img->stringFT($red,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_1_det[0],$spec_1_det[1],"$spec_1_det");
+               $img->stringFT($green,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_2_det[0],$spec_2_det[1],"$spec_2_det");
+               $img->stringFT($blue,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_3_det[0],$spec_3_det[1],"$spec_3_det");
+               
+               my @tot_clust = (100,600);
+               my @tot = (600,650);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot_clust[0],$tot_clust[1],"$tot_clust_string");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot[0],$tot[1],"$tot_string");
+               
+               # species individual counts
+               my @spec_1_pos = (320,440);
+               my @spec_2_pos = (480,200);
+               my @spec_3_pos = (650,440);
+               
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1_pos[0],$spec_1_pos[1],"$venn_hash{spec_1_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_2_pos[0],$spec_2_pos[1],"$venn_hash{spec_2_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_3_pos[0],$spec_3_pos[1],"$venn_hash{spec_3_count}");
+               
+               # 2 species combinations
+               my @spec_12_pos = (390,310);
+               my @spec_13_pos = (490,465);
+               my @spec_23_pos = (580,310);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_12_pos[0],$spec_12_pos[1],"$venn_hash{spec_12_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_13_pos[0],$spec_13_pos[1],"$venn_hash{spec_13_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_23_pos[0],$spec_23_pos[1],"$venn_hash{spec_23_count}");
+               
+               # 3 species combination
+               my @spec_123_pos = (490,375);
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_123_pos[0],$spec_123_pos[1],"$venn_hash{spec_123_count}");
+
+}
 
+if($species_array_size == 4) {
+               
+               # Open the venn diagram png file that already has the shapes
+               $img = newFromPng GD::Image('/home/justin/scripts/jaiswallab/Personnel/elserj/venn_sources/4_set_venn_source.png',1);
+               
+               # make some colors
+               my $white = $img->colorAllocateAlpha(255,255,255,127);
+               my $black = $img->colorAllocate(0,0,0);
+               my $red = $img->colorAllocate(255,0,0);
+               my $blue = $img->colorAllocate(0,0,255);
+               my $green = $img->colorAllocate(0,212,0);
+               my $yellow = $img->colorAllocate(255,255,0);
+               my $gray = $img->colorAllocate(128,128,128);
+               my $salmon = $img->colorAllocate(255,103,103);
+               
+               #$img->transparent($white);
+               $img->interlaced('true');
+               $img->alphaBlending(1);
+               $img->saveAlpha(1);
+               
+               # define the locations for text to go
+               # species details
+               my @spec_1_det = (90,475);
+               my @spec_2_det = (400,125);
+               my @spec_3_det = (850,150);
+               my @spec_4_det = (1100,375);
+               
+               my $spec_1_det = "$venn_hash{spec_1_det_line_1}\n$venn_hash{spec_1_det}";
+               my $spec_2_det = "$venn_hash{spec_2_det_line_1}\n$venn_hash{spec_2_det}";
+               my $spec_3_det = "$venn_hash{spec_3_det_line_1}\n$venn_hash{spec_3_det}";
+               my $spec_4_det = "$venn_hash{spec_4_det_line_1}\n$venn_hash{spec_4_det}";
+               
+               $img->stringFT($gray,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_1_det[0],$spec_1_det[1],"$spec_1_det");
+               $img->stringFT($green,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_2_det[0],$spec_2_det[1],"$spec_2_det");
+               $img->stringFT($blue,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_3_det[0],$spec_3_det[1],"$spec_3_det");
+               $img->stringFT($salmon,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_4_det[0],$spec_4_det[1],"$spec_4_det");
+               
+               my @tot_clust = (170,800);
+               my @tot = (950,850);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot_clust[0],$tot_clust[1],"$tot_clust_string");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot[0],$tot[1],"$tot_string");
+                
+               # species individual counts
+               my @spec_1_pos = (390,540);
+               my @spec_2_pos = (590,360);
+               my @spec_3_pos = (820,360);
+               my @spec_4_pos = (1030,540);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1_pos[0],$spec_1_pos[1],"$venn_hash{spec_1_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_2_pos[0],$spec_2_pos[1],"$venn_hash{spec_2_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_3_pos[0],$spec_3_pos[1],"$venn_hash{spec_3_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_4_pos[0],$spec_4_pos[1],"$venn_hash{spec_4_count}");
+                
+               # 2 species combinations
+               my @spec_12_pos = (490,450);
+               my @spec_13_pos = (520,660);
+               my @spec_14_pos = (720,850);
+               my @spec_23_pos = (710,450);
+               my @spec_24_pos = (900,650);
+               my @spec_34_pos = (920,450);
+               
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_12_pos[0],$spec_12_pos[1],"$venn_hash{spec_12_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_13_pos[0],$spec_13_pos[1],"$venn_hash{spec_13_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_14_pos[0],$spec_14_pos[1],"$venn_hash{spec_14_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_23_pos[0],$spec_23_pos[1],"$venn_hash{spec_23_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_24_pos[0],$spec_24_pos[1],"$venn_hash{spec_24_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_34_pos[0],$spec_34_pos[1],"$venn_hash{spec_34_count}");
+               # 
+               # 3 species combinations
+               my @spec_123_pos = (620,570);
+               my @spec_124_pos = (795,750);
+               my @spec_134_pos = (815,570);
+               my @spec_234_pos = (590,750);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_123_pos[0],$spec_123_pos[1],"$venn_hash{spec_123_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_124_pos[0],$spec_124_pos[1],"$venn_hash{spec_124_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_134_pos[0],$spec_134_pos[1],"$venn_hash{spec_134_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_234_pos[0],$spec_234_pos[1],"$venn_hash{spec_234_count}");
+               
+               # 4 species combination
+               my @spec_1234_pos = (700,650);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1234_pos[0],$spec_1234_pos[1],"$venn_hash{spec_1234_count}");
+}
 
 
+if($species_array_size == 5) {
+               
+               # Open the venn diagram png file that already has the shapes
+               $img = newFromPng GD::Image('/home/justin/scripts/jaiswallab/Personnel/elserj/venn_sources/5_set_venn_source.png',1);
+               
+               # make some colors
+               my $white = $img->colorAllocateAlpha(255,255,255,127);
+               my $black = $img->colorAllocate(0,0,0);
+               my $blue = $img->colorAllocate(0,0,205);
+               my $green = $img->colorAllocate(0,212,0);
+               my $yellow = $img->colorAllocate(192,192,0);
+               my $orange = $img->colorAllocate(255,153,51);
+               my $maroon = $img->colorAllocate(102,0,102);
+               
+               
+               #$img->transparent($white);
+               $img->interlaced('true');
+               $img->alphaBlending(1);
+               $img->saveAlpha(1);
+               
+               # define the locations for text to go
+               # species details
+               my @spec_1_det = (100,280);
+               my @spec_2_det = (400,30);
+               my @spec_3_det = (800,250);
+               my @spec_4_det = (770,575);
+               my @spec_5_det = (120,600);
+               
+               my $spec_1_det = "$venn_hash{spec_1_det_line_1}\n$venn_hash{spec_1_det}";
+               my $spec_2_det = "$venn_hash{spec_2_det_line_1}\n$venn_hash{spec_2_det}";
+               my $spec_3_det = "$venn_hash{spec_3_det_line_1}\n$venn_hash{spec_3_det}";
+               my $spec_4_det = "$venn_hash{spec_4_det_line_1}\n$venn_hash{spec_4_det}";
+               my $spec_5_det = "$venn_hash{spec_5_det_line_1}\n$venn_hash{spec_5_det}";
+               
+               $img->stringFT($blue,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_1_det[0],$spec_1_det[1],"$spec_1_det");
+               $img->stringFT($green,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_2_det[0],$spec_2_det[1],"$spec_2_det");
+               $img->stringFT($maroon,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_3_det[0],$spec_3_det[1],"$spec_3_det");
+               $img->stringFT($yellow,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_4_det[0],$spec_4_det[1],"$spec_4_det");
+               $img->stringFT($orange,'/usr/share/fonts/truetype/arial.ttf',22,0,$spec_5_det[0],$spec_5_det[1],"$spec_5_det");
+               
+               my @tot_clust = (50,50);
+               my @tot = (430,700);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot_clust[0],$tot_clust[1],"$tot_clust_string");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',22,0,$tot[0],$tot[1],"$tot_string");
+                
+               # species individual counts
+               my @spec_1_pos = (260,380);
+               my @spec_2_pos = (460,170);
+               my @spec_3_pos = (660,290);
+               my @spec_4_pos = (660,540);
+               my @spec_5_pos = (365,600);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1_pos[0],$spec_1_pos[1],"$venn_hash{spec_1_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_2_pos[0],$spec_2_pos[1],"$venn_hash{spec_2_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_3_pos[0],$spec_3_pos[1],"$venn_hash{spec_3_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_4_pos[0],$spec_4_pos[1],"$venn_hash{spec_4_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_5_pos[0],$spec_5_pos[1],"$venn_hash{spec_5_count}");
+               
+                
+               # 2 species combinations
+               my @spec_12_pos = (400,285);
+               my @spec_13_pos = (635,365);
+               my @spec_14_pos = (345,360);
+               my @spec_15_pos = (340,460);
+               my @spec_23_pos = (580,285);
+               my @spec_24_pos = (575,532);
+               my @spec_25_pos = (485,260);
+               my @spec_34_pos = (640,455);
+               my @spec_35_pos = (400,530);
+               my @spec_45_pos = (500,560);
+               
+                
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_12_pos[0],$spec_12_pos[1],"$venn_hash{spec_12_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_13_pos[0],$spec_13_pos[1],"$venn_hash{spec_13_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_14_pos[0],$spec_14_pos[1],"$venn_hash{spec_14_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_15_pos[0],$spec_15_pos[1],"$venn_hash{spec_15_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_23_pos[0],$spec_23_pos[1],"$venn_hash{spec_23_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_24_pos[0],$spec_24_pos[1],"$venn_hash{spec_24_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_25_pos[0],$spec_25_pos[1],"$venn_hash{spec_25_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_34_pos[0],$spec_34_pos[1],"$venn_hash{spec_34_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_35_pos[0],$spec_35_pos[1],"$venn_hash{spec_35_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_45_pos[0],$spec_45_pos[1],"$venn_hash{spec_45_count}");
+               
+               # 3 species combinations
+               my @spec_123_pos = (575,350);
+               my @spec_124_pos = (400,330);
+               my @spec_125_pos = (465,320);
+               my @spec_134_pos = (630,415);
+               my @spec_135_pos = (405,485);
+               my @spec_145_pos = (405,405);
+               my @spec_234_pos = (580,468);
+               my @spec_235_pos = (540,300);
+               my @spec_345_pos = (470,505);
+                
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_123_pos[0],$spec_123_pos[1],"$venn_hash{spec_123_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_124_pos[0],$spec_124_pos[1],"$venn_hash{spec_124_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_125_pos[0],$spec_125_pos[1],"$venn_hash{spec_125_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_134_pos[0],$spec_134_pos[1],"$venn_hash{spec_134_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_135_pos[0],$spec_135_pos[1],"$venn_hash{spec_135_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_145_pos[0],$spec_145_pos[1],"$venn_hash{spec_145_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_234_pos[0],$spec_234_pos[1],"$venn_hash{spec_234_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_235_pos[0],$spec_235_pos[1],"$venn_hash{spec_235_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_345_pos[0],$spec_345_pos[1],"$venn_hash{spec_345_count}");
+                
+               # 4 species combinations
+               my @spec_1234_pos = (570,415);
+               my @spec_1235_pos = (515,345);
+               my @spec_1245_pos = (445,365);
+               my @spec_1345_pos = (440,450);
+               my @spec_2345_pos = (520,480);
+                
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1234_pos[0],$spec_1234_pos[1],"$venn_hash{spec_1234_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1235_pos[0],$spec_1235_pos[1],"$venn_hash{spec_1235_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1245_pos[0],$spec_1245_pos[1],"$venn_hash{spec_1245_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_1345_pos[0],$spec_1345_pos[1],"$venn_hash{spec_1345_count}");
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_2345_pos[0],$spec_2345_pos[1],"$venn_hash{spec_2345_count}");
+               
+               # 5 species combination
+               my @spec_12345_pos = (495,410);
+               
+               $img->stringFT($black,'/usr/share/fonts/truetype/arial.ttf',14,0,$spec_12345_pos[0],$spec_12345_pos[1],"$venn_hash{spec_12345_count}");
+}
 
+# convert the image to PNG and print it
 
+open (TESTOUT, ">test.png") || die;
+my $png_data = $img->png;
+binmode TESTOUT;
+print TESTOUT $png_data;
+close TESTOUT;