from matplotlib_venn import venn3_unweighted
from matplotlib import pyplot as plt

ct_eu = 'rs1295685,rs466448,rs11651708,rs475007,rs1518111,rs10932201,rs4649124,rs1805247,rs16845626,rs222747,rs2295633,rs1137070,rs12377632,rs9912468'.split(',')
rr_eu = 'rs1295685,rs4680,rs7598440,rs2295633,rs16845626,rs2072743,rs2069772,rs2227306,rs10767664,rs11568817,rs10932201,rs3757351,rs743409,rs222747,rs9912468,rs1799880,rs11651708,rs2227284,rs11913721,rs2069763,rs7131056,rs2283792,rs2069812,rs1137070,rs1800797,rs12722489,rs7301328,rs1818879,rs1927914,rs1554973,rs4251961,rs1554606,rs1474347,rs12377632'.split(',')
ct_rr = 'rs1295685,rs2069772,rs466448,rs1518111,rs7301328,rs2295633'.split(',')
subsets = [set(ct_eu), set(rr_eu), set(ct_rr)]
venn3_unweighted(subsets, ('CTRLS v EU', 'RR v EU', 'CTRLS v RR'))
plt.savefig('venn_genotp.png', dpi = 300)
plt.clf()
ct_eu = 'rs1295685,rs466448,rs11651708,rs475007,rs10932201,rs4649124,rs638405,rs1805247,rs16845626,rs222747,rs1554606,rs12377632,rs9912468'.split(',')
rr_eu = 'rs1295685,rs1554606,rs7598440,rs4680,rs16845626,rs2069772,rs2227306,rs475007,rs10767664,rs11568817,rs10932201,rs3757351,rs743409,rs1805247,rs9340,rs222747,rs9912468,rs1799880,rs11651708,rs2227284,rs11913721,rs2069763,rs7131056,rs2283792,rs2069812,rs1927911,rs1800797,rs12722489,rs4845617,rs7301328,rs2227307,rs1927914,rs1554973,rs4251961,rs2295633,rs1474347,rs12377632,'.split(',')
ct_rr = 'rs1295685,rs2295633,rs466448,rs16845626'.split(',')
subsets = [set(ct_eu), set(rr_eu), set(ct_rr)]
venn3_unweighted(subsets, ('CTRLS v EU', 'RR v EU', 'CTRLS v RR'))
plt.savefig('venn_alleles.png', dpi = 300)