Last updated: 2022-09-23
Checks: 6 1
Knit directory: Immunue_Cell_Study/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20220920)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 716cb2a. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.Rhistory
Untracked files:
Untracked: analysis/12month_analysis_GEE.Rmd
Untracked: analysis/6week_analysis_GEE.Rmd
Unstaged changes:
Modified: analysis/12month_analysis.Rmd
Modified: analysis/6week_analysis.Rmd
Modified: analysis/glm without modeling correlation.Rmd
Modified: analysis/marginal_model_complete.Rmd
Modified: analysis/marginal_model_with_independence.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/12month_analysis.Rmd
) and HTML (docs/12month_analysis.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 9600acc | Jie Zhou | 2022-09-22 | unify the data reading |
html | 9600acc | Jie Zhou | 2022-09-22 | unify the data reading |
Rmd | 8caf0a0 | Jie Zhou | 2022-09-21 | title changed |
html | 8caf0a0 | Jie Zhou | 2022-09-21 | title changed |
Rmd | 1c9b204 | Jie Zhou | 2022-09-21 | title changed |
html | 1c9b204 | Jie Zhou | 2022-09-21 | title changed |
Rmd | e75d82e | Jie Zhou | 2022-09-20 | add the remote repo |
html | e75d82e | Jie Zhou | 2022-09-20 | add the remote repo |
Rmd | 5bf2b3b | Jie Zhou | 2022-09-20 | add the remote repo |
html | 5bf2b3b | Jie Zhou | 2022-09-20 | add the remote repo |
html | d93bb2c | Jie Zhou | 2022-09-20 | add the remote repo |
Rmd | 098d058 | Jie Zhou | 2022-09-20 | immune cell |
html | 098d058 | Jie Zhou | 2022-09-20 | immune cell |
source("./code/datacleaning.r")
index=which(longidata$time==12)
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
#if (length(which(y1>0))<=5){next}
fm=try({glm(cbind(y1,y2)~bcell + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver, data=longibcell[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~bcell + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver ,data=longibcell[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=p.adjust(rrbcell[,2],method = "BH")
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
3 Akkermansia 0.201598646 0.000000e+00 0.197423726
4 Alistipes 0.184264165 0.000000e+00 0.179691884
6 Anaerostipes 0.129709121 0.000000e+00 0.127950483
8 Bacteroides 0.055393067 0.000000e+00 0.054532261
17 Clostridium_XlVa -0.100061724 0.000000e+00 -0.102292728
19 Collinsella -0.236731853 0.000000e+00 -0.245231096
21 Coprococcus 0.307293676 0.000000e+00 0.300571027
23 Dialister -0.409915080 0.000000e+00 -0.428708701
27 Escherichia/Shigella -0.192830795 0.000000e+00 -0.198978105
31 F__Erysipelotrichaceae -0.132071709 0.000000e+00 -0.137934202
32 F__Lachnospiraceae -0.137449423 0.000000e+00 -0.138834462
37 Fusicatenibacter -0.337653577 0.000000e+00 -0.341374600
38 Fusobacterium 0.341170571 0.000000e+00 0.327688289
48 Parasutterella -0.419984366 0.000000e+00 -0.439636893
52 Prevotella -0.374444494 0.000000e+00 -0.379878300
56 Romboutsia 0.251480819 0.000000e+00 0.242966203
59 Ruminococcus -0.214455518 0.000000e+00 -0.220327032
67 Veillonella -0.129641185 0.000000e+00 -0.133661797
70 Dorea -0.213575478 0.000000e+00 -0.218145209
62 Streptococcus 0.033363570 1.314048e-277 0.031526792
57 Roseburia -0.063830428 1.410967e-229 -0.067697806
34 Faecalibacterium -0.029948069 9.953606e-217 -0.031816097
45 Megasphaera -0.134295755 2.730847e-208 -0.142842220
25 Eisenbergiella 0.149690754 5.293549e-208 0.140157918
55 Robinsoniella -1.434218609 6.746534e-206 -1.526025271
47 Parabacteroides 0.083517526 8.142713e-175 0.077710346
33 F__Ruminococcaceae 0.070693380 1.596257e-170 0.065715668
20 Coprobacillus -0.261847977 1.321940e-153 -0.281287208
11 Butyricicoccus -0.136947130 5.743208e-125 -0.148235920
9 Bifidobacterium 0.011467993 1.134657e-104 0.010433472
41 Haemophilus -0.160229367 4.120157e-97 -0.175246676
72 Ethanoligenens -0.169154928 1.241135e-68 -0.188091436
65 Terrisporobacter -0.099940387 5.178985e-64 -0.111536802
75 Turicibacter -0.444360870 3.472235e-63 -0.496267635
28 Eubacterium -0.095227276 7.022187e-55 -0.107189967
69 Clostridium_XlVb -0.512776084 2.417335e-38 -0.590398528
24 Eggerthella -0.045362920 3.032552e-30 -0.053143098
68 Anaerofustis -0.692355715 2.358384e-24 -0.825616955
7 Anaerotruncus -0.136252542 1.639557e-20 -0.165019078
60 Ruminococcus2 0.015241060 4.317307e-20 0.011986921
61 Staphylococcus 0.141419499 8.725287e-16 0.106959433
26 Enterococcus 0.020712932 1.919388e-15 0.015604063
46 O__Clostridiales -0.157241935 2.769699e-14 -0.197747691
10 Blautia -0.003175751 2.163117e-13 -0.004023967
12 Catabacter -0.420940823 5.946383e-13 -0.535503125
71 Dysgonomonas -0.457351829 2.070425e-12 -0.584870090
42 Hungatella -0.051851623 5.211338e-12 -0.066581136
18 Clostridium_sensu_stricto 0.013193567 6.568373e-12 0.009427679
58 Rothia -0.206847988 1.875732e-11 -0.267220132
51 Phascolarctobacterium 0.101643693 2.334061e-11 0.071835420
13 Citrobacter 0.141405419 4.588315e-10 0.096936696
63 Subdoligranulum 0.029979066 1.651420e-08 0.019570112
35 Finegoldia -0.131391123 1.196321e-05 -0.190210554
29 F__Coriobacteriaceae -0.297510241 1.498376e-05 -0.432213386
1 Acinetobacter 0.100558125 3.703265e-05 0.052780717
40 Granulicatella -0.040008780 5.141257e-05 -0.059375305
43 Intestinibacter -0.020393884 6.225595e-05 -0.030376673
54 Raoultella -0.225740723 1.870086e-04 -0.344171628
16 Clostridium_XVIII -0.003742513 2.226971e-04 -0.005729452
14 Clostridium_IV 0.009418773 2.550690e-04 0.004370862
73 F__Peptostreptococcaceae 0.024778914 5.231866e-03 0.007386465
50 Peptostreptococcus -0.123543514 7.002902e-03 -0.213336494
22 Corynebacterium 0.181191984 1.119971e-02 0.041176380
36 Flavonifractor 0.009584052 1.187409e-02 0.002117536
15 Clostridium_XI -0.016159999 2.729831e-02 -0.030509960
2 Actinomyces -0.032161173 4.649386e-02 -0.063823472
39 Gemella -0.046764606 4.747901e-02 -0.093010082
66 Unclassified -0.260628827 5.330320e-02 -0.524972435
49 Peptoniphilus -0.067780081 5.578188e-02 -0.137235025
5 Anaerococcus -0.069237305 6.413221e-02 -0.142541512
64 Sutterella -0.008726753 7.316567e-02 -0.018272728
30 F__Enterobacteriaceae 0.040171062 8.765739e-02 -0.005929939
upper fdr
3 0.2057735659 0.000000e+00
4 0.1888364459 0.000000e+00
6 0.1314677587 0.000000e+00
8 0.0562538734 0.000000e+00
17 -0.0978307199 0.000000e+00
19 -0.2282326094 0.000000e+00
21 0.3140163260 0.000000e+00
23 -0.3911214593 0.000000e+00
27 -0.1866834840 0.000000e+00
31 -0.1262092171 0.000000e+00
32 -0.1360643842 0.000000e+00
37 -0.3339325548 0.000000e+00
38 0.3546528535 0.000000e+00
48 -0.4003318400 0.000000e+00
52 -0.3690106886 0.000000e+00
56 0.2599954345 0.000000e+00
59 -0.2085840028 0.000000e+00
67 -0.1256205728 0.000000e+00
70 -0.2090057470 0.000000e+00
62 0.0352003479 4.927681e-277
57 -0.0599630511 5.039169e-229
34 -0.0280800414 3.393275e-216
45 -0.1257492903 8.904935e-208
25 0.1592235908 1.654234e-207
55 -1.3424119459 2.023960e-205
47 0.0893247053 2.348860e-174
33 0.0756710907 4.434047e-170
20 -0.2424087464 3.540911e-153
11 -0.1256583412 1.485312e-124
9 0.0125025140 2.836642e-104
41 -0.1452120583 9.968121e-97
72 -0.1502184201 2.908910e-68
65 -0.0883439713 1.177042e-63
75 -0.3924541059 7.659342e-63
28 -0.0832645843 1.504754e-54
69 -0.4351536404 5.036115e-38
24 -0.0375827416 6.147066e-30
68 -0.5590944752 4.654706e-24
7 -0.1074860055 3.152994e-20
60 0.0184951988 8.094951e-20
61 0.1758795649 1.596089e-15
26 0.0258218001 3.427478e-15
46 -0.1167361787 4.830871e-14
10 -0.0023275345 3.687131e-13
12 -0.3063785206 9.910638e-13
71 -0.3298335680 3.375692e-12
42 -0.0371221107 8.315964e-12
18 0.0169594553 1.026308e-11
58 -0.1464758438 2.871018e-11
51 0.1314519648 3.501091e-11
13 0.1858741407 6.747521e-10
63 0.0403880201 2.381856e-08
35 -0.0725716921 1.692907e-05
29 -0.1628070959 2.081078e-05
1 0.1483355325 5.049906e-05
40 -0.0206422551 6.885611e-05
43 -0.0104110950 8.191572e-05
54 -0.1073098186 2.418214e-04
16 -0.0017555740 2.830896e-04
14 0.0144666834 3.188362e-04
73 0.0421713629 6.432622e-03
50 -0.0337505343 8.471253e-03
22 0.3212075877 1.333299e-02
36 0.0170505676 1.391495e-02
15 -0.0018100391 3.149805e-02
2 -0.0004988746 5.283394e-02
39 -0.0005191305 5.314815e-02
66 0.0037147801 5.879029e-02
49 0.0016748627 6.063248e-02
5 0.0040669019 6.871309e-02
64 0.0008192207 7.728768e-02
30 0.0862720640 9.130978e-02
<>
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
#if (length(which(y1>0))<=5){next}
fm=try({glm(cbind(y1,y2)~cd4t + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver, data=longicd4[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~cd4t + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longicd4[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=p.adjust(rrbcell[,2],method = "BY")
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
4 Alistipes 0.14083310 0.000000e+00 0.137281531
9 Bacteroides 0.01366460 0.000000e+00 0.013033210
10 Bifidobacterium 0.02589530 0.000000e+00 0.025167533
11 Blautia -0.03747060 0.000000e+00 -0.038062466
14 Clostridium_XI 0.29774336 0.000000e+00 0.282755966
15 Clostridium_XVIII 0.02088588 0.000000e+00 0.019851945
18 Collinsella -0.14472530 0.000000e+00 -0.149359381
23 Eisenbergiella -0.11737226 0.000000e+00 -0.122543808
24 Enterococcus 0.13749621 0.000000e+00 0.135454944
25 Escherichia/Shigella 0.04715286 0.000000e+00 0.044790305
26 Eubacterium -0.15852357 0.000000e+00 -0.166634864
30 F__Lachnospiraceae -0.13870467 0.000000e+00 -0.139704951
31 F__Ruminococcaceae 0.07024573 0.000000e+00 0.066688982
34 Flavonifractor -0.11833356 0.000000e+00 -0.123513931
35 Fusicatenibacter -0.03846767 0.000000e+00 -0.040218063
37 Gemmiger 0.08706767 0.000000e+00 0.084267702
39 Haemophilus -0.58719812 0.000000e+00 -0.608092373
41 Intestinibacter -0.12352135 0.000000e+00 -0.128490064
42 Lactobacillus -0.38219478 0.000000e+00 -0.386565473
44 Megasphaera 0.14612393 0.000000e+00 0.139737187
46 Parabacteroides 0.14772984 0.000000e+00 0.141951971
58 Streptococcus 0.03690582 0.000000e+00 0.035421449
59 Subdoligranulum -0.28312290 0.000000e+00 -0.291941714
62 Veillonella -0.06794873 0.000000e+00 -0.070265540
66 Dorea -0.12998886 0.000000e+00 -0.132666659
16 Clostridium_XlVa -0.02259590 5.351787e-265 -0.023869370
13 Clostridium_IV -0.05330995 1.960375e-253 -0.056382774
68 Ethanoligenens -0.21053580 2.678551e-204 -0.224065709
6 Anaerostipes 0.02197317 3.499351e-202 0.020553632
55 Ruminococcus -0.05260731 4.067545e-198 -0.056040971
3 Akkermansia 0.04761504 1.215491e-197 0.044503452
60 Sutterella 0.10815797 5.927826e-159 0.100266495
47 Parasutterella 0.15361746 4.815822e-146 0.141917563
21 Dialister -0.13421552 5.505453e-143 -0.144548004
32 Faecalibacterium -0.01156575 2.367074e-141 -0.012461331
69 F__Peptostreptococcaceae -0.10628053 3.174423e-115 -0.115410479
64 Catenibacterium -0.15387102 4.125634e-112 -0.167274741
53 Romboutsia -0.08900399 9.229604e-104 -0.097068800
17 Clostridium_sensu_stricto 0.02328897 3.147171e-64 0.020591364
54 Roseburia 0.01804339 9.307808e-64 0.015945455
38 Granulicatella -0.13947070 8.122385e-55 -0.157001809
29 F__Erysipelotrichaceae 0.01994846 2.681864e-51 0.017353402
71 Turicibacter -0.14902866 3.548621e-50 -0.168638935
56 Ruminococcus2 0.01142191 6.657201e-28 0.009377409
50 Phascolarctobacterium 0.14650335 1.082373e-24 0.118512606
22 Eggerthella -0.02457923 2.863100e-18 -0.030105980
20 Coprococcus -0.01602409 1.122718e-17 -0.019692897
28 F__Enterobacteriaceae -0.16049148 1.094334e-16 -0.198417744
49 Peptostreptococcus -0.32771925 6.016582e-16 -0.407127238
67 Dysgonomonas 0.15819165 9.151443e-15 0.118187173
12 Butyricicoccus -0.02602126 1.250903e-13 -0.032902892
7 Anaerotruncus -0.04876119 1.080030e-11 -0.062825375
36 Gemella -0.15492172 1.015413e-10 -0.201892109
70 Oscillibacter -0.05175641 7.029614e-09 -0.069276068
63 Anaerofustis -0.15758938 4.692093e-08 -0.214132992
43 Lactococcus 0.02320606 8.153642e-07 0.013983215
61 Terrisporobacter -0.01600788 2.735758e-06 -0.022698139
19 Coprobacillus -0.01985282 1.006943e-05 -0.028664956
27 F__Coriobacteriaceae -0.10563013 1.031487e-03 -0.168716065
48 Peptoniphilus -0.05434756 1.334492e-03 -0.087547703
51 Pseudomonas 0.04081661 2.810777e-03 0.014040049
33 Finegoldia -0.03456849 3.481252e-03 -0.057758479
40 Hungatella 0.01200567 3.621021e-03 0.003917759
1 Acinetobacter -0.06281612 6.265959e-03 -0.107856643
65 Clostridium_XlVb -0.03409664 9.414520e-03 -0.059833686
57 Staphylococcus -0.03027234 1.034381e-02 -0.053412375
52 Raoultella 0.06797150 1.864036e-02 0.011344143
upper fdr
4 0.144384666 0.000000e+00
9 0.014295981 0.000000e+00
10 0.026623059 0.000000e+00
11 -0.036878735 0.000000e+00
14 0.312730754 0.000000e+00
15 0.021919806 0.000000e+00
18 -0.140091222 0.000000e+00
23 -0.112200717 0.000000e+00
24 0.139537467 0.000000e+00
25 0.049515420 0.000000e+00
26 -0.150412277 0.000000e+00
30 -0.137704381 0.000000e+00
31 0.073802476 0.000000e+00
34 -0.113153187 0.000000e+00
35 -0.036717282 0.000000e+00
37 0.089867640 0.000000e+00
39 -0.566303866 0.000000e+00
41 -0.118552631 0.000000e+00
42 -0.377824097 0.000000e+00
44 0.152510671 0.000000e+00
46 0.153507718 0.000000e+00
58 0.038390185 0.000000e+00
59 -0.274304086 0.000000e+00
62 -0.065631918 0.000000e+00
66 -0.127311060 0.000000e+00
16 -0.021322427 7.083530e-264
13 -0.050237129 2.498617e-252
68 -0.197005883 3.292048e-203
6 0.023392702 4.152541e-201
55 -0.049173658 4.665901e-197
3 0.050726629 1.349318e-196
60 0.116049448 6.374847e-158
47 0.165317362 5.022048e-145
21 -0.123883041 5.572351e-142
32 -0.010670163 2.327385e-140
69 -0.097150573 3.034496e-114
64 -0.140467308 3.837190e-111
53 -0.080939177 8.358412e-103
17 0.025986580 2.777027e-63
54 0.020141324 8.007773e-63
38 -0.121939598 6.817482e-54
29 0.022543523 2.197413e-50
71 -0.129418392 2.839982e-49
56 0.013466412 5.206709e-27
50 0.174494101 8.277299e-24
22 -0.019052478 2.141919e-17
20 -0.012355285 8.220476e-17
28 -0.122565212 7.845721e-16
49 -0.248311262 4.225500e-15
67 0.198196124 6.298598e-14
12 -0.019139628 8.440685e-13
7 -0.034697007 7.147544e-11
36 -0.107951334 6.593122e-10
70 -0.034236760 4.479835e-08
63 -0.101045765 2.935812e-07
43 0.032428906 5.010579e-06
61 -0.009317625 1.651685e-05
19 -0.011040690 5.974495e-05
27 -0.042544204 6.016392e-03
48 -0.021147424 7.654010e-03
51 0.067593180 1.585700e-02
33 -0.011378494 1.932271e-02
40 0.020093575 1.977948e-02
1 -0.017775590 3.369240e-02
65 -0.008359590 4.984357e-02
57 -0.007132310 5.393381e-02
52 0.124598860 9.574228e-02
<>
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
#if (length(which(y1>0))<=5){next}
fm=try({glm(cbind(y1,y2)~cd8t + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longicd8[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~cd8t + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longicd8[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=p.adjust(rrbcell[,2],method = "BY")
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
3 Akkermansia 0.165297686 0.000000e+00 0.159067460
4 Alistipes 0.179273438 0.000000e+00 0.175171933
6 Anaerostipes 0.109196415 0.000000e+00 0.106960739
10 Bifidobacterium 0.093523008 0.000000e+00 0.092252581
11 Blautia -0.142654289 0.000000e+00 -0.143821439
15 Clostridium_XVIII 0.044723044 0.000000e+00 0.042463692
21 Dialister -0.388733180 0.000000e+00 -0.404440341
24 Enterococcus 0.417085647 0.000000e+00 0.413204330
25 Escherichia/Shigella 0.178742339 0.000000e+00 0.173835225
31 F__Ruminococcaceae -0.222760888 0.000000e+00 -0.229610138
32 Faecalibacterium -0.175642122 0.000000e+00 -0.177854922
35 Fusicatenibacter -0.074542378 0.000000e+00 -0.077629888
38 Gemmiger -0.167187554 0.000000e+00 -0.171852807
40 Haemophilus 0.545444045 0.000000e+00 0.524067567
43 Lactobacillus 0.385157536 0.000000e+00 0.381255529
55 Romboutsia 0.499850717 0.000000e+00 0.485819830
56 Roseburia 0.109554566 0.000000e+00 0.106420907
58 Ruminococcus -0.167936398 0.000000e+00 -0.173671857
59 Ruminococcus2 -0.126969925 0.000000e+00 -0.130930279
61 Streptococcus 0.111427892 0.000000e+00 0.109129379
69 Dorea -0.283343316 0.000000e+00 -0.287972726
45 Megasphaera -0.196616422 3.676515e-241 -0.208236841
16 Clostridium_XlVa 0.037490263 1.596667e-196 0.035033281
42 Intestinibacter 0.116396850 1.938122e-182 0.108476365
36 Fusobacterium 0.325942659 4.671483e-180 0.303615235
18 Collinsella -0.106645421 1.219236e-163 -0.114312871
14 Clostridium_XI 0.305401402 7.724892e-153 0.282671268
54 Robinsoniella -0.505321020 1.515738e-144 -0.544009280
64 Terrisporobacter -0.168916562 3.511705e-139 -0.182099592
30 F__Lachnospiraceae -0.017934621 4.725387e-130 -0.019383356
66 Veillonella -0.050387724 1.457832e-124 -0.054548120
63 Sutterella -0.156305560 2.090400e-115 -0.169722136
26 Eubacterium -0.154376474 5.875552e-102 -0.168490387
13 Clostridium_IV -0.067622463 6.572626e-99 -0.073901298
62 Subdoligranulum -0.140934856 8.093609e-98 -0.154095039
51 Phascolarctobacterium 0.398494840 3.217068e-79 0.357049293
17 Clostridium_sensu_stricto -0.048125415 4.862513e-73 -0.053343500
20 Coprococcus -0.056599279 1.609862e-54 -0.063733681
12 Butyricicoccus -0.076898075 1.247124e-47 -0.087294000
22 Eggerthella -0.073834278 1.185934e-45 -0.084038495
71 Ethanoligenens 0.146412852 4.348486e-45 0.126046617
34 Flavonifractor 0.058902838 1.137217e-43 0.050571972
57 Rothia 0.624476157 9.683292e-41 0.532895677
46 O__Clostridiales -0.256571318 5.449111e-33 -0.298602126
72 F__Peptostreptococcaceae 0.090939336 6.837469e-33 0.076018390
29 F__Erysipelotrichaceae -0.034204620 2.946811e-31 -0.039969777
7 Anaerotruncus -0.180331827 9.138120e-30 -0.211523037
9 Bacteroides 0.006271047 7.793125e-28 0.005147075
68 Clostridium_XlVb -0.321999077 1.224823e-27 -0.379929238
28 F__Enterobacteriaceae 0.330636657 8.965112e-25 0.267577379
47 Parabacteroides 0.035023727 4.337539e-20 0.027545354
8 Anaerovorax -0.579178127 2.204530e-19 -0.705273955
23 Eisenbergiella 0.053285455 1.109268e-18 0.041448953
37 Gemella 0.217212114 1.346721e-17 0.167357894
48 Parasutterella -0.061061763 2.563489e-14 -0.076770728
41 Hungatella 0.051055852 8.718175e-12 0.036396277
2 Actinomyces 0.110699547 8.743981e-11 0.077253570
33 Finegoldia -0.216719661 1.411085e-10 -0.282938052
27 F__Coriobacteriaceae -0.782921161 9.967137e-10 -1.034073641
44 Lactococcus -0.055395412 3.262674e-08 -0.075040870
39 Granulicatella 0.052714340 3.796598e-07 0.032371264
53 Raoultella -0.325710313 5.864688e-07 -0.453500687
52 Pseudomonas -0.160290341 8.733253e-07 -0.224168890
49 Peptoniphilus -0.174431308 4.232223e-06 -0.248760035
50 Peptostreptococcus -0.263563845 7.855530e-06 -0.379154679
19 Coprobacillus -0.035678122 5.164851e-05 -0.052952935
1 Acinetobacter -0.160432087 2.761917e-04 -0.246897838
5 Anaerococcus -0.127239154 1.249751e-03 -0.204514473
67 Anaerofustis -0.139964806 1.528627e-03 -0.226526590
75 Turicibacter -0.053573636 5.967022e-03 -0.091762748
upper fdr
3 0.171527912 0.000000e+00
4 0.183374943 0.000000e+00
6 0.111432092 0.000000e+00
10 0.094793435 0.000000e+00
11 -0.141487140 0.000000e+00
15 0.046982395 0.000000e+00
21 -0.373026018 0.000000e+00
24 0.420966964 0.000000e+00
25 0.183649454 0.000000e+00
31 -0.215911639 0.000000e+00
32 -0.173429322 0.000000e+00
35 -0.071454868 0.000000e+00
38 -0.162522300 0.000000e+00
40 0.566820522 0.000000e+00
43 0.389059543 0.000000e+00
55 0.513881604 0.000000e+00
56 0.112688225 0.000000e+00
58 -0.162200940 0.000000e+00
59 -0.123009571 0.000000e+00
61 0.113726406 0.000000e+00
69 -0.278713906 0.000000e+00
45 -0.184996003 6.143151e-240
16 0.039947245 2.551902e-195
42 0.124317336 2.968570e-181
36 0.348270082 6.868980e-179
18 -0.098977970 1.723821e-162
14 0.328131537 1.051735e-151
54 -0.466632759 1.989956e-143
64 -0.155733533 4.451409e-138
30 -0.016485886 5.790201e-129
66 -0.046227329 1.728715e-123
63 -0.142888984 2.401358e-114
26 -0.140262562 6.545038e-101
13 -0.061343628 7.106201e-98
62 -0.127774673 8.500641e-97
51 0.439940386 3.284998e-78
17 -0.042907329 4.830995e-72
20 -0.049464877 1.557337e-53
12 -0.066502150 1.175500e-46
22 -0.063630060 1.089878e-44
71 0.166779086 3.898807e-44
34 0.067233704 9.953398e-43
57 0.716056637 8.278126e-40
46 -0.214540509 4.552506e-32
72 0.105860282 5.585478e-32
29 -0.028439463 2.354897e-30
7 -0.149140618 7.147209e-29
9 0.007395019 5.968262e-27
68 -0.264068917 9.188715e-27
28 0.393695934 6.591180e-24
47 0.042502100 3.126444e-19
8 -0.453082298 1.558440e-18
23 0.065121957 7.693750e-18
37 0.267066334 9.167723e-17
48 -0.045352798 1.713351e-13
41 0.065715427 5.722885e-11
2 0.144145524 5.639127e-10
33 -0.150501270 8.943402e-10
27 -0.531768680 6.210062e-09
44 -0.035749954 1.998941e-07
39 0.073057415 2.287927e-06
53 -0.197919939 3.477208e-06
52 -0.096411793 5.095807e-06
49 -0.100102581 2.430894e-05
50 -0.147973012 4.442625e-05
19 -0.018403309 2.876679e-04
1 -0.073966336 1.515351e-03
5 -0.049963835 6.756036e-03
67 -0.053403022 8.143855e-03
75 -0.015384525 3.133553e-02
<>
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
# if (length(which(y1>0))<=5) {next}
fm=try({glm(cbind(y1,y2)~mono + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longimono[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~mono + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longimono[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=p.adjust(rrbcell[,2],method = "BH")
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
4 Alistipes -0.289642044 0.000000e+00 -0.2996513339
6 Anaerostipes -0.059096416 0.000000e+00 -0.0619893767
10 Bifidobacterium -0.082399852 0.000000e+00 -0.0839225558
11 Blautia -0.089579656 0.000000e+00 -0.0908890848
15 Clostridium_XI 0.878405195 0.000000e+00 0.8423598966
16 Clostridium_XVIII 0.169801904 0.000000e+00 0.1672944256
18 Clostridium_sensu_stricto 0.273738252 0.000000e+00 0.2679112006
24 Eisenbergiella 0.367757633 0.000000e+00 0.3533476249
33 Faecalibacterium -0.119158644 0.000000e+00 -0.1213167551
43 Lactobacillus 0.816264442 0.000000e+00 0.8079056919
47 Parabacteroides -0.294314986 0.000000e+00 -0.3039670762
51 Prevotella -0.258119480 0.000000e+00 -0.2635526700
59 Ruminococcus2 -0.138885933 0.000000e+00 -0.1440966209
66 Veillonella 0.133932352 0.000000e+00 0.1294069602
69 Dorea -0.471027793 0.000000e+00 -0.4785130914
25 Enterococcus -0.098982845 8.139571e-305 -0.1041814704
45 Megasphaera 0.177426759 4.489544e-255 0.1672329705
37 Fusobacterium -0.369199806 7.669836e-203 -0.3930120720
71 Ethanoligenens -1.052030838 2.009609e-197 -1.1208182637
19 Collinsella -0.138543456 9.676858e-170 -0.1483214117
55 Romboutsia 0.168357575 1.162260e-152 0.1558198354
26 Escherichia/Shigella 0.067403813 2.714443e-126 0.0618773023
58 Ruminococcus 0.099140077 1.049956e-115 0.0906415276
42 Intestinibacter 0.108071829 3.220787e-108 0.0984868088
48 Parasutterella 0.267718549 1.231481e-85 0.2409625005
46 O__Clostridiales -0.499575062 2.098580e-83 -0.5501819347
20 Coprobacillus -0.253847840 3.230033e-80 -0.2800805714
54 Robinsoniella -0.591778380 7.136233e-67 -0.6589170451
3 Akkermansia 0.045067291 6.979052e-48 0.0389912803
44 Lactococcus -0.128193504 2.464232e-43 -0.1463974987
74 Slackia 0.668602398 4.620048e-42 0.5721707923
27 Eubacterium -0.098298484 9.318955e-40 -0.1128993460
64 Terrisporobacter -0.094481027 5.410186e-36 -0.1092654097
23 Eggerthella 0.065371140 5.817984e-32 0.0544818407
30 F__Erysipelotrichaceae -0.035941540 1.278704e-28 -0.0422889528
70 Dysgonomonas -0.725526775 1.007723e-27 -0.8558424515
63 Sutterella -0.071271710 3.101876e-25 -0.0847313407
31 F__Lachnospiraceae 0.009239598 5.483846e-23 0.0074052299
39 Granulicatella -0.139351891 1.151854e-21 -0.1679151177
34 Finegoldia -0.322587962 1.222294e-16 -0.3989408999
67 Anaerofustis 0.396532200 1.191005e-15 0.2994470726
22 Dialister -0.053557720 3.880068e-13 -0.0680174660
73 Oscillibacter -0.131435442 3.803855e-12 -0.1685326406
32 F__Ruminococcaceae -0.026584868 1.568691e-11 -0.0343141758
28 F__Coriobacteriaceae 0.563186520 1.523552e-10 0.3907914055
62 Subdoligranulum -0.047202216 5.319260e-10 -0.0621016552
72 F__Peptostreptococcaceae 0.057908987 1.040849e-09 0.0393113623
38 Gemella -0.221557473 3.668141e-09 -0.2951782956
57 Rothia 0.276717546 7.938665e-08 0.1756903211
12 Butyricicoccus 0.042869777 2.204085e-07 0.0266526814
56 Roseburia -0.010760566 1.525240e-06 -0.0151472434
53 Raoultella 0.250107709 5.614503e-06 0.1421414366
75 Turicibacter -0.091619871 1.490125e-05 -0.1330907744
5 Anaerococcus -0.249897948 1.585801e-05 -0.3633716067
52 Pseudomonas -0.136147650 7.338420e-05 -0.2034482357
36 Fusicatenibacter -0.008354257 1.428495e-04 -0.0126596904
13 Catabacter 0.175469947 1.080319e-03 0.0702543867
8 Anaerovorax -0.173712874 2.128599e-03 -0.2845569588
49 Peptoniphilus -0.149931526 2.539005e-03 -0.2472814758
29 F__Enterobacteriaceae -0.112314770 5.913643e-03 -0.1922909430
41 Hungatella 0.025293796 1.387427e-02 0.0051451290
17 Clostridium_XlVa 0.003184086 1.454374e-02 0.0006300886
9 Bacteroides 0.001523161 2.862907e-02 0.0001590678
61 Streptococcus -0.003103506 3.005807e-02 -0.0059075457
7 Anaerotruncus -0.033036409 5.405138e-02 -0.0666486059
68 Clostridium_XlVb 0.052823495 5.648705e-02 -0.0014607148
upper fdr
4 -0.2796327549 0.000000e+00
6 -0.0562034558 0.000000e+00
10 -0.0808771477 0.000000e+00
11 -0.0882702268 0.000000e+00
15 0.9144504932 0.000000e+00
16 0.1723093830 0.000000e+00
18 0.2795653037 0.000000e+00
24 0.3821676411 0.000000e+00
33 -0.1170005324 0.000000e+00
43 0.8246231919 0.000000e+00
47 -0.2846628960 0.000000e+00
51 -0.2526862902 0.000000e+00
59 -0.1336752448 0.000000e+00
66 0.1384577446 0.000000e+00
69 -0.4635424951 0.000000e+00
25 -0.0937842189 3.815424e-304
45 0.1876205473 1.980681e-254
37 -0.3453875406 3.195765e-202
71 -0.9832434120 7.932667e-197
19 -0.1287654998 3.628822e-169
55 0.1808953145 4.150929e-152
26 0.0729303241 9.253784e-126
58 0.1076386261 3.423769e-115
42 0.1176568486 1.006496e-107
48 0.2944745965 3.694444e-85
46 -0.4489681889 6.053596e-83
20 -0.2276151079 8.972314e-80
54 -0.5246397149 1.911491e-66
3 0.0511433025 1.804927e-47
44 -0.1099895087 6.160580e-43
74 0.7650340031 1.117753e-41
27 -0.0836976220 2.184130e-39
64 -0.0796966435 1.229588e-35
23 0.0762604390 1.283379e-31
30 -0.0295941263 2.740080e-28
70 -0.5952110987 2.099423e-27
63 -0.0578120800 6.287586e-25
31 0.0110739668 1.082338e-22
39 -0.1107886638 2.215104e-21
34 -0.2462350250 2.291802e-16
67 0.4936173265 2.178668e-15
22 -0.0390979738 6.928694e-13
73 -0.0943382442 6.634631e-12
32 -0.0188555611 2.673906e-11
28 0.7355816343 2.539253e-10
62 -0.0323027769 8.672706e-10
72 0.0765066108 1.660929e-09
38 -0.1479366507 5.731471e-09
57 0.3777447719 1.215102e-07
12 0.0590868729 3.306128e-07
56 -0.0063738877 2.243000e-06
53 0.3580739822 8.097840e-06
75 -0.0501489669 2.108667e-05
5 -0.1364242896 2.202501e-05
52 -0.0688470637 1.000694e-04
36 -0.0040488242 1.913163e-04
13 0.2806855081 1.421473e-03
8 -0.0628687900 2.752498e-03
49 -0.0525815766 3.227549e-03
29 -0.0323385967 7.392053e-03
41 0.0454424624 1.705853e-02
17 0.0057380829 1.759323e-02
9 0.0028872544 3.408222e-02
61 -0.0002994662 3.522430e-02
7 0.0005757869 6.236697e-02
68 0.1071077045 6.418983e-02
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
#if (length(which(y1>0))<=5) {next}
fm=try({glm(cbind(y1,y2)~nk + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longink[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~nk + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver, data=longink[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=p.adjust(rrbcell[,2],method = "BH")
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
4 Alistipes -0.156451234 0.000000e+00 -0.1634598788
9 Bacteroides 0.044805008 0.000000e+00 0.0440033241
10 Bifidobacterium -0.120416603 0.000000e+00 -0.1214456623
11 Blautia -0.023503556 0.000000e+00 -0.0242654342
12 Butyricicoccus 0.147277585 0.000000e+00 0.1398470206
15 Clostridium_XI 0.297256892 0.000000e+00 0.2850964112
18 Clostridium_sensu_stricto 0.066461788 0.000000e+00 0.0632615596
21 Coprococcus 0.206163888 0.000000e+00 0.2012164117
23 Dialister -0.313034308 0.000000e+00 -0.3237952212
25 Eisenbergiella 0.179760758 0.000000e+00 0.1736417079
26 Enterococcus -0.111537517 0.000000e+00 -0.1147378432
37 Fusicatenibacter -0.096329481 0.000000e+00 -0.0993464699
39 Gemmiger -0.319660704 0.000000e+00 -0.3250184020
41 Haemophilus -0.472533897 0.000000e+00 -0.4958246386
44 Lactobacillus 0.192157524 0.000000e+00 0.1893669417
48 Parabacteroides -0.169710561 0.000000e+00 -0.1773540934
49 Parasutterella -0.858301886 0.000000e+00 -0.8973564958
53 Prevotella -0.094663020 0.000000e+00 -0.0981384447
61 Ruminococcus2 -0.130645914 0.000000e+00 -0.1342729149
63 Streptococcus -0.143815518 0.000000e+00 -0.1457339869
64 Subdoligranulum 0.239439012 0.000000e+00 0.2304062505
76 Holdemanella 0.453105892 0.000000e+00 0.4309829306
31 F__Erysipelotrichaceae 0.061689641 5.282081e-298 0.0584125798
68 Veillonella -0.049226937 2.609135e-251 -0.0520764809
72 Dorea -0.068553380 7.029111e-248 -0.0725492520
14 Clostridium_IV 0.058730175 5.068950e-203 0.0549439527
32 F__Lachnospiraceae 0.016860510 1.503193e-187 0.0157291145
60 Ruminococcus 0.083859444 3.321558e-185 0.0781962981
70 Catenibacterium 0.272618809 6.406389e-164 0.2530353525
30 F__Enterobacteriaceae 0.367191818 2.627487e-109 0.3347906493
65 Sutterella 0.090429671 3.205161e-102 0.0821729699
57 Romboutsia 0.090496326 4.119533e-101 0.0821874675
20 Coprobacillus -0.143712555 4.448548e-73 -0.1592906212
6 Anaerostipes 0.015900848 2.257768e-70 0.0141435338
19 Collinsella -0.047145433 6.535281e-70 -0.0523734450
34 Faecalibacterium 0.014253709 2.540194e-69 0.0126662073
33 F__Ruminococcaceae 0.047514855 5.902313e-68 0.0421684987
45 Lactococcus -0.079093655 1.716516e-46 -0.0899216794
43 Intestinibacter 0.043679136 2.665465e-43 0.0374739782
24 Eggerthella -0.046050376 4.667713e-42 -0.0526925262
59 Rothia -0.470354473 1.957756e-33 -0.5468651661
42 Hungatella -0.077419504 5.885123e-25 -0.0921270472
16 Clostridium_XVIII -0.009097496 4.878854e-23 -0.0109015117
58 Roseburia -0.014280878 1.989690e-22 -0.0171539646
28 Eubacterium -0.041702715 1.392559e-19 -0.0507315977
8 Anaerovorax 0.171576045 6.991382e-19 0.1336844544
36 Flavonifractor 0.025859196 2.288868e-17 0.0198809720
13 Catabacter -0.246874975 1.937508e-14 -0.3100876928
46 Megasphaera -0.023252923 2.580873e-14 -0.0292357371
69 Anaerofustis -0.278166691 1.818312e-12 -0.3555256420
66 Terrisporobacter 0.029651063 1.146682e-11 0.0210879251
51 Peptostreptococcus 0.205899104 1.264037e-11 0.1463124634
1 Acinetobacter 0.140975539 1.783875e-10 0.0976588365
56 Robinsoniella -0.092988321 5.098277e-10 -0.1223087295
52 Phascolarctobacterium 0.093373090 3.305234e-08 0.0602455702
7 Anaerotruncus 0.045603931 2.115245e-05 0.0245841692
55 Raoultella 0.130364266 2.458547e-04 0.0606762289
74 Ethanoligenens -0.025707030 4.407082e-04 -0.0400438819
2 Actinomyces -0.047216876 7.268923e-04 -0.0746033165
75 F__Peptostreptococcaceae 0.018581405 2.599436e-03 0.0064879911
73 Dysgonomonas -0.100272038 3.005212e-03 -0.1665071793
78 Turicibacter -0.035940899 4.832297e-03 -0.0609387776
71 Clostridium_XlVb -0.034523574 6.804932e-03 -0.0595273218
38 Gemella 0.046375788 8.182036e-03 0.0120034019
40 Granulicatella -0.017337231 1.946581e-02 -0.0318808411
35 Finegoldia 0.048956223 2.054329e-02 0.0075301317
17 Clostridium_XlVa 0.001686073 2.255724e-02 0.0002371829
22 Corynebacterium -0.116329349 4.243000e-02 -0.2286873098
62 Staphylococcus -0.032943125 5.513859e-02 -0.0666114488
upper fdr
4 -0.1494425898 0.000000e+00
9 0.0456066919 0.000000e+00
10 -0.1193875431 0.000000e+00
11 -0.0227416781 0.000000e+00
12 0.1547081485 0.000000e+00
15 0.3094173734 0.000000e+00
18 0.0696620157 0.000000e+00
21 0.2111113641 0.000000e+00
23 -0.3022733955 0.000000e+00
25 0.1858798084 0.000000e+00
26 -0.1083371910 0.000000e+00
37 -0.0933124915 0.000000e+00
39 -0.3143030056 0.000000e+00
41 -0.4492431555 0.000000e+00
44 0.1949481073 0.000000e+00
48 -0.1620670279 0.000000e+00
49 -0.8192472769 0.000000e+00
53 -0.0911875957 0.000000e+00
61 -0.1270189125 0.000000e+00
63 -0.1418970488 0.000000e+00
64 0.2484717745 0.000000e+00
76 0.4752288533 0.000000e+00
31 0.0649667025 1.791314e-297
68 -0.0463773939 8.479690e-251
72 -0.0645575074 2.193083e-247
14 0.0625163968 1.520685e-202
32 0.0179919052 4.342559e-187
60 0.0895225906 9.252911e-185
70 0.2922022647 1.723098e-163
30 0.3995929857 6.831466e-109
65 0.0986863723 8.064598e-102
57 0.0988051843 1.004136e-100
20 -0.1281344885 1.051475e-72
6 0.0176581613 5.179585e-70
19 -0.0419174217 1.456434e-69
34 0.0158412115 5.503754e-69
33 0.0528612120 1.244271e-67
45 -0.0682656297 3.523374e-46
43 0.0498842938 5.330930e-43
24 -0.0394082267 9.102041e-42
59 -0.3938437792 3.724512e-33
42 -0.0627119603 1.092951e-24
16 -0.0072934806 8.850015e-23
58 -0.0114077904 3.527177e-22
28 -0.0326738327 2.413769e-19
8 0.2094676356 1.185495e-18
36 0.0318374199 3.798548e-17
13 -0.1836622565 3.148450e-14
46 -0.0172701084 4.108328e-14
69 -0.2008077395 2.836566e-12
66 0.0382142000 1.753750e-11
51 0.2654857438 1.896056e-11
1 0.1842922410 2.625325e-10
56 -0.0636679118 7.364179e-10
52 0.1265006107 4.687423e-08
7 0.0666236937 2.946235e-05
55 0.2000523041 3.364327e-04
74 -0.0113701791 5.926765e-04
2 -0.0198304349 9.609762e-04
75 0.0306748196 3.379267e-03
73 -0.0340368961 3.842731e-03
78 -0.0109430201 6.079342e-03
71 -0.0095198270 8.425154e-03
38 0.0807481742 9.971857e-03
40 -0.0027936215 2.335897e-02
35 0.0903823151 2.427843e-02
17 0.0031349639 2.626067e-02
22 -0.0039713876 4.866970e-02
62 0.0007251997 6.233058e-02
<>
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
if (length(which(y1>0))<=5) {next}
fm=try({glm(cbind(y1,y2)~nrbc + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longinrbc[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~nrbc + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longinrbc[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=c(r1,r2,r3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=round(p.adjust(rrbcell[,2],method = "BH"),3)
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower
3 Akkermansia -0.062668263 0.000000e+00 -0.0648525627
4 Alistipes -0.119927324 0.000000e+00 -0.1238380238
6 Anaerostipes 0.050232277 0.000000e+00 0.0491924091
11 Blautia 0.064347197 0.000000e+00 0.0639747186
15 Clostridium_XVIII -0.028946468 0.000000e+00 -0.0295661236
17 Clostridium_sensu_stricto -0.102398617 0.000000e+00 -0.1047887260
18 Collinsella 0.075607937 0.000000e+00 0.0726217614
20 Coprococcus 0.087150783 0.000000e+00 0.0842735899
21 Dialister -0.096447362 0.000000e+00 -0.1010266137
23 Eisenbergiella 0.084821358 0.000000e+00 0.0806013998
24 Enterococcus -0.050658119 0.000000e+00 -0.0516651440
25 Escherichia/Shigella -0.047788376 0.000000e+00 -0.0492306341
29 F__Lachnospiraceae 0.037510398 0.000000e+00 0.0369269947
34 Fusicatenibacter 0.048740253 0.000000e+00 0.0473440595
41 Lactobacillus -0.063770176 0.000000e+00 -0.0652595316
58 Dorea 0.115164314 0.000000e+00 0.1131058018
35 Fusobacterium 0.188246923 2.024984e-275 0.1778418857
43 Megasphaera -0.084216962 2.910588e-268 -0.0889341026
28 F__Erysipelotrichaceae 0.028190807 2.270820e-243 0.0265323208
38 Haemophilus -0.086821251 3.550411e-227 -0.0921095858
56 Veillonella 0.022332800 6.347441e-202 0.0208890980
9 Bacteroides -0.005531044 9.425001e-150 -0.0059469819
30 F__Ruminococcaceae -0.031530704 4.776732e-124 -0.0341396106
53 Streptococcus -0.010283559 3.946110e-101 -0.0112276478
27 F__Enterobacteriaceae 0.156095938 4.422934e-95 0.1413074195
49 Romboutsia -0.036893978 6.718734e-83 -0.0406429722
13 Clostridium_IV 0.018595148 5.178185e-64 0.0164374920
51 Ruminococcus2 0.012168257 6.757931e-61 0.0107195732
14 Clostridium_XI 0.063739051 2.264000e-51 0.0554535040
54 Sutterella 0.036518878 6.462771e-41 0.0311753389
12 Butyricicoccus 0.037817552 2.478616e-38 0.0320919989
50 Ruminococcus -0.020863848 5.988688e-37 -0.0240840328
31 Faecalibacterium -0.003372317 5.085655e-36 -0.0038998100
39 Hungatella -0.044020900 2.225236e-31 -0.0514253291
61 Turicibacter 0.074993080 2.630117e-26 0.0611416816
44 O__Clostridiales 0.065186761 9.193217e-25 0.0527513605
33 Flavonifractor -0.015057604 3.319845e-22 -0.0181032584
40 Intestinibacter 0.014314810 4.214163e-21 0.0113386131
8 Anaerovorax 0.115161276 1.120536e-17 0.0887951421
46 Peptostreptococcus 0.156519873 8.108239e-13 0.1136695392
19 Coprobacillus -0.023259934 1.213709e-12 -0.0296775495
10 Bifidobacterium -0.001661435 1.885700e-11 -0.0021464095
32 Finegoldia 0.056892536 3.471739e-11 0.0400610132
55 Terrisporobacter 0.016604570 1.206092e-10 0.0115498778
59 F__Peptostreptococcaceae 0.017496351 2.270016e-10 0.0120889741
2 Actinomyces -0.042448784 1.301649e-09 -0.0561618158
1 Acinetobacter 0.072154585 1.373712e-06 0.0428670736
7 Anaerotruncus -0.022584829 1.418747e-05 -0.0327822211
45 Peptoniphilus 0.042474094 1.184689e-03 0.0168000241
57 Clostridium_XlVb 0.026858080 1.966232e-03 0.0098509805
60 Oscillibacter 0.015195910 2.250782e-03 0.0054465765
42 Lactococcus 0.008565511 3.170495e-03 0.0028758871
36 Gemella 0.030724774 6.758000e-03 0.0084911869
37 Granulicatella -0.012241901 9.437793e-03 -0.0214854320
47 Phascolarctobacterium 0.024028936 2.109144e-02 0.0036084257
52 Staphylococcus -0.015870438 2.168136e-02 -0.0294189381
5 Anaerococcus 0.027170086 4.684387e-02 0.0003787566
upper fdr
3 -0.060483964 0.000
4 -0.116016624 0.000
6 0.051272145 0.000
11 0.064719675 0.000
15 -0.028326812 0.000
17 -0.100008507 0.000
18 0.078594113 0.000
20 0.090027976 0.000
21 -0.091868110 0.000
23 0.089041315 0.000
24 -0.049651093 0.000
25 -0.046346117 0.000
29 0.038093800 0.000
34 0.050136447 0.000
41 -0.062280820 0.000
58 0.117222826 0.000
35 0.198651961 0.000
43 -0.079499821 0.000
28 0.029849292 0.000
38 -0.081532917 0.000
56 0.023776501 0.000
9 -0.005115107 0.000
30 -0.028921797 0.000
53 -0.009339470 0.000
27 0.170884457 0.000
49 -0.033144984 0.000
13 0.020752803 0.000
51 0.013616940 0.000
14 0.072024598 0.000
54 0.041862417 0.000
12 0.043543105 0.000
50 -0.017643663 0.000
31 -0.002844824 0.000
39 -0.036616471 0.000
61 0.088844478 0.000
44 0.077622162 0.000
33 -0.012011949 0.000
40 0.017291006 0.000
8 0.141527409 0.000
46 0.199370207 0.000
19 -0.016842318 0.000
10 -0.001176461 0.000
32 0.073724059 0.000
55 0.021659262 0.000
59 0.022903727 0.000
2 -0.028735752 0.000
1 0.101442097 0.000
7 -0.012387437 0.000
45 0.068148165 0.001
57 0.043865180 0.002
60 0.024945243 0.003
42 0.014255135 0.004
36 0.052958362 0.008
37 -0.002998369 0.011
47 0.044449445 0.023
52 -0.002321938 0.024
5 0.053961415 0.050
<>
options(warn = 2)
m=ncol(longidata)-2
n=nrow(longidata)
name=colnames(longidata)[-c(1,2)]
microbe=c()
rrbcell=data.frame()
for (k in 1:m) {
y1=longidata[index,k+2]
y2=apply(longidata[index,-c(1,2,k+2)],1,sum)
#if (length(which(y1>0))<=5) {next}
fm=try({glm(cbind(y1,y2)~gran + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longigran[index,],family="binomial")},silent = T)
if (inherits(fm,"try-error")){
next()
}else{
fm=glm(cbind(y1,y2)~gran + bbymale + enrollment_age + imrbthwghtg_all +gestage_all+evercigpreg+alpha+deliver , data=longigran[index,],family="binomial")
a=summary(fm)
r1=a$coefficients[2,1]
r2=a$coefficients[2,4]
r3= c(r1-1.96*a$coefficients[2,2],r1+ 1.96*a$coefficients[2,2])
rr=round(c(r1,r2,r3),3)
microbe=c(microbe,name[k])
rrbcell=rbind(rrbcell,rr)
}
}
colnames(rrbcell)=c("coef","pvalue","lower","upper")
fdr=round(p.adjust(rrbcell[,2],method = "BH"),3)
rrbcell=data.frame(microbe,rrbcell,fdr)
rrbcell=rrbcell[order(rrbcell[,3]),]
rrbcellfdr=rrbcell[which(rrbcell[,6]<0.1),]
microbe coef pvalue lower upper fdr
1 Acinetobacter -0.039 0.000 -0.055 -0.023 0.000
2 Actinomyces 0.022 0.000 0.013 0.031 0.000
3 Akkermansia -0.025 0.000 -0.027 -0.024 0.000
4 Alistipes -0.032 0.000 -0.034 -0.030 0.000
6 Anaerostipes -0.044 0.000 -0.045 -0.043 0.000
7 Anaerotruncus 0.044 0.000 0.035 0.053 0.000
8 Anaerovorax -0.065 0.000 -0.080 -0.049 0.000
9 Bacteroides -0.010 0.000 -0.011 -0.010 0.000
10 Bifidobacterium 0.006 0.000 0.006 0.007 0.000
11 Blautia -0.017 0.000 -0.017 -0.016 0.000
12 Butyricicoccus -0.013 0.000 -0.016 -0.010 0.000
13 Catabacter 0.070 0.000 0.053 0.087 0.000
15 Clostridium_XI -0.124 0.000 -0.131 -0.118 0.000
16 Clostridium_XVIII 0.013 0.000 0.012 0.013 0.000
17 Clostridium_XlVa 0.009 0.000 0.008 0.009 0.000
18 Clostridium_sensu_stricto 0.022 0.000 0.021 0.023 0.000
19 Collinsella 0.020 0.000 0.018 0.022 0.000
20 Coprobacillus 0.064 0.000 0.059 0.069 0.000
21 Coprococcus -0.157 0.000 -0.160 -0.155 0.000
23 Dialister 0.089 0.000 0.086 0.092 0.000
24 Eggerthella 0.011 0.000 0.009 0.013 0.000
25 Eisenbergiella -0.068 0.000 -0.071 -0.065 0.000
26 Enterococcus 0.011 0.000 0.009 0.012 0.000
27 Escherichia/Shigella 0.039 0.000 0.038 0.041 0.000
28 Eubacterium 0.043 0.000 0.039 0.047 0.000
30 F__Enterobacteriaceae -0.122 0.000 -0.134 -0.110 0.000
31 F__Erysipelotrichaceae -0.019 0.000 -0.021 -0.018 0.000
32 F__Lachnospiraceae 0.023 0.000 0.022 0.023 0.000
34 Faecalibacterium 0.032 0.000 0.031 0.032 0.000
36 Flavonifractor 0.024 0.000 0.021 0.026 0.000
37 Fusicatenibacter 0.036 0.000 0.035 0.037 0.000
38 Fusobacterium -0.128 0.000 -0.137 -0.120 0.000
40 Gemmiger 0.035 0.000 0.034 0.036 0.000
41 Granulicatella 0.025 0.000 0.020 0.031 0.000
42 Haemophilus 0.091 0.000 0.086 0.096 0.000
43 Hungatella 0.017 0.000 0.012 0.021 0.000
45 Lactobacillus -0.060 0.000 -0.061 -0.059 0.000
46 Lactococcus 0.011 0.000 0.007 0.016 0.000
47 Megasphaera 0.023 0.000 0.021 0.025 0.000
49 Parabacteroides -0.044 0.000 -0.046 -0.042 0.000
50 Parasutterella -0.043 0.000 -0.048 -0.038 0.000
53 Phascolarctobacterium -0.074 0.000 -0.085 -0.062 0.000
54 Prevotella 0.058 0.000 0.057 0.060 0.000
58 Romboutsia -0.043 0.000 -0.046 -0.039 0.000
59 Roseburia 0.023 0.000 0.021 0.024 0.000
60 Rothia 0.102 0.000 0.085 0.120 0.000
61 Ruminococcus 0.056 0.000 0.054 0.058 0.000
62 Ruminococcus2 0.013 0.000 0.012 0.014 0.000
65 Subdoligranulum -0.033 0.000 -0.036 -0.030 0.000
66 Sutterella -0.017 0.000 -0.020 -0.014 0.000
67 Terrisporobacter 0.013 0.000 0.009 0.016 0.000
69 Veillonella 0.015 0.000 0.014 0.016 0.000
70 Anaerofustis 0.062 0.000 0.039 0.086 0.000
71 Catenibacterium -0.063 0.000 -0.067 -0.058 0.000
72 Clostridium_XlVb 0.022 0.000 0.011 0.032 0.000
73 Dorea 0.077 0.000 0.076 0.078 0.000
75 Ethanoligenens 0.031 0.000 0.026 0.036 0.000
78 Slackia -0.107 0.000 -0.128 -0.087 0.000
79 Turicibacter 0.022 0.000 0.012 0.031 0.000
14 Clostridium_IV 0.002 0.002 0.001 0.004 0.003
57 Robinsoniella -0.012 0.005 -0.021 -0.004 0.006
68 Unclassified 0.062 0.007 0.017 0.108 0.009
33 F__Ruminococcaceae -0.002 0.010 -0.004 -0.001 0.013
5 Anaerococcus 0.026 0.011 0.006 0.046 0.014
51 Peptoniphilus 0.023 0.016 0.004 0.042 0.019
29 F__Coriobacteriaceae -0.037 0.047 -0.074 0.000 0.056
74 Dysgonomonas -0.026 0.072 -0.053 0.002 0.085
44 Intestinibacter 0.002 0.080 0.000 0.005 0.093
<>
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] vegan_2.6-2 lattice_0.20-45 permute_0.9-7
loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 pillar_1.8.0 compiler_4.1.2 bslib_0.4.0
[5] later_1.3.0 jquerylib_0.1.4 git2r_0.30.1 workflowr_1.7.0
[9] tools_4.1.2 digest_0.6.29 nlme_3.1-153 jsonlite_1.8.0
[13] evaluate_0.15 lifecycle_1.0.1 tibble_3.1.7 mgcv_1.8-38
[17] pkgconfig_2.0.3 rlang_1.0.4 Matrix_1.3-4 cli_3.3.0
[21] rstudioapi_0.13 parallel_4.1.2 yaml_2.3.5 xfun_0.31
[25] fastmap_1.1.0 cluster_2.1.2 stringr_1.4.0 knitr_1.39
[29] fs_1.5.2 vctrs_0.4.1 sass_0.4.2 grid_4.1.2
[33] rprojroot_2.0.3 glue_1.6.2 R6_2.5.1 fansi_1.0.3
[37] rmarkdown_2.14 magrittr_2.0.3 whisker_0.4 splines_4.1.2
[41] MASS_7.3-54 promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.2
[45] httpuv_1.6.5 utf8_1.2.2 stringi_1.7.6 cachem_1.0.6