-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEDDY_logistic_humann.Rmd
216 lines (145 loc) · 9.94 KB
/
TEDDY_logistic_humann.Rmd
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
---
title: "TEDDY_species_pathways_binary_models"
author: "Sam Zimmerman"
date: "2023-05-24"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{bash}
#run lasso binary regression
/n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header.csv
/n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header.csv
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header.csv models_input_files_parsed_v4_pathway_no_header_before_condition_
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header.csv models_input_files_parsed_v4_species_no_header_before_condition_
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash models_input_files_parsed_v4_pathway_no_header_before_condition_aa microbiome NA all 1 NA
for x in models_input_files_parsed_v4_pathway_no_header_before_condition_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome NA all 1 NA
done
for x in models_input_files_parsed_v4_species_no_header_before_condition_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome NA all 1 NA
done
```
```{bash}
split -l 10 input_files_ttest_sig_v4_pathways_species.csv input_files_ttest_sig_v4_pathways_species_
for x in input_files_ttest_sig_v4_pathways_species_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome NA ttest_sig 1 NA
done
# random forest
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash input_files_ttest_sig_v4_pathways_species_aa microbiome NA ttest_sig 1 NA
for x in input_files_ttest_sig_v4_pathways_species_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome NA ttest_sig 1 NA
done
Rscript scripts/find_failed_job_folders.R /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species.csv _speciesoutput_random_forest_binary_NA_loss_microbiome_selection_method_ttest_sig_feature_list_microbiome.rds failed_rf_binary_species_microbiome.txt
Rscript scripts/find_failed_job_folders.R /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species.csv _pathwayoutput_random_forest_binary_NA_loss_microbiome_selection_method_ttest_sig_feature_list_microbiome.rds failed_rf_binary_pathway_microbiome.txt
cat failed_rf_binary_species_microbiome.txt failed_rf_binary_pathway_microbiome.txt > failed_rf_binary_species_pathway_microbiome.txt
split -l 10 failed_rf_binary_species_pathway_microbiome.txt failed_rf_binary_species_pathway_microbiome_
for x in failed_rf_binary_species_pathway_microbiome_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome NA ttest_sig 1 NA
done
```
#Now run models but combine autoantibodies and such with microbiome genes
```{bash}
grep -v "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header_no_healthy_pret1d.csv
grep "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header_healthy_pret1d.csv
grep -v "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header_no_healthy_pret1d.csv
grep "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header_healthy_pret1d.csv
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header_no_healthy_pret1d.csv models_input_files_parsed_v4_species_no_header_no_healthy_pret1d_
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_species_no_header_healthy_pret1d.csv models_input_files_parsed_v4_species_no_header_healthy_pret1d_
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header_no_healthy_pret1d.csv models_input_files_parsed_v4_pathway_no_header_no_healthy_pret1d_
split -l 50 /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/models_input_files_parsed_v4_pathway_no_header_healthy_pret1d.csv models_input_files_parsed_v4_pathway_no_header_healthy_pret1d_
#run lasso
for x in models_input_files_parsed_v4_species_no_header_no_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_species_no_header_no_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2,Sex fdr,grs2,Sex all 1 NA
done
for x in models_input_files_parsed_v4_species_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2 number_autoantibodies,fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_species_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_species_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2,Sex number_autoantibodies,fdr,grs2,Sex all 1 NA
done
for x in models_input_files_parsed_v4_pathway_no_header_no_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_pathway_no_header_no_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2,Sex fdr,grs2,Sex all 1 NA
done
for x in models_input_files_parsed_v4_pathway_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2 number_autoantibodies,fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_pathway_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 all 1 NA
done
for x in models_input_files_parsed_v4_pathway_no_header_healthy_pret1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2,Sex number_autoantibodies,fdr,grs2,Sex all 1 NA
done
```
#Now do the same thing but with ttest_sig
```{bash}
grep -v "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species_no_healthyT1d.csv
grep "healthy_pre-t1d" /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species.csv > /n/data1/joslin/icrb/kostic/szimmerman/TEDDY_analysis/input_files_ttest_sig_v4_pathways_species_healthyT1d.csv
split -l 10 input_files_ttest_sig_v4_pathways_species_no_healthyT1d.csv input_files_ttest_sig_v4_pathways_species_no_healthyT1d_
split -l 10 input_files_ttest_sig_v4_pathways_species_healthyT1d.csv input_files_ttest_sig_v4_pathways_species_healthyT1d_
for x in input_files_ttest_sig_v4_pathways_species_no_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_no_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2,Sex fdr,grs2,Sex ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2 number_autoantibodies,fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-01:00 scripts/run_lasso_binary_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2,Sex number_autoantibodies,fdr,grs2,Sex ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_no_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_no_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2 number_autoantibodies,fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome,fdr,grs2 fdr,grs2 ttest_sig 1 NA
done
for x in input_files_ttest_sig_v4_pathways_species_healthyT1d_*
do
sbatch -n 1 -c 1 --mem=5G -p short -t 0-04:00 scripts/run_rf_bulk.bash ${x} microbiome,number_autoantibodies,fdr,grs2,Sex number_autoantibodies,fdr,grs2,Sex ttest_sig 1 NA
done
```