forked from viktormiok/scRNAseq_AdipocyteSubtyping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
142 lines (142 loc) · 4.25 KB
/
.Rhistory
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
15*230
16*230
20*230
17*230
15*250
library(VennDiagram)
setwd("/Users/viktorian.miok/Documents/consultation/Luiza/single_cell/results/")
deg5a <- read.csv(file = 'DGE0_5astro.csv')
deg5n <- read.csv(file = 'DGE0_5neuro.csv')
deg15a <- read.csv(file = 'DGE0_15astro.csv')
deg15n <- read.csv(file = 'DGE0_15neuro.csv')
vp=venn.diagram(list(astro_up=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
astro_down=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
neuro_up=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
neuro_down=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("darkmagenta", "magenta", "red","orange"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(astro_up=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
astro_down=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
neuro_up=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
neuro_down=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("firebrick1", "firebrick3", "dodgerblue","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(astro_up=deg15a[(deg15a[,3]<0.05)&(deg15a[,4]>0),2],
astro_down=deg15a[(deg15a[,3]<0.05)&(deg15a[,4]<=0),2],
neuro_up=deg15n[(deg15n[,3]<0.05)&(deg15n[,4]>0),2],
neuro_down=deg15n[(deg15n[,3]<0.05)&(deg15n[,4]<=0),2]),
fill=c("darkmagenta", "magenta", "red","orange"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(astro_up=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
astro_down=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
neuro_up=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
neuro_down=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("firebrick1", "firebrick3", "dodgerblue","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(astro_up=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
astro_down=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
neuro_up=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
neuro_down=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("firebrick1", "dodgerblue", "firebrick3","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(" "=deg15a[(deg15a[,3]<0.05)&(deg15a[,4]>0),2],
" "=deg15a[(deg15a[,3]<0.05)&(deg15a[,4]<=0),2],
" "=deg15n[(deg15n[,3]<0.05)&(deg15n[,4]>0),2],
" "=deg15n[(deg15n[,3]<0.05)&(deg15n[,4]<=0),2]),
fill=c("firebrick1", "dodgerblue", "firebrick3","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(astro_up=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
astro_down=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
neuro_up=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
neuro_down=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("firebrick1", "dodgerblue", "firebrick3","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
vp=venn.diagram(list(" "=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]>0),2],
" "=deg5a[(deg5a[,3]<0.05)&(deg5a[,4]<=0),2],
" "=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]>0),2],
" "=deg5n[(deg5n[,3]<0.05)&(deg5n[,4]<=0),2]),
fill=c("firebrick1", "dodgerblue", "firebrick3","dodgerblue3"),
filename=NULL,
cex=3.5,
col="transparent",
cat.cex=2,
margin=0.01,
main=NULL,
main.cex=3);
grid.newpage()
grid.draw(vp)
16+84
# Load libraries
library('readxl')
library('MASS')
library('pscl')
library('lme4')
###############################################################################
# ARC
###############################################################################
dat = read_excel('~/Documents/consultation/Luiza/manuscript/revision_1/number of cells for statistics.xlsx',sheet=1)
dat$Diet <- as.factor(dat$Diet)
dat$Marker <- as.factor(dat$Marker)
dat$Mouse <- as.factor(dat$Mouse)
dat$ARC <- as.factor(dat$ARC)
dat$Value <- as.integer(dat$Value)
dat1 <- dat[(dat$Diet=="SC diet" & dat$Marker=="Aldh1L1_only")|(dat$Diet=="5d HFHS diet" & dat$Marker=="Aldh1L1_only"),]
glmFitNB <- glmer.nb(Value ~ Diet + (1|Mouse), data=dat1)
coef(summary(glmFitNB))[2,4] #odTest(glmFitNB)
summary(glmFitNB)