forked from mgymrek/pybeeswarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example_GC_content_custom_plot_sizes.py
78 lines (45 loc) · 4.61 KB
/
Example_GC_content_custom_plot_sizes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from beeswarm import *
import matplotlib.pyplot as plt
import numpy as np
# define a list of variables (GC values)
Low100pg = [-0.012860418,-0.010651103,-0.005760836,-0.006660772,0.056037625,-0.028862356,0.017553574,-0.040830516,-0.096455477,-0.000552236,-0.075167435,-0.05387145,-0.094551038,-2.79783E-06,-0.126672018,-0.093472166,-0.101102388,-0.304879604,-0.017339083,-0.014393082]
Low10pg = [0.04522036,0.011217263,0.004655303,0.003407995,0.027003936,0.025390419,0.010547368,-0.003961782,0.099446863,0.000457281,0.039666444,0.046051447,-0.082791675,0.000283163,0.026045017,0.518900354,0.093902438,0.343287566,0.211653517,0.10588291]
Low1pg =[0.369445292,0.045241247,0.01429417,0.014480799,-0.0593181,0.135779745,0.027215056,0.030466533,0.260450025,-0.000175772,0.118440824,-0.043159905,-0.159940455,-9.50193E-05,0.059809934,0.359367305,0.024036609,0.663422737,0.047163477,0.071882674]
Low100fg = [0.418055034,0.072220305,0.017351732,0.017369634,-0.135754372,0.152584075,0.045863882,0.12171371,0.408708123,0.003035351,0.187984053,0.027649676,0.035352184,-0.001218589,0.081969137,0.769043888,0.18832895,1.258536678,0.225656916,0.280380161]
Medium100pg = [-0.010581732,-0.020612349,-0.049627911,-0.003250557,-0.015978295,0.042891865,0.027332034,0.087029393,0.091074477,0.019979698,0.129651676,1.640624251,0.12365539,0.163727088,0.322713038,-0.045819351,-1.09723E-05,0.222750795,0.078371597,-0.008471466,0.043253859,1.849259787,0.092978381]
Medium10pg = [0.956437489,0.064395526,0.239847702,0.006268734,0.150476542,0.108803622,0.113663303,0.161750658,0.253118687,-0.003381801,0.155539612,4.875768678,0.228106014,0.173237944,0.293295576,-0.000364463,1.09638E-05,0.172591361,0.07151947,-0.032615377,-0.03215524,0.505408553,-0.02689245]
Medium1pg = [0.701654753,-0.033005817,0.118485945,-0.039970204,0.010055673,-0.052247947,-0.049569304,-0.105945839,0.117016968,-0.099119582,-0.056147746,2.407052936,0.006628313,-0.014705277,-0.351923844,-0.061210163,0.000126669,0.09759141,0.007857075,-0.107863709,-0.132857153,0.519453724,-0.035035033]
Medium100fg = [1.994543221,0.005557061,0.361856729,-0.005606214,0.165831772,0.003435439,0.231432947,-0.144421234,0.250968246,-0.098149306,0.044082087,3.251809952,0.224477777,-0.014964362,-0.200077911,-0.086397858,6.58988E-05,0.128327409,0.101030409,-0.144944125,-0.201838677,-0.206107291,0.037239146]
High100pg = [0.076045724,0.010960961,0.010478209,0.024966331,-1.58184E-05,-3.570361164,-0.079260468,-0.086754794,-0.103742474,-0.007231582,0.012016006,-0.05754805]
High10pg = [-0.077222957,-0.019296089,-0.003425377,-0.036955134,-0.139334776,-8.764520948,-0.171122086,-0.177510277,-0.273868612,-0.019531754,-0.106468739,-0.171840544]
High1pg = [-0.176797228,-0.046783806,-0.019020634,-0.016899092,-0.108247009,-3.782424967,-0.072621978,-0.143479001,-0.210923879,-0.01110151,-0.149060407,-0.087769519]
High100fg = [-0.157650438,-0.04021531,-0.008165567,-0.097975935,-0.198022556,-8.367885671,-0.204402057,-0.213172571,-0.260903082,-0.013687655,-0.121337346,-0.189563457]
Fake100pg = [0.076045724,0.010960961,0.010478209,0.024966331,-1.58184E-05,-0.079260468,-0.086754794,-0.103742474,-0.007231582,0.012016006,-0.05754805]
Fake10pg = [-0.077222957,-0.019296089,-0.003425377,-0.036955134,-0.139334776,-0.171122086,-0.177510277,-0.273868612,-0.019531754,-0.106468739,-0.171840544]
Fake1pg = [-0.176797228,-0.046783806,-0.019020634,-0.016899092,-0.108247009,-0.072621978,-0.143479001,-0.210923879,-0.01110151,-0.149060407,-0.087769519]
Fake100fg = [-0.157650438,-0.04021531,-0.008165567,-0.097975935,-0.198022556,-0.204402057,-0.213172571,-0.260903082,-0.013687655,-0.121337346,-0.189563457]
# print beeswarm plot
fig = plt.figure()
fig.set_size_inches((5,10))
ax1 = plt.subplot(411)
ax1.set_title('Low GC')
ax2 = plt.subplot(412)
ax2.set_title('Medium GC')
ax3 = plt.subplot(413)
ax3.set_title('High GC')
ax4 = plt.subplot(414)
ax4.set_title('High GC')
axes = [ax1, ax2, ax3, ax4]
beeswarm([Low100pg,Low10pg,Low1pg,Low100fg], method="swarm", labels=["100pg","10pg","1pg","100fg"], col=["black","red","green","blue"], ax=ax1)
beeswarm([Medium100pg,Medium10pg,Medium1pg,Medium100fg], method="swarm", labels=["100pg","10pg","1pg","100fg"], col=["black","red","green","blue"], ax=ax2)
beeswarm([High100pg,High10pg,High1pg,High100fg], method="swarm", labels=["100pg","10pg","1pg","100fg"], col=["black","red","green","blue"], ax=ax3)
beeswarm([Fake100pg,Fake10pg,Fake1pg,Fake100fg], method="swarm", labels=["100pg","10pg","1pg","100fg"], col=["black","red","green","blue"], ax=ax4)
# set y-axes
#ax2.set_xlim([0, 100])
ax1.set_ylim([-10, 6])
ax2.set_ylim([-10, 6])
ax3.set_ylim([-10, 6])
#ax4.set_ylim([-1.4, 0.4])
plt.tight_layout()
#show plot
plt.show()