In [1]:
from skbio.stats.composition import ancom
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-b7c963e5dd2d> in <module>()
----> 1 from skbio.stats.composition import ancom
2 import pandas as pd
3 import matplotlib.pyplot as plt
4 import seaborn as sns
5 get_ipython().magic(u'matplotlib inline')
ImportError: cannot import name ancom
In [2]:
table = pd.read_csv('vibrio_biom.csv', index_col=0)
mapping = pd.read_csv('vibrio_mapping.csv', index_col=0)
In [4]:
table+1
Out[4]:
VF_0001
VF_0002
VF_0003
VF_0004
VF_0005
VF_0006
VF_0007
VF_0008
VF_0009
VF_0010
...
VF_B0045
VF_B0046
VF_B0047
VF_B0048
VF_B0050
VF_B0051
VF_B0052
VF_B0053
VF_B0054
VF_B0055
Plk1
19.491139
277.545263
299.488082
23.025002
1181.063429
210.237516
106.769318
1353.893946
33.133491
56.226870
...
52.528642
24.586476
9.793564
5.026959
68.718662
19.819871
20.395151
19.162408
6.588433
57.213064
Plk2
12.628665
244.190767
686.513385
71.349809
1446.710243
69.038522
36.391588
228.083983
85.361989
98.724119
...
14.578813
5.405892
1.938960
1.866733
13.423170
4.900297
7.933862
8.872823
3.022376
45.997876
Plk3
8.939793
272.813853
876.300154
89.640346
938.205728
89.826435
42.932032
297.253528
94.292568
104.899636
...
11.110830
6.954845
2.984948
2.550741
16.383349
4.907867
3.667274
8.505586
3.419156
42.994062
Swt1
46.856251
192.837907
1519.114434
135.132496
1250.138492
11.190278
5.087960
16.107680
261.326055
256.171670
...
17.648070
57.698233
22.743209
13.263881
57.816724
12.908406
15.396730
14.982009
12.256702
23.809634
Swt2
52.073162
251.429613
684.695880
51.941530
1071.825180
8.766280
3.237742
18.243774
196.868208
173.042841
...
8.173936
17.388167
7.844857
5.607115
33.776333
6.462722
9.424439
7.318329
4.422428
11.662181
Swt3
44.505061
225.382080
781.253809
60.346578
743.423322
9.748300
3.600846
19.678803
236.494786
196.063452
...
8.802538
18.496601
6.911014
4.783049
31.500831
8.093216
10.694062
8.802538
4.073727
11.639825
Vnt1
1.000000
70.778903
646.454849
120.205625
83.862447
123.113080
128.927988
2667.135572
107.122081
105.668354
...
1.000000
66.417721
1.000000
1.000000
130.381715
22.805907
40.250633
53.334177
25.713361
112.936990
Vnt2
17.942199
185.018346
568.433340
83.886450
1088.689173
112.818513
143.314471
2107.306303
307.002178
261.909864
...
5.431037
5.431037
2.824545
1.260649
11.947267
5.170387
10.122723
7.255581
3.085194
27.064921
Vnt3
15.060796
199.555488
347.406891
70.593840
1044.765578
94.880670
78.689450
1286.781709
215.178595
200.549685
...
5.544904
3.698537
1.710141
1.284056
15.486881
5.402876
5.686932
7.533299
2.136226
29.973762
9 rows × 3692 columns
In [5]:
res = ancom(table+1, mapping['treatment'])
In [6]:
res.to_csv('vibro_results.csv')
In [ ]:
Content source: cuttlefishh/papers
Similar notebooks: