Skip to content

Commit

Permalink
only fixed mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
wrshoemaker committed Dec 10, 2019
1 parent 90e74e3 commit f9bb552
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 187 deletions.
12 changes: 7 additions & 5 deletions OUTPUTS/get_multiplicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from decimal import Decimal
from matplotlib.ticker import FormatStrFormatter

mydir = os.path.expanduser("~/Desktop/OUTPUTS")
mydir = os.path.expanduser("~/GitHub/MinimalCell/OUTPUTS")
output_to_keep = ['INS', 'DEL', 'SNP', 'SUB']
strains = ['wildtype', 'minimal']

Expand Down Expand Up @@ -52,6 +52,9 @@ def get_multiplicity(nmin = 2, FDR = 0.05):
continue
if line_split[3] + '_' + line_split[4] in sites_to_remove:
continue
frequency = float([s for s in line_split if 'frequency=' in s][0].split('=')[1])
if frequency != 1:
continue
if line_split[0] == 'SNP':
if [s for s in line_split if 'snp_type=' in s][0].split('=')[1] == 'nonsynonymous':
locus_tag = [s for s in line_split if 'locus_tag=' in s][0].split('=')[1]
Expand Down Expand Up @@ -207,7 +210,7 @@ def plot_multiplicity_survival():
ax = fig.add_subplot(2, 1, i+1)
ax.plot(new_x, new_obs_y, '-', c='royalblue', lw=4, alpha = 0.8, zorder=1)
ax.plot(new_x, new_null_y, '-', c='dimgrey', lw=4, alpha = 0.8, zorder=0)
ax.set_xlim([0.9, 16])
ax.set_xlim([0.9, 9])

taxon_par = df_par.loc[df_par['Strain'] == strain]

Expand Down Expand Up @@ -259,7 +262,7 @@ def plot_logpvalue_survival():
ax.plot([-3,pstar_i],[num_significant_i, num_significant_i],'k-',linewidth=0.5, zorder=3)
ax.plot([pstar_i], [num_significant_i], c='r', marker='o', zorder=4)

ax.set_xlim([0.25, 13])
ax.set_xlim([0.25, 8])

ax.title.set_text(strain)

Expand All @@ -278,7 +281,6 @@ def plot_logpvalue_survival():
# equal rate of evolution
#print(ttest_ind([14,23,15,20], [19,14,13,9],equal_var=False))


#get_multiplicity('wildtype')
#get_multiplicity()
#plot_multiplicity_survival()
plot_logpvalue_survival()
Binary file modified OUTPUTS/logpvalue_survival.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 13 additions & 33 deletions OUTPUTS/logpvalues_minimal.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
P_value Obs_num Null_num
0 -1.737177927613007 29.9999999999 15.192028472115947
1 1.0396078710049863 29.9999999999 10.715542225160062
2 1.0484484769651485 29.0 10.570992473925873
3 1.0938654486353419 28.0 10.213485843382948
4 1.134680881889916 27.0 9.43713000351856
5 1.1355045736305465 26.0 9.374203733639673
6 1.242182681354741 25.0 7.95526994578068
7 1.286462790246585 24.0 7.474708289459889
8 1.3247907262532956 23.0 6.947033928288505
9 1.3398459660959827 22.0 6.781765200069203
10 1.4722659876608017 21.0 5.2278851198951655
11 1.4872798998539285 20.0 5.020857847197171
12 1.5307698544574777 19.0 4.716547102122639
13 1.6491921218218102 18.0 3.803303544831646
14 1.8019563351538033 17.0 2.586222076011505
15 1.9200849537718394 16.0 1.979377331651432
16 1.9394937304964337 15.0 1.9044165865359823
17 2.029538056509108 14.0 1.4537900292944606
18 2.1505994392953194 13.0 1.0755560917811962
19 2.2318449390041937 12.0 0.9264938572208337
20 2.2410708685991176 11.0 0.9050202007710929
21 2.37815816935449 10.0 0.6307393562844744
22 2.379271110120298 9.0 0.6268791169877994
23 2.499727038247234 8.0 0.46690974346399317
24 2.9927887911262627 7.0 0.1497921102680987
25 3.204029382713634 6.0 0.09377916859605578
26 3.230518520529014 5.0 0.0863126896182413
27 3.447849303642733 4.0 0.04880921671561438
28 3.6365156646979506 3.0 0.031580225844822236
29 3.7808543456627706 2.0 0.02324262873413733
30 5.159760430335224 1.0 0.0009080394074032464
31 5.594054912238476 1e-10 0.0003253170461822428
Null_num Obs_num P_value
0 2.9715360987728516 9.9999999999 -1.737177927613007
1 1.5845850988159946 9.9999999999 1.8569443045500051
2 1.3231550795543299 9.0 1.9692409507737163
3 1.2261287027378225 8.0 2.0170962918233935
4 0.70708454037064 7.0 2.277622583003345
5 0.06423268031569343 6.0 3.2649221200866245
6 0.0626623213594894 5.0 3.277648173667463
7 0.057270316045427976 4.0 3.3272034853261343
8 0.039666846004403664 3.0 3.47514249986896
9 0.002067752625870812 2.0 4.738102643647093
10 0.0005381446171620199 1.0 5.310210345799172
11 0.00020176207093535494 1e-10 5.744504827702424
43 changes: 8 additions & 35 deletions OUTPUTS/logpvalues_wildtype.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
P_value Obs_num Null_num
0 -1.737177927613007 31.9999999999 21.522443174248384
1 0.7201107632328821 31.9999999999 20.16222142702069
2 0.7783519272729745 31.0 20.033631274599436
3 0.8584058912017213 30.0 19.799692413766024
4 0.9222412421025536 29.0 19.204380029223305
5 0.9927010124505848 28.0 18.053420582396377
6 1.0048987853307048 27.0 17.63811441628083
7 1.0190187797456174 26.0 17.316281054170872
8 1.052738978249727 25.0 16.850473058711778
9 1.2472369179192455 24.0 13.005601647324857
10 1.350793204808941 23.0 10.98433828440614
11 1.454072619451136 22.0 9.341606292474491
12 1.5138151166342804 21.0 8.510723738001952
13 1.6943715781175088 20.0 5.941971355457355
14 1.7718125741246908 19.0 5.21096002979484
15 1.851409904526334 18.0 4.309318589241818
16 1.9614119963643062 17.0 3.1732443913049986
17 2.003756582016023 16.0 2.8560435230505075
18 2.035409521672357 15.0 2.6151477751951226
19 2.19943859295504 14.0 1.7045646465824584
20 2.205729176530857 13.0 1.650666353669593
21 2.3203178979969574 12.0 1.2498505577172343
22 2.4321565161797083 11.0 1.0032947250671223
23 2.5984854919498996 10.0 0.6735262173983834
24 2.7205355118401444 9.0 0.4992527150066168
25 2.9684504211592952 8.0 0.28895496419266636
26 3.3772814202043215 7.0 0.10632149622454869
27 3.508681237053791 6.0 0.07848809625167959
28 5.629795026493096 5.0 0.000561761829916895
29 5.678718464811464 4.0 0.0005043584679609644
30 5.723418195970507 3.0 0.0004587842517773307
31 7.261530126684122 2.0 1.2812962997383891e-05
32 12.494367088652751 1.0 6.69934414403465e-11
33 12.928661570556002 1e-10 2.3061788858630227e-11
Null_num Obs_num P_value
0 0.9785355116403773 4.9999999999 -1.737177927613007
1 0.8125487101896255 4.9999999999 2.22541720569556
2 0.184243504594648 4.0 3.0822255757819375
3 0.0015777852530290204 3.0 5.113636750154589
4 0.00012818666340357748 2.0 6.103334284433141
5 0.00012585150924263492 1.0 6.104707382213682
6 4.916303322737079e-05 1e-10 6.539001864116934
13 changes: 6 additions & 7 deletions OUTPUTS/mult_genes_sig_minimal.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Gene,Length,Observed,Expected,Multiplicity,-log10(P)
JCVISYN3A_0168, 1500.0, 6, 0.44, 3.36, 5.15976
JCVISYN3A_0414, 1817.7, 5, 0.53, 2.31, 3.63652
JCVISYN3A_0002, 902.3, 4, 0.26, 3.72, 3.78085
JCVISYN3A_0129, 1265.0, 4, 0.37, 2.65, 3.23052
JCVISYN3A_0790, 1106.0, 4, 0.32, 3.03, 3.44785
JCVISYN3A_0820, 1286.0, 4, 0.38, 2.61, 3.20403
JCVISYN3A_0214, 653.3, 3, 0.19, 3.85, 2.99279
JCVISYN3A_0002, 902.3, 4, 0.11, 3.72, 5.31021
JCVISYN3A_0803, 2965.3, 4, 0.35, 1.13, 3.3272
JCVISYN3A_0129, 1265.0, 4, 0.15, 2.65, 4.7381
JCVISYN3A_0420, 1307.3, 3, 0.15, 1.93, 3.26492
JCVISYN3A_0790, 1106.0, 3, 0.13, 2.28, 3.47514
JCVISYN3A_0430, 278.7, 2, 0.03, 6.02, 3.27765
12 changes: 4 additions & 8 deletions OUTPUTS/mult_genes_sig_wildtype.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
Gene,Length,Observed,Expected,Multiplicity,-log10(P)
MMSYN1_0001, 1092.0, 10, 0.26, 8.23, 12.4944
MMSYN1_0228, 1463.3, 6, 0.35, 3.69, 5.72342
MMSYN1_0339, 1490.0, 6, 0.36, 3.62, 5.67872
MMSYN1_0641, 792.7, 6, 0.19, 6.81, 7.26153
MMSYN1_0032, 2543.7, 5, 0.61, 1.77, 3.37728
MMSYN1_0149, 368.7, 4, 0.09, 9.75, 5.6298
MMSYN1_0831, 817.3, 3, 0.20, 3.30, 2.96845
MMSYN1_0471, 105.0, 2, 0.03, 17.12, 3.50868
MMSYN1_0228, 1463.3, 4, 0.07, 2.46, 6.10333
MMSYN1_0641, 792.7, 3, 0.04, 3.40, 5.11364
MMSYN1_0149, 368.7, 3, 0.02, 7.32, 6.10471
MMSYN1_0522, 903.0, 2, 0.04, 1.99, 3.08223
Binary file modified OUTPUTS/mult_survival.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 19 additions & 43 deletions OUTPUTS/mult_survival_curves_minimal.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,19 @@
Mult Obs_fract Null_fract
0 1.044170263581297 1.0 1.0
1 1.0526843008549036 0.989010989010989 0.9471321905114924
2 1.0586604312424333 0.967032967032967 0.8944449738971829
3 1.0993425788185622 0.9560439560439561 0.8422039908524916
4 1.1122131678791707 0.945054945054945 0.7932384721509308
5 1.113442948029413 0.9230769230769231 0.7453380515650434
6 1.129934697259653 0.9010989010989011 0.6975110033272175
7 1.1299346972596533 0.8901098901098901 0.6514135366009268
8 1.1319669539094017 0.8791208791208791 0.6054867814458244
9 1.2109160680589255 0.8351648351648352 0.5603006905457628
10 1.2292453640109888 0.8241758241758241 0.5198247869295786
11 1.2506182342247916 0.8131868131868132 0.4800453470271887
12 1.2827997480226783 0.8021978021978022 0.44158218617461653
13 1.3593382859041605 0.7802197802197802 0.40444745025655593
14 1.4079946898738849 0.7582417582417582 0.36968605041965524
15 1.4287710019832618 0.7472527472527473 0.33765194965543677
16 1.456883394383395 0.7252747252747253 0.3067039595537691
17 1.4958374958374951 0.7032967032967034 0.2767741807191817
18 1.6273396932737585 0.6923076923076923 0.2482616630738117
19 1.7010098010098003 0.6813186813186813 0.22442117951244872
20 1.7260846798042557 0.6703296703296703 0.20290554691747106
21 1.7592554196327792 0.6483516483516484 0.18240912763172154
22 1.8586153602764917 0.6263736263736264 0.1629474184543394
23 1.9256714728412834 0.6043956043956044 0.14556364188192164
24 1.966792582417582 0.5714285714285714 0.12943495897197127
25 2.062393095708224 0.5604395604395604 0.11400804190629939
26 2.30835733128049 0.5274725274725275 0.0995379599579356
27 2.3310134310134334 0.4725274725274725 0.0884757033891163
28 2.3331737771033425 0.43956043956043955 0.07760373188362125
29 2.3353381312564983 0.4065934065934066 0.06683554817769202
30 2.603406934327307 0.3956043956043956 0.05607862025550479
31 2.610155008288758 0.37362637362637363 0.048217230747720934
32 2.6361199010413676 0.32967032967032966 0.04041574763126754
33 2.6534856447899906 0.31868131868131866 0.03288333932991387
34 3.03495419589452 0.27472527472527475 0.02544251422903985
35 3.0795039822562758 0.23076923076923078 0.020144336428263694
36 3.3566593406593386 0.2087912087912088 0.015025940765124927
37 3.434508193034795 0.14285714285714285 0.01093053026962551
38 3.719977104535659 0.12087912087912088 0.007149332098754071
39 3.853307916573223 0.07692307692307693 0.0043536961816344555
40 4.428310475803879 0.04395604395604396 0.0019449140669108294
41 6.022714127977288 0.02197802197802198 0.00044969511140916294
Mult Null_fract Obs_fract
0 1.1188864468864463 1.0 1.0
1 1.1299346972596531 0.8874740818592798 0.9444444444444444
2 1.1319669539094017 0.7783075946854584 0.9166666666666666
3 1.2109160680589257 0.6710827716207722 0.8055555555555556
4 1.2827997480226785 0.5765393396138554 0.7777777777777778
5 1.3593382859041607 0.49093193579729427 0.7222222222222222
6 1.407994689873885 0.41078158259101877 0.6666666666666666
7 1.4958374958374954 0.3374566137002981 0.6388888888888888
8 1.539751991128138 0.273570427263434 0.6111111111111112
9 1.6273396932737587 0.21303665079338394 0.5833333333333334
10 1.8586153602764919 0.1602498176492985 0.5555555555555556
11 1.9256714728412836 0.12249899155916247 0.5
12 2.2762156469208903 0.087957042063362 0.4166666666666667
13 2.3353381312564983 0.06269823649225932 0.3333333333333333
14 2.6361199010413676 0.03923664812092636 0.3055555555555556
15 2.653485644789991 0.02302294693656571 0.2777777777777778
16 3.7199771045356593 0.007069702357547145 0.16666666666666666
17 6.022714127977289 0.0009049126703467372 0.05555555555555555
66 changes: 13 additions & 53 deletions OUTPUTS/mult_survival_curves_wildtype.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,13 @@
Mult Obs_fract Null_fract
0 1.0977154890198375 1.0 1.0
1 1.1135784296126094 0.9907407407407407 0.958182194636165
2 1.1261323409276576 0.9814814814814815 0.9168762025695084
3 1.1277804543264627 0.9722222222222222 0.8762819223163043
4 1.1476965772432932 0.9537037037037037 0.8357727014540055
5 1.1501436914804863 0.9444444444444444 0.7964895426733012
6 1.1787967467315295 0.9351851851851852 0.7574775484674331
7 1.1793121803767994 0.9259259259259259 0.7197481526072352
8 1.1834519335330145 0.9166666666666666 0.6821826672175
9 1.2309844621276769 0.9074074074074074 0.6447486943977531
10 1.2603210077204394 0.8981481481481481 0.6105997622360979
11 1.289238506941558 0.8888888888888888 0.5779005767643641
12 1.290472228000831 0.8796296296296297 0.5467084654285401
13 1.3418343067272336 0.8611111111111112 0.5156353873210746
14 1.3732621978216597 0.8518518518518519 0.48656971423683454
15 1.3760647737355813 0.8425925925925926 0.4584074917583953
16 1.4353842238008185 0.8333333333333334 0.4305774723790208
17 1.4730130838458435 0.8240740740740741 0.4044323329079495
18 1.4838182412553103 0.8055555555555556 0.3798234093912334
19 1.5246393196844188 0.7777777777777778 0.3556176993013084
20 1.5246393196844192 0.75 0.33297611541660704
21 1.5500499750124932 0.7407407407407407 0.31034790121648725
22 1.553845286776169 0.7314814814814815 0.2886115057028287
23 1.5545169778223282 0.6944444444444444 0.26694509283666934
24 1.5800157917526296 0.6851851851851852 0.2453484748853139
25 1.5883904337583847 0.6759259259259259 0.22453979380512398
26 1.5888582954472688 0.6666666666666666 0.20414143050957234
27 1.6355894217839528 0.6481481481481481 0.1838068174663166
28 1.6495944688206357 0.6388888888888888 0.164653722543934
29 1.725583465464963 0.6296296296296297 0.14572477894978422
30 1.742304235479159 0.6203703703703703 0.12845338460320094
31 1.7671910342823607 0.6111111111111112 0.11163590995540475
32 1.852394887720974 0.5648148148148148 0.09529462788973574
33 1.9398851281623621 0.5555555555555556 0.08094356701359438
34 1.9912048405476128 0.5277777777777778 0.06789233794339346
35 2.1909723448592526 0.5092592592592593 0.055612047265425006
36 2.4156622987207714 0.49074074074074076 0.04575051381006732
37 2.5372407869442513 0.4722222222222222 0.037937225373408795
38 2.69888621399774 0.46296296296296297 0.03135829219906983
39 2.7619938110821702 0.4351851851851852 0.025817422155824627
40 3.17304347826087 0.4166666666666667 0.02065130505351992
41 3.2998616923186064 0.4074074074074074 0.017130953642137618
42 3.3545857668180843 0.37962962962962965 0.01400141534341919
43 3.620250948351326 0.37037037037037035 0.010925626289972729
44 3.679518358146983 0.3148148148148148 0.008387231454349199
45 3.686223630781417 0.2962962962962963 0.005982210771783882
46 3.707336022710293 0.24074074074074073 0.0035942104760568125
47 4.855242045943724 0.2222222222222222 0.0012889376703779773
48 6.805097451274365 0.2037037037037037 0.00041497034581448595
49 8.232866167648783 0.14814814814814814 0.00014897899432173443
50 9.754383206226903 0.05555555555555555 4.5320835827371575e-05
51 17.124361628709455 0.018518518518518517 1.2422827963253824e-06
Mult Null_fract Obs_fract
0 1.0954861724296265 1.0 1.0
1 1.2078311493603857 0.8056224571458139 0.95
2 1.2603210077204394 0.6437607053148973 0.9
3 1.3418343067272338 0.49769780957667853 0.85
4 1.4353842238008185 0.37163120309940884 0.8
5 1.5500499750124934 0.2596767427140022 0.75
6 1.635589421783953 0.1689309051182374 0.7
7 1.991204840547613 0.0905286052056596 0.65
8 2.457482420520945 0.04158304048336236 0.55
9 3.402548725637183 0.012949150812306248 0.35
10 7.3157874046701785 0.001028699687711047 0.2
11 8.562180814354727 0.000321563258474951 0.05
2 changes: 1 addition & 1 deletion OUTPUTS/mult_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def get_path():
return os.path.expanduser("~/Desktop/OUTPUTS")
return os.path.expanduser("~/GitHub/MinimalCell/OUTPUTS")


# NullMultiplicitySurvivalFunction class is modified from GitHub repo
Expand Down
Binary file added OUTPUTS/mult_tools.pyc
Binary file not shown.
Binary file modified OUTPUTS/p_star.txt
Binary file not shown.
4 changes: 2 additions & 2 deletions OUTPUTS/total_parallelism.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Strain G_score p_value
wildtype 1.9317259266548417 9.999000099990002e-05
minimal 1.9274861483412504 9.999000099990002e-05
wildtype 3.5331624084393276 9.999000099990002e-05
minimal 2.6869900951023284 9.999000099990002e-05

0 comments on commit f9bb552

Please sign in to comment.