@@ -16,6 +16,8 @@ vignette: >
16
16
---
17
17
18
18
``` {r setup, include = FALSE}
19
+ LOCAL <- identical(Sys.getenv("LOCAL"), "TRUE")
20
+ knitr::opts_chunk$set(purl = LOCAL)
19
21
knitr::opts_chunk$set(
20
22
collapse = TRUE,
21
23
comment = "#>"
@@ -42,12 +44,12 @@ devtools::install_github("fbertran/SelectBoost", ref = "doMC")
42
44
Code to reproduce the datasets saved with the package and some the figures of the article Aouadi et al. (2018), < arXiv:1810.01670 >
43
45
44
46
## Data simulation
45
- ``` {r Cascade, cache= FALSE}
47
+ ``` {r Cascade, cache= FALSE, eval = LOCAL }
46
48
library(Cascade)
47
49
```
48
50
49
51
We define the F array for the simulations.
50
- ``` {r, cache= TRUE}
52
+ ``` {r, cache= TRUE, eval = LOCAL }
51
53
T<-4
52
54
F<-array(0,c(T-1,T-1,T*(T-1)/2))
53
55
@@ -61,7 +63,7 @@ F[,,5]<-F[,,2]
61
63
```
62
64
63
65
We set the seed to make the results reproducible
64
- ``` {r, cache= TRUE}
66
+ ``` {r, cache= TRUE, eval = LOCAL }
65
67
set.seed(1)
66
68
Net<-Cascade::network_random(
67
69
nb=100,
@@ -77,7 +79,7 @@ Net@F<-F
77
79
```
78
80
79
81
We simulate gene expression according to the network Net
80
- ``` {r message=FALSE, cache=TRUE}
82
+ ``` {r message=FALSE, cache=TRUE, eval = LOCAL }
81
83
M <- Cascade::gene_expr_simulation(
82
84
network=Net,
83
85
time_label=rep(1:4,each=25),
@@ -87,100 +89,100 @@ M <- Cascade::gene_expr_simulation(
87
89
88
90
## Network inference
89
91
We infer the new network.
90
- ``` {r, cache= TRUE, fig.keep='none'}
92
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
91
93
Net_inf_C <- Cascade::inference(M,cv.subjects=TRUE)
92
94
```
93
95
94
96
Heatmap of the coefficients of the Omega matrix of the network. Run the code to get the graph.
95
- ``` {r, cache= TRUE, fig.keep='none'}
97
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
96
98
stats::heatmap(Net_inf_C@network, Rowv = NA, Colv = NA, scale="none", revC=TRUE)
97
99
```
98
100
99
- ``` {r, cache= TRUE}
101
+ ``` {r, cache= TRUE, eval = LOCAL }
100
102
Fab_inf_C <- Net_inf_C@F
101
103
```
102
104
103
105
## Compute the confidence indices for the inference
104
- ``` {r, cache= TRUE}
106
+ ``` {r, cache= TRUE, eval = LOCAL }
105
107
library(SelectBoost)
106
108
set.seed(1)
107
109
```
108
110
109
111
By default the crossvalidation is made subjectwise according to a leave one out scheme and the resampling analysis is made at the .95 ` c0 ` level. To pass CRAN tests, ` use.parallel = FALSE ` is required. Set ` use.parallel = TRUE ` and select the number of cores using ` ncores = 4 ` .
110
- ``` {r, cache= TRUE}
112
+ ``` {r, cache= TRUE, eval = LOCAL }
111
113
net_pct_selected <- selectboost(M, Fab_inf_C, use.parallel = FALSE)
112
114
```
113
- ``` {r, cache= TRUE}
115
+ ``` {r, cache= TRUE, eval = LOCAL }
114
116
net_pct_selected_.5 <- selectboost(M, Fab_inf_C, c0value = .5, use.parallel = FALSE)
115
117
```
116
- ``` {r, cache= TRUE}
118
+ ``` {r, cache= TRUE, eval = LOCAL }
117
119
net_pct_selected_thr <- selectboost(M, Fab_inf_C, group = group_func_1, use.parallel = FALSE)
118
120
```
119
121
120
122
Use ` cv.subject=FALSE ` to use default crossvalidation
121
- ``` {r, cache= TRUE}
123
+ ``` {r, cache= TRUE, eval = LOCAL }
122
124
net_pct_selected_cv <- selectboost(M, Fab_inf_C, cv.subject=FALSE, use.parallel = FALSE)
123
125
```
124
126
125
127
## Analysis of the confidence indices
126
128
Use plot to display the result of the confidence analysis.
127
- ``` {r, cache= TRUE}
129
+ ``` {r, cache= TRUE, eval = LOCAL }
128
130
plot(net_pct_selected)
129
131
```
130
132
131
133
Run the code to plot the other results.
132
- ``` {r, cache= TRUE, fig.keep='none'}
134
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
133
135
plot(net_pct_selected_.5)
134
136
```
135
137
136
- ``` {r, cache= TRUE, fig.keep='none'}
138
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
137
139
plot(net_pct_selected_thr)
138
140
```
139
141
140
- ``` {r, cache= TRUE, fig.keep='none'}
142
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
141
143
plot(net_pct_selected_cv)
142
144
```
143
145
144
146
Run the code to plot the remaning graphs.
145
147
146
148
Distribution of non-zero (absolute value > 1e-5) coefficients
147
- ``` {r, cache= FALSE, fig.keep="none"}
149
+ ``` {r, cache= FALSE, fig.keep="none", eval = LOCAL }
148
150
hist(Net_inf_C@network[abs(Net_inf_C@network)>1e-5])
149
151
```
150
152
151
153
Plot of confidence at .95 resampling level versus coefficient value for non-zero (absolute value > 1e-5) coefficients
152
- ``` {r, cache= FALSE, fig.keep="none"}
154
+ ``` {r, cache= FALSE, fig.keep="none", eval = LOCAL }
153
155
plot(Net_inf_C@network[abs(Net_inf_C@network)>1e-5],[email protected] [abs(Net_inf_C@network)>1e-5])
154
156
```
155
157
156
- ``` {r, cache= TRUE, fig.keep='none'}
158
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
157
159
hist([email protected] [abs(Net_inf_C@network)>1e-5])
158
160
```
159
161
160
162
Plot of confidence at .5 resampling level versus coefficient value for non-zero (absolute value > 1e-5) coefficients
161
- ``` {r, cache= TRUE, fig.keep='none'}
163
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
162
164
plot(Net_inf_C@network[abs(Net_inf_C@network)>1e-5],[email protected] [abs(Net_inf_C@network)>1e-5])
163
165
```
164
166
165
- ``` {r, cache= TRUE, fig.keep='none'}
167
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
166
168
hist([email protected] [abs(Net_inf_C@network)>1e-5])
167
169
```
168
170
169
171
Plot of confidence at .95 resamling level with groups created by thresholding the correlation matrix versus coefficient value for non-zero (absolute value > 1e-5) coefficients.
170
- ``` {r, cache= TRUE, fig.keep='none'}
172
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
171
173
plot(Net_inf_C@network[abs(Net_inf_C@network)>1e-5],[email protected] [abs(Net_inf_C@network)>1e-5])
172
174
```
173
175
174
- ``` {r, cache= TRUE, fig.keep='none'}
176
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
175
177
hist([email protected] [abs(Net_inf_C@network)>1e-5])
176
178
```
177
179
178
180
Plot of confidence at .95 resampling level versus coefficient value for non-zero (absolute value > 1e-5) coefficients using standard cross-validation.
179
- ``` {r, cache= TRUE, fig.keep='none'}
181
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
180
182
plot(Net_inf_C@network[abs(Net_inf_C@network)>1e-5],[email protected] [abs(Net_inf_C@network)>1e-5])
181
183
```
182
184
183
- ``` {r, cache= TRUE, fig.keep='none'}
185
+ ``` {r, cache= TRUE, fig.keep='none', eval = LOCAL }
184
186
hist([email protected] [abs(Net_inf_C@network)>1e-5])
185
187
```
186
188
0 commit comments