/
bootstrap-cluster.html
602 lines (558 loc) · 28.4 KB
/
bootstrap-cluster.html
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Frederick Boehm" />
<meta name="date" content="2020-06-29" />
<title>Using HTCondor for bootstrap analysis</title>
<script>// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) -->
// v0.0.1
// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020.
document.addEventListener('DOMContentLoaded', function() {
const codeList = document.getElementsByClassName("sourceCode");
for (var i = 0; i < codeList.length; i++) {
var linkList = codeList[i].getElementsByTagName('a');
for (var j = 0; j < linkList.length; j++) {
if (linkList[j].innerHTML === "") {
linkList[j].setAttribute('aria-hidden', 'true');
}
}
}
});
</script>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
code.sourceCode > span { display: inline-block; line-height: 1.25; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Using HTCondor for bootstrap analysis</h1>
<h4 class="author">Frederick Boehm</h4>
<h4 class="date">2020-06-29</h4>
<div id="overview" class="section level2">
<h2>Overview</h2>
<p>Performing a bootstrap analysis with <code>qtl2pleio</code> requires first sampling a (bivariate) phenotype from the inferred bivariate normal distribution, then a two-dimensional QTL scan over the defined scan region. Often, one wants to include more than 100 markers in a scan region. Each two-dimensional scan can take tens of minutes with a single core. Thus, performing a bootstrap analysis with, say, 1000 bootstrap samples is prohibitively time-consuming on most computers. For this reason, we used a high-throughput computing cluster at the University of Wisconsin-Madison (where <code>qtl2pleio</code> was developed). The UW-Madison Center for High-Throughput Computing (CHTC) is available to all UW-Madison researchers. While we recognize that <code>qtl2pleio</code> users may not have access to the CHTC, we anticipate that some will have access to computing clusters. Hopefully this vignette can be adapted to your needs.</p>
</div>
<div id="directory-structure-files-setup-for-using-condor" class="section level2">
<h2>Directory structure, files & setup for using Condor</h2>
<p>We placed on github a repository that contains the results from our bootstrap analysis of the Recla data.</p>
<p>Here is the repository’s url: <a href="https://github.com/fboehm/qtl2pleio-manuscript-chtc/" class="uri">https://github.com/fboehm/qtl2pleio-manuscript-chtc/</a></p>
<p>Within this repo are three subdirectories. We’ll examine in detail the “Recla-bootstrap” subdirectory.</p>
<p>Within this directory, we created four subdirectories:</p>
<ol style="list-style-type: decimal">
<li>Rscript</li>
<li>data</li>
<li>shell_scripts</li>
<li>submit_files</li>
</ol>
<p>The Github repository also contains a fifth subdirectory, <code>squid</code> and a sixth subdirectory <code>results</code>, that are included for completeness. In practice, files in <code>squid</code> were in a distinct directory. We describe it below.</p>
<div id="files-in-rscript" class="section level3">
<h3>Files in <code>Rscript</code></h3>
<p>The <code>Rscript</code> subdirectory contains a file, <code>boot-Recla-10-22.R</code> that contains R code for our bootstrap analysis.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1"></a>fn <-<span class="st"> </span><span class="kw">file.path</span>(<span class="st">"https://raw.githubusercontent.com"</span>, </span>
<span id="cb1-2"><a href="#cb1-2"></a> <span class="st">"fboehm/qtl2pleio-manuscript/master/chtc"</span>, </span>
<span id="cb1-3"><a href="#cb1-3"></a> <span class="st">"Recla-bootstrap/Rscript/boot-Recla-10-22.R"</span></span>
<span id="cb1-4"><a href="#cb1-4"></a> )</span>
<span id="cb1-5"><a href="#cb1-5"></a>foo <-<span class="st"> </span><span class="kw">readLines</span>(fn)</span></code></pre></div>
<p>Here we display the contents of our <code>boot-Recla-10-22.R</code> file.</p>
<pre><code>##
pleio_peak_index <- 788
##
library(qtl2pleio)
library(stringr)
library(dplyr)
library(readr)
args <- R.utils::commandArgs(trailingOnly = TRUE, asValues = TRUE)
# translate command line args
print(args)
print(args$argname)
(proc_num <- as.numeric(args$argname))
(run_num <- as.numeric(args$run_num))
(nboot_per_job <- args$nboot_per_job) # think 1 boot per job
(nsnp <- as.integer(args$nsnp))
(s1 <- as.integer(args$s1))
###############
library(qtl2)
recla <- readRDS("data/recla.rds")
# make sex a covariate for use in pvl_scan
recla[[6]][ , 1, drop = FALSE] -> sex
sex <- sex == "female"
# insert pseudomarkers
insert_pseudomarkers(recla, step = 0.1) -> pseudomap
## ------------------------------------------------------------------------
## ------------------------------------------------------------------------
pp <- readRDS("data/recla-aprobs-chr8.rds")
## ------------------------------------------------------------------------
kinship <- readRDS("data/recla-kinship.rds")
## ------------------------------------------------------------------------
recla$pheno -> ph
log(ph) -> lph
apply(FUN = broman::winsorize, X = lph, MARGIN = 2) -> wlph
## ------------------------------------------------------------------------
phe <- wlph[, c(10, 22)]
gm <- pseudomap$`8`
k <- kinship[[8]]
## ------------------------------------------------------------------------
library(qtl2pleio)
###############
# simulate a phenotype
X1 <- pp[ , , pleio_peak_index]
cbind(X1, unlist(sex)) -> Xpre
## remove subjects with missing values of phenotype
is.na(phe[ , 1]) | is.na(phe[ , 2]) -> missing_indic
phe_nona <- phe[!missing_indic, ]
Xpre_nona <- Xpre[!missing_indic, ]
k_nona <- k[!missing_indic, !missing_indic]
##
gemma2::stagger_mats(Xpre_nona, Xpre_nona) -> X
set.seed(proc_num)
calc_covs(pheno = phe_nona, kinship = k_nona) -> cc_out
(cc_out$Vg -> Vg)
(cc_out$Ve -> Ve)
# calculate Sigma
calc_Sigma(Vg = Vg, Ve = Ve, K = k_nona) -> Sigma
solve(Sigma) -> Sigma_inv
# calc Bhat
B <- calc_Bhat(X = X, Sigma_inv = Sigma_inv, Y = phe_nona)
# Start loop
lrt <- numeric()
for (i in 1:nboot_per_job){
sim1(X = X, B = B, Vg = Vg, Ve = Ve, kinship = k_nona) -> foo
matrix(foo, ncol = 2, byrow = FALSE) -> Ysim
rownames(Ysim) <- rownames(phe_nona)
colnames(Ysim) <- c("t1", "t2")
scan_pvl(probs = pp[!missing_indic, , ], pheno = Ysim, covariates = sex[!missing_indic, , drop = FALSE], kinship = k_nona, start_snp1 = s1, n_snp = nsnp) -> loglik
# in above call, s1 & nsnp come from command line args
calc_lrt_tib(loglik) -> lrt[i]
}
fn_out <- paste0("recla-boot-run", run_num, "_", proc_num, ".txt")
write.table(lrt, fn_out)
q("no")</code></pre>
</div>
<div id="files-in-data" class="section level3">
<h3>Files in <code>data</code></h3>
<p>The data subdirectory contains three rds files, one for each of the three input components.</p>
<ol style="list-style-type: decimal">
<li>founder allele dosages for Chr 8</li>
<li>phenotypes</li>
<li>kinship matrix (derived via LOCO method)</li>
</ol>
</div>
<div id="files-in-shell_scripts" class="section level3">
<h3>Files in <code>shell_scripts</code></h3>
<p>We examine only the file that is needed for the Recla analysis, <code>boot-Recla-10-22.sh</code>.</p>
<p>Here is the contents of the file.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1"></a><span class="co">#!/bin/bash</span></span>
<span id="cb3-2"><a href="#cb3-2"></a></span>
<span id="cb3-3"><a href="#cb3-3"></a><span class="co"># untar your R installation</span></span>
<span id="cb3-4"><a href="#cb3-4"></a><span class="fu">tar</span> -xzf R13.tar.gz</span>
<span id="cb3-5"><a href="#cb3-5"></a><span class="fu">tar</span> -xzf SLIBS.tar.gz</span>
<span id="cb3-6"><a href="#cb3-6"></a><span class="co"># make sure the script will use your R installation</span></span>
<span id="cb3-7"><a href="#cb3-7"></a><span class="bu">export</span> <span class="va">PATH=$(</span><span class="bu">pwd</span><span class="va">)</span>/R/bin:<span class="va">$PATH</span></span>
<span id="cb3-8"><a href="#cb3-8"></a><span class="bu">export</span> <span class="va">LD_LIBRARY_PATH=$(</span><span class="bu">pwd</span><span class="va">)</span>/SS:<span class="va">$LD_LIBRARY_PATH</span></span>
<span id="cb3-9"><a href="#cb3-9"></a><span class="co"># run R, with the name of your R script</span></span>
<span id="cb3-10"><a href="#cb3-10"></a><span class="ex">R</span> CMD BATCH <span class="st">'--args argname='</span><span class="va">$1</span><span class="st">' nsnp='</span><span class="va">$2</span><span class="st">' s1='</span><span class="va">$3</span><span class="st">' nboot_per_job='</span><span class="va">$4</span><span class="st">' run_num='</span><span class="va">$5</span><span class="st">''</span> Rscript/boot-Recla-10-22.R <span class="st">'boot400_run'</span><span class="va">$5</span><span class="st">'-'</span><span class="va">$1</span><span class="st">'.Rout'</span></span></code></pre></div>
<p>We need to unzip the R installation, which we’ve named R13.tar.gz, and SLIBS file on the remote computer where the actual computing will occur. Following that, and needed adjustments to the paths, we execute R. Note that we have, in this file, specified the variable values by numbers, like <code>$1</code> for <code>argname</code>. The values assigned to each of these is specified in the “submit” file.</p>
</div>
<div id="files-in-submit_files" class="section level3">
<h3>Files in <code>submit_files</code></h3>
<p>The HTCondor “submit” file provides instructions for controlling the interaction with the high-throughput resources. Below is the text in the submit file <code>boot-Recla-10-22.sub</code></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1"></a><span class="co"># hello-chtc.sub</span></span>
<span id="cb4-2"><a href="#cb4-2"></a><span class="co"># My very first HTCondor submit file</span></span>
<span id="cb4-3"><a href="#cb4-3"></a><span class="va">s1=</span>650</span>
<span id="cb4-4"><a href="#cb4-4"></a><span class="co"># start scan at this SNP index value</span></span>
<span id="cb4-5"><a href="#cb4-5"></a><span class="va">nsnp=</span>350</span>
<span id="cb4-6"><a href="#cb4-6"></a><span class="co"># length of scan in number of SNPs</span></span>
<span id="cb4-7"><a href="#cb4-7"></a><span class="co"># which run in the experimental design?</span></span>
<span id="cb4-8"><a href="#cb4-8"></a><span class="va">run_num=</span>561</span>
<span id="cb4-9"><a href="#cb4-9"></a><span class="co">#</span></span>
<span id="cb4-10"><a href="#cb4-10"></a><span class="va">nboot_per_job=</span>1</span>
<span id="cb4-11"><a href="#cb4-11"></a><span class="co"># for almost all jobs), the desired name of the HTCondor log file,</span></span>
<span id="cb4-12"><a href="#cb4-12"></a><span class="co"># and the desired name of the standard error file. </span></span>
<span id="cb4-13"><a href="#cb4-13"></a><span class="co"># Wherever you see $(Cluster), HTCondor will insert the queue number</span></span>
<span id="cb4-14"><a href="#cb4-14"></a><span class="co"># assigned to this set of jobs at the time of submission.</span></span>
<span id="cb4-15"><a href="#cb4-15"></a><span class="ex">universe</span> = vanilla</span>
<span id="cb4-16"><a href="#cb4-16"></a><span class="ex">log</span> = boot-<span class="va">$(</span><span class="ex">Process</span><span class="va">)</span>-run<span class="va">$(</span><span class="ex">run_num</span><span class="va">)</span>.log</span>
<span id="cb4-17"><a href="#cb4-17"></a><span class="ex">error</span> = boot-<span class="va">$(</span><span class="ex">Process</span><span class="va">)</span>-run<span class="va">$(</span><span class="ex">run_num</span><span class="va">)</span>.err</span>
<span id="cb4-18"><a href="#cb4-18"></a><span class="co">#</span></span>
<span id="cb4-19"><a href="#cb4-19"></a><span class="co"># Specify your executable (single binary or a script that runs several</span></span>
<span id="cb4-20"><a href="#cb4-20"></a><span class="co"># commands), arguments, and a files for HTCondor to store standard</span></span>
<span id="cb4-21"><a href="#cb4-21"></a><span class="co"># output (or "screen output").</span></span>
<span id="cb4-22"><a href="#cb4-22"></a><span class="co"># $(Process) will be a integer number for each job, starting with "0"</span></span>
<span id="cb4-23"><a href="#cb4-23"></a><span class="co"># and increasing for the relevant number of jobs.</span></span>
<span id="cb4-24"><a href="#cb4-24"></a><span class="ex">executable</span> = ../shell_scripts/boot-Recla-10-22.sh</span>
<span id="cb4-25"><a href="#cb4-25"></a><span class="ex">arguments</span> = <span class="va">$(</span><span class="ex">Process</span><span class="va">)</span> <span class="va">$(</span><span class="ex">nsnp</span><span class="va">)</span> <span class="va">$(</span><span class="ex">s1</span><span class="va">)</span> <span class="va">$(</span><span class="ex">nboot_per_job</span><span class="va">)</span> <span class="va">$(</span><span class="ex">run_num</span><span class="va">)</span></span>
<span id="cb4-26"><a href="#cb4-26"></a><span class="ex">output</span> = boot-<span class="va">$(</span><span class="ex">Process</span><span class="va">)</span>-run<span class="va">$(</span><span class="ex">run_num</span><span class="va">)</span>.out</span>
<span id="cb4-27"><a href="#cb4-27"></a><span class="co">#</span></span>
<span id="cb4-28"><a href="#cb4-28"></a><span class="co"># Specify that HTCondor should transfer files to and from the</span></span>
<span id="cb4-29"><a href="#cb4-29"></a><span class="co"># computer where each job runs. The last of these lines *would* be</span></span>
<span id="cb4-30"><a href="#cb4-30"></a><span class="ex">when_to_transfer_output</span> = ON_EXIT</span>
<span id="cb4-31"><a href="#cb4-31"></a><span class="ex">transfer_input_files</span> = ../data,../Rscript,../shell_scripts,http://proxy.chtc.wisc.edu/SQUID/fjboehm/R13.tar.gz,http://proxy.chtc.wisc.edu/SQUID/SLIBS.tar.gz</span>
<span id="cb4-32"><a href="#cb4-32"></a><span class="co">#</span></span>
<span id="cb4-33"><a href="#cb4-33"></a><span class="co"># Tell HTCondor what amount of compute resources</span></span>
<span id="cb4-34"><a href="#cb4-34"></a><span class="co"># each job will need on the computer where it runs.</span></span>
<span id="cb4-35"><a href="#cb4-35"></a><span class="ex">request_cpus</span> = 1</span>
<span id="cb4-36"><a href="#cb4-36"></a><span class="ex">request_memory</span> = 3GB</span>
<span id="cb4-37"><a href="#cb4-37"></a><span class="ex">request_disk</span> = 1GB</span>
<span id="cb4-38"><a href="#cb4-38"></a><span class="co">#</span></span>
<span id="cb4-39"><a href="#cb4-39"></a><span class="ex">requirements</span> = (OpSysMajorVer == 6) <span class="kw">||</span> <span class="kw">(</span><span class="ex">OpSysMajorVer</span> == 7<span class="kw">)</span></span>
<span id="cb4-40"><a href="#cb4-40"></a></span>
<span id="cb4-41"><a href="#cb4-41"></a><span class="co"># which computer grids to use:</span></span>
<span id="cb4-42"><a href="#cb4-42"></a><span class="ex">+WantFlocking</span> = true</span>
<span id="cb4-43"><a href="#cb4-43"></a><span class="ex">+WantGlideIn</span> = true</span>
<span id="cb4-44"><a href="#cb4-44"></a></span>
<span id="cb4-45"><a href="#cb4-45"></a><span class="co"># Tell HTCondor to run instances of our job:</span></span>
<span id="cb4-46"><a href="#cb4-46"></a><span class="ex">queue</span> 1000</span></code></pre></div>
<p>The ordering of the arguments on in the line that starts with <code>arguments =</code> dictates the numbers that are assigned to each argument. These numbers are used in the shell script, above.</p>
</div>
<div id="files-on-squid" class="section level3">
<h3>Files on <code>SQUID</code></h3>
<p>The UW-Madison CHTC provides for each user disk space on a web proxy. More information about <code>SQUID</code> can be found here: <a href="http://chtc.cs.wisc.edu/file-avail-squid.shtml" class="uri">http://chtc.cs.wisc.edu/file-avail-squid.shtml</a></p>
<p>In practice, we placed files containing founder allele dosages (for chromosomes of interest) and our (compressed) R installation on <code>SQUID</code>.</p>
</div>
</div>
<div id="submitting-jobs-to-condor-at-uw-madison-chtc" class="section level2">
<h2>Submitting jobs to Condor (at UW-Madison CHTC)</h2>
<p>We followed the usual procedure for submitting R jobs with the CHTC. To submit the file <code>boot-Recla-10-22.sub</code>, we first changed into its directory. We then typed</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1"></a><span class="ex">condor_submit</span> boot-Recla-10-22.sub</span></code></pre></div>
<p>By using this command from within the <code>submit_files</code> subdirectory, we ensure that our outputted files are returned to the <code>submit_files</code> subdirectory. We then manually moved the outputted results files to the <code>results</code> subdirectory.</p>
<p>We found that up to ten percent of jobs would initially fail and require re-submission. There are a variety of reasons that may explain the need for re-submission. Because of this need, we include in the git repository the file <code>boot-Recla-10-22-fix.sub</code>, which gives the code that we used for resubmission. The file <code>bad-jobs-run561</code> gives the ids of the jobs that failed the initial runs.</p>
</div>
<div id="session-info" class="section level2">
<h2>Session info</h2>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1"></a>devtools<span class="op">::</span><span class="kw">session_info</span>()</span></code></pre></div>
<pre><code>## ─ Session info ───────────────────────────────────────────────────────────────
## setting value
## version R version 4.0.0 (2020-04-24)
## os Ubuntu 20.04 LTS
## system x86_64, linux-gnu
## ui X11
## language (EN)
## collate en_US.UTF-8
## ctype en_US.UTF-8
## tz America/New_York
## date 2020-06-29
##
## ─ Packages ───────────────────────────────────────────────────────────────────
## package * version date lib source
## assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.0)
## backports 1.1.8 2020-06-17 [2] CRAN (R 4.0.0)
## callr 3.4.3 2020-03-28 [2] CRAN (R 4.0.0)
## cli 2.0.2 2020-02-28 [2] CRAN (R 4.0.0)
## crayon 1.3.4 2017-09-16 [2] CRAN (R 4.0.0)
## desc 1.2.0 2018-05-01 [2] CRAN (R 4.0.0)
## devtools 2.3.0 2020-04-10 [2] CRAN (R 4.0.0)
## digest 0.6.25 2020-02-23 [2] CRAN (R 4.0.0)
## ellipsis 0.3.1 2020-05-15 [2] CRAN (R 4.0.0)
## evaluate 0.14 2019-05-28 [2] CRAN (R 4.0.0)
## fansi 0.4.1 2020-01-08 [2] CRAN (R 4.0.0)
## fs 1.4.1 2020-04-04 [2] CRAN (R 4.0.0)
## glue 1.4.1 2020-05-13 [2] CRAN (R 4.0.0)
## htmltools 0.5.0 2020-06-16 [2] CRAN (R 4.0.0)
## knitr 1.28 2020-02-06 [2] CRAN (R 4.0.0)
## magrittr 1.5 2014-11-22 [2] CRAN (R 4.0.0)
## memoise 1.1.0 2017-04-21 [2] CRAN (R 4.0.0)
## pkgbuild 1.0.8 2020-05-07 [2] CRAN (R 4.0.0)
## pkgload 1.1.0 2020-05-29 [2] CRAN (R 4.0.0)
## prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.0.0)
## processx 3.4.2 2020-02-09 [2] CRAN (R 4.0.0)
## ps 1.3.3 2020-05-08 [2] CRAN (R 4.0.0)
## R6 2.4.1 2019-11-12 [2] CRAN (R 4.0.0)
## remotes 2.1.1 2020-02-15 [2] CRAN (R 4.0.0)
## rlang 0.4.6 2020-05-02 [2] CRAN (R 4.0.0)
## rmarkdown 2.3 2020-06-18 [2] CRAN (R 4.0.0)
## rprojroot 1.3-2 2018-01-03 [2] CRAN (R 4.0.0)
## rstudioapi 0.11 2020-02-07 [2] CRAN (R 4.0.0)
## sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.0)
## stringi 1.4.6 2020-02-17 [2] CRAN (R 4.0.0)
## stringr 1.4.0 2019-02-10 [2] CRAN (R 4.0.0)
## testthat 2.3.2 2020-03-02 [2] CRAN (R 4.0.0)
## usethis 1.6.1 2020-04-29 [2] CRAN (R 4.0.0)
## withr 2.2.0 2020-04-20 [2] CRAN (R 4.0.0)
## xfun 0.15 2020-06-21 [2] CRAN (R 4.0.0)
## yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.0)
##
## [1] /tmp/RtmpdlvULy/temp_libpath1b4b6666b916
## [2] /home/fred/R/x86_64-pc-linux-gnu-library/4.0
## [3] /usr/local/lib/R/site-library
## [4] /usr/lib/R/site-library
## [5] /usr/lib/R/library</code></pre>
</div>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>