22
22
},
23
23
"cell_type" : "markdown",
24
24
"source" : "# Setup\n\nIn this notebook, we make sure a paired set of variants is available. We provide the annotated datafiles as well for reference."
25
+ }, {
26
+ "metadata" : {
27
+ "trusted" : true,
28
+ "input_collapsed" : false,
29
+ "collapsed" : false,
30
+ "id" : "F5C022C6BA6C45A296F199786753A879"
31
+ },
32
+ "cell_type" : "code",
33
+ "source" : "import scala.sys.process._\nimport scala.language.postfixOps\n\ndef shellTestToBool(shellCommand:String):Boolean = {\n Some(shellCommand !)\n .map{ _ match {\n case 0 => true\n case _ => false }\n }.get\n}",
34
+ "outputs" : [ {
35
+ "name" : "stdout",
36
+ "output_type" : "stream",
37
+ "text" : "import scala.sys.process._\nimport scala.language.postfixOps\nshellTestToBool: (shellCommand: String)Boolean\n"
38
+ }, {
39
+ "metadata" : { },
40
+ "data" : {
41
+ "text/html" : ""
42
+ },
43
+ "output_type" : "execute_result",
44
+ "execution_count" : 4
45
+ } ]
46
+ }, {
47
+ "metadata" : {
48
+ "trusted" : true,
49
+ "input_collapsed" : false,
50
+ "collapsed" : false,
51
+ "id" : "2D0DED5DF344445382E884E80A11B4AE"
52
+ },
53
+ "cell_type" : "code",
54
+ "source" : "// Update this!\nval projectDir = \"./\"\n\n// Paths\nval snpEffBaseDir = projectDir + \"snpEff/\"\nval snpEffVersionString = \"v4_2\"\nval snpEffSourceZip = s\"snpEff_${snpEffVersionString}_core.zip\"\n\n// Checks\nval runningInDocker = shellTestToBool(\"test -f /.dockerenv\")\nval wgetInstalled = shellTestToBool(\"which wget\")\nval unzipInstalled = shellTestToBool(\"which unzip\")\nval snpEffInstalled = shellTestToBool(s\"test -f ${snpEffBaseDir}${snpEffSourceZip}\")\nval snpEffBaseDirExists = shellTestToBool(s\"test -d ${snpEffBaseDir}\")",
55
+ "outputs" : [ {
56
+ "name" : "stdout",
57
+ "output_type" : "stream",
58
+ "text" : "projectDir: String = ./\nsnpEffBaseDir: String = ./snpEff/\nsnpEffVersionString: String = v4_2\nsnpEffSourceZip: String = snpEff_v4_2_core.zip\nrunningInDocker: Boolean = true\nwgetInstalled: Boolean = false\nunzipInstalled: Boolean = false\nsnpEffInstalled: Boolean = false\nsnpEffBaseDirExists: Boolean = true\n"
59
+ }, {
60
+ "metadata" : { },
61
+ "data" : {
62
+ "text/html" : ""
63
+ },
64
+ "output_type" : "execute_result",
65
+ "execution_count" : 2
66
+ } ]
25
67
}, {
26
68
"metadata" : {
27
69
"id" : "96E7D50796C04924AC4E1F7F905F6F13"
40
82
"outputs" : [ {
41
83
"name" : "stdout",
42
84
"output_type" : "stream",
43
- "text" : "total 91951\ndrwxr-xr-x 6 root root 204 May 31 12:19 .\ndrwxrwxr-x 9 daemon daemon 4096 May 31 19:43 ..\n-rw------- 1 root root 1860660 May 31 12:04 8122_N.vcf.gz\n-rw------- 1 root root 1888646 May 31 12:05 8122_T.vcf.gz\n-rw------- 1 root root 45003812 May 31 12:02 snpEff.8122_N.vcf.gz\n-rw------- 1 root root 45398741 May 31 12:02 snpEff.8122_T.vcf.gz\n\nimport sys.process._\n"
85
+ "text" : "total 91951\ndrwxr-xr-x 6 root root 204 May 31 12:19 .\ndrwxrwxr-x 10 daemon daemon 4096 Jun 7 12:06 ..\n-rw------- 1 root root 1860660 May 31 12:04 8122_N.vcf.gz\n-rw------- 1 root root 1888646 May 31 12:05 8122_T.vcf.gz\n-rw------- 1 root root 45003812 May 31 12:02 snpEff.8122_N.vcf.gz\n-rw------- 1 root root 45398741 May 31 12:02 snpEff.8122_T.vcf.gz\n\nimport sys.process._\n"
86
+ }, {
87
+ "metadata" : { },
88
+ "data" : {
89
+ "text/plain" : ""
90
+ },
91
+ "output_type" : "execute_result",
92
+ "execution_count" : 4
93
+ } ]
94
+ }, {
95
+ "metadata" : {
96
+ "trusted" : true,
97
+ "input_collapsed" : false,
98
+ "collapsed" : false,
99
+ "id" : "CFBDC3020EAD41A38F79F1886F6F036C"
100
+ },
101
+ "cell_type" : "code",
102
+ "source" : ":sh ls -al ./snpEff/",
103
+ "outputs" : [ {
104
+ "name" : "stdout",
105
+ "output_type" : "stream",
106
+ "text" : "total 5\ndrwxr-xr-x 3 root root 102 Jun 7 12:19 .\ndrwxrwxr-x 10 daemon daemon 4096 Jun 7 12:20 ..\n-rw-r--r-- 1 root root 122 Jun 7 11:45 README.md\n\nimport sys.process._\n"
44
107
}, {
45
108
"metadata" : { },
46
109
"data" : {
47
110
"text/plain" : ""
48
111
},
49
112
"output_type" : "execute_result",
50
- "execution_count" : 1
113
+ "execution_count" : 3
51
114
} ]
52
115
}, {
53
116
"metadata" : {
138
201
},
139
202
"cell_type" : "markdown",
140
203
"source" : "## SnpEff"
141
- }, {
142
- "metadata" : {
143
- "trusted" : true,
144
- "input_collapsed" : false,
145
- "collapsed" : false,
146
- "id" : "6277EC2932474DC1AEC963BF8E02A87A"
147
- },
148
- "cell_type" : "code",
149
- "source" : "//val snpEffBaseDir = \"/Users/toni/Dropbox/_Janssen/CellPass/vcf-comp/snpEff/\"\nval tmpDir = \"/tmp/\"\nval snpEffBaseDir = tmpDir + \"snpEff/\"\nval snpEffVersionString = \"v4_2\"",
150
- "outputs" : [ {
151
- "name" : "stdout",
152
- "output_type" : "stream",
153
- "text" : "tmpDir: String = /tmp/\nsnpEffBaseDir: String = /tmp/snpEff/\nsnpEffVersionString: String = v4_2\n"
154
- }, {
155
- "metadata" : { },
156
- "data" : {
157
- "text/html" : ""
158
- },
159
- "output_type" : "execute_result",
160
- "execution_count" : 19
161
- } ]
162
204
}, {
163
205
"metadata" : {
164
206
"trusted" : true,
167
209
"id" : "6B65F2EC197341A8A879A4E0DD7B2B5A"
168
210
},
169
211
"cell_type" : "code",
170
- "source" : "import scala.sys.process._\nimport scala.language.postfixOps\n\n\"which wget\" #|| \"apt-get install -y wget\" !\n\n\"which unzip\" #|| \"apt-get install -y unzip\" ! ",
212
+ "source" : "if (runningInDocker) {\n println(\"Running in Docker, checking wget and unzip dependencies...\")\n if (! wgetInstalled) { \n println(\"Installing wget\")\n \"apt-get install -y wget\"! \n } else println(\"wget already installed\")\n if (! unzipInstalled) { \n println(\"Installing unzip\")\n \"apt-get install -y unzip\"! \n } else println(\"unzip already installed\")\n} else {\n println(\"Not running in Docker, make sure wget and unzip are available...\")\n} ",
171
213
"outputs" : [ {
172
214
"name" : "stdout",
173
215
"output_type" : "stream",
174
- "text" : "import scala.sys.process._\nimport scala.language.postfixOps\nres54: Int = 0\n"
216
+ "text" : "Running in Docker, checking wget and unzip dependencies...\nInstalling wget\nInstalling unzip\nres7: AnyVal = 0\n"
175
217
}, {
176
218
"metadata" : { },
177
219
"data" : {
178
220
"text/html" : "0"
179
221
},
180
222
"output_type" : "execute_result",
181
- "execution_count" : 28
223
+ "execution_count" : 5
182
224
} ]
183
225
}, {
184
226
"metadata" : {
188
230
"id" : "EC30FE5830904E588DEAA28BE132DACA"
189
231
},
190
232
"cell_type" : "code",
191
- "source" : "s\"test -f ${snpEffBaseDir}/snpEff_${snpEffVersionString}_core.zip\" #|| \ns\ "wget http://heanet.dl.sourceforge.net/project/snpeff/snpEff_${snpEffVersionString}_core.zip -P ${snpEffBaseDir}\" !\n\ns\" unzip ${snpEffBaseDir}snpEff_${snpEffVersionString}_core.zip -d ${tmpDir }\" ! ",
233
+ "source" : "val snpEffDownloaded = \n if (!snpEffInstalled) {\n println(\"Downloading from Sourceforge...\")\n shellTestToBool(s\ "wget http://heanet.dl.sourceforge.net/project/snpeff/${snpEffSourceZip} -P ${snpEffBaseDir}\")\n } else true\n\n// If the download is not successfull, remove the stale file\nif (!snpEffDownloaded) shellTestToBool(s\"rm ${snpEffBaseDir}${snpEffSourceZip}\")\n\nif (!snpEffInstalled && snpEffDownloaded) {\n println(\"Unzipping snpEff...\") \n shellTestToBool(s\" unzip ${snpEffBaseDir}${snpEffSourceZip} -d ${snpEffBaseDir }\")\n}\n\n\n\n\n ",
192
234
"outputs" : [ {
193
235
"name" : "stdout",
194
236
"output_type" : "stream",
195
- "text" : "res52: Int = 1 \n"
237
+ "text" : "Downloading from Sourceforge...\nUnzipping snpEff...\nsnpEffDownloaded: Boolean = true\nres55: AnyVal = true \n"
196
238
}, {
197
239
"metadata" : { },
198
240
"data" : {
199
- "text/html" : "1 "
241
+ "text/html" : "true "
200
242
},
201
243
"output_type" : "execute_result",
202
- "execution_count" : 27
244
+ "execution_count" : 34
203
245
} ]
204
246
}, {
205
247
"metadata" : {
206
248
"trusted" : true,
207
249
"input_collapsed" : false,
208
- "collapsed" : false ,
209
- "id" : "5F4DAE33B1E7429785F8815D24B379F4 "
250
+ "collapsed" : true ,
251
+ "id" : "32FC02C2E3F147128283B90CB9245E50 "
210
252
},
211
253
"cell_type" : "code",
212
254
"source" : "",
213
- "outputs" : [ {
214
- "metadata" : { },
215
- "data" : {
216
- "text/html" : ""
217
- },
218
- "output_type" : "execute_result",
219
- "execution_count" : 8
220
- } ]
255
+ "outputs" : [ ]
221
256
} ],
222
257
"nbformat" : 4
223
258
}
0 commit comments