-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputs_oct016.do
200 lines (171 loc) · 5.83 KB
/
inputs_oct016.do
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
* Import data from excel sheets
* based on code by Tim Peto
set li 130
cap log close
log using inputs.log, replace
noi di "Run by AMM on $S_DATE $S_TIME"
cd E:\users\amy.mason\Pipeline_27_07_2016\Datasets
************NEW DATA***************
*genefinder sets
noi di "Genefinder sets"
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Genefinder.xlsx", sheet("Oxford-validation") firstrow allstring clear
gen method="genefinder"
gen set="Oxford491"
rename Sample_id sample
rename remarks comments
* there is a chromo site called 23s/ s, only genefinder reports on it: drop it
drop s
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
save pipeline_data_gf, replace
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Genefinder.xlsx", sheet("Oxford-derivation") firstrow allstring clear
gen method="genefinder"
gen set="Oxford501"
rename Sample_id sample
rename remarks comments
* there is a chromo site called 23s/ s, only genefinder reports on it: drop it
drop s
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
append using pipeline_data_gf.dta, force
save pipeline_data_gf, replace
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Genefinder.xlsx", sheet("PHE-validation") firstrow allstring clear
gen method="genefinder"
gen set="Collindale"
drop CX
rename Sample_id sample
rename remarks comments
* there is a chromo site called 23s/ s, only genefinder reports on it: drop it
drop s
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
append using pipeline_data_gf.dta, force
noi di _N " results"
bysort site: gen tab=1 if _n==1
summ tab
noi di "on " r(sum) " sites"
drop tab
bysort sample: gen tab=1 if _n==1
summ tab
noi di "from " r(sum) " samples"
drop tab
save pipeline_data_gf, replace
* Mykroke sets
noi di "Mykrobe sets"
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\mykrobe_oct_2016.xlsx", sheet("mykrobe_04_oct_2016.tsv") firstrow clear
gen method="zam"
*gen set=""
*reshape to one line per site/sample
renpfix "" value
rename valuecomid sample
rename valuemethod method
rename valueremarks comments
reshape long value, i(sample method comments) j(site) string
save pipeline_data_z, replace
* problem with extra samples; some in multiple sets with null results: drop any samples with duplicate results
noi di "duplicate results for same sample - one set indentical or null"
use pipeline_data_z, clear
noi di _N " results"
bysort site: gen tab=1 if _n==1
summ tab
noi di "on " r(sum) " sites"
drop tab
bysort sample: gen tab=1 if _n==1
summ tab
noi di "from " r(sum) " samples"
drop tab
save pipeline_data_z2, replace
* typewriter sets
noi di "typewriter"
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Typewriter.xlsx", sheet("Colindale400_Michel_panel") cellrange(A2:CU400) firstrow allstring clear
* picks up extra blank line from excel - drop
drop if Sample ==""
gen set="Collindale"
gen method="typewriter"
rename SampleID sample
rename B comments
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
save pipeline_data_tw, replace
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Typewriter.xlsx", sheet("OxDerivation_Michel_panel") cellrange(A2:CU503) firstrow allstring clear
gen set="Oxford501"
gen method="typewriter"
rename SampleID sample
rename B comments
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
append using pipeline_data_tw.dta, force
save pipeline_data_tw, replace
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Typewriter.xlsx", sheet("OxValidation_Michel_panel") cellrange(A2:CU493) firstrow allstring clear
gen set="Oxford491"
gen method="typewriter"
rename SampleID sample
rename B comments
*reshape to one line per site/sample
renpfix "" value
rename valuesample sample
rename valuemethod method
rename valueset set
rename valuecomments comments
reshape long value, i(sample set method comments) j(site) string
append using pipeline_data_tw.dta, force
noi di _N " results"
bysort site: gen tab=1 if _n==1
summ tab
noi di "on " r(sum) " sites"
drop tab
bysort sample: gen tab=1 if _n==1
summ tab
noi di "from " r(sum) " samples"
drop tab
save pipeline_data_tw, replace
***************** import gold standard
noi di "Lab gold standard"
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Typewriter.xlsx", sheet("OxValidation_phenotype") cellrange(A2:O494) firstrow allstring clear
* picks up extra blank line - drop
drop if A==""
gen set="Oxford491"
gen method="gold"
rename A sample
rename B comments
save pipeline_data_gs, replace
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Typewriter.xlsx", sheet("OxDerivation_phenotype") cellrange(A2:M503) firstrow allstring clear
gen set="Oxford501"
gen method="gold"
rename A sample
append using pipeline_data_gs.dta, force
save pipeline_data_gs, replace
noi di "include extra toxin panal"
import excel "E:\users\amy.mason\Pipeline_27_07_2016\Inputs\Genefinder.xlsx", sheet("PHE-phenotypes-and toxin PCRs") firstrow allstring clear
drop N
gen method="gold"
gen set="Collindale"
rename sample_id sample
append using pipeline_data_gs.dta, force
noi di _N " samples"
save pipeline_data_gs, replace