Commit ba2936b9 authored by Rauschenberger's avatar Rauschenberger
Browse files

automation

parent 6208b0f1
......@@ -905,7 +905,7 @@ test.multiple <- function(Y,X,map,rho=c(0,0.5,1),spec=1){
if(TRUE){
max <- p/0.05+1
limit <- ceiling(0.05*max/p)
steps <- diff(limit^seq(from=1,to=log(max)/log(limit),length.out=pmin(p,50))) # was (p,20)
steps <- diff(limit^seq(from=1,to=log(max)/log(limit),length.out=pmin(p,20))) # was (p,20)
steps <- c(limit,round(steps)) # Or replace "limit" by "minimum # of permutations"!
steps[length(steps)] <- max-sum(steps[-length(steps)])
}
......
......@@ -193,10 +193,10 @@
<a class="sourceLine" id="cb5-8" data-line-number="8"> <span class="co"># if(wait){Sys.sleep(60);cat(".")}</span></a>
<a class="sourceLine" id="cb5-9" data-line-number="9"> <span class="co">#} </span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"> </a>
<a class="sourceLine" id="cb5-11" data-line-number="11"> <span class="kw">rm</span>(<span class="dt">list=</span><span class="kw">setdiff</span>(<span class="kw">ls</span>(),<span class="kw">c</span>(<span class="st">"data"</span>,<span class="st">"chr"</span>,<span class="st">"path"</span>))); <span class="kw">gc</span>()</a>
<a class="sourceLine" id="cb5-12" data-line-number="12"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"temp."</span>,data,<span class="st">".chr"</span>,chr,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb5-13" data-line-number="13"> pvalue &lt;-<span class="st"> </span>spliceQTL<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/spliceQTL/topics/test.multiple">test.multiple</a></span>(<span class="dt">Y=</span>exons,<span class="dt">X=</span>snps,<span class="dt">map=</span>map,<span class="dt">rho=</span><span class="dv">1</span>,<span class="dt">spec=</span><span class="dv">20</span>)</a>
<a class="sourceLine" id="cb5-14" data-line-number="14"> <span class="kw">save</span>(<span class="dt">object=</span>pvalue,<span class="dt">file=</span><span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval."</span>,data,<span class="st">".chr"</span>,chr,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb5-11" data-line-number="11"> <span class="kw">rm</span>(<span class="dt">list=</span><span class="kw">setdiff</span>(<span class="kw">ls</span>(),<span class="kw">c</span>(<span class="st">"data"</span>,<span class="st">"chr"</span>,<span class="st">"path"</span>))); <span class="kw">gc</span>(); <span class="kw">cat</span>(<span class="st">"."</span>)</a>
<a class="sourceLine" id="cb5-12" data-line-number="12"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"temp."</span>,data,<span class="st">".chr"</span>,chr,<span class="st">".RData"</span>))); <span class="kw">cat</span>(<span class="st">"."</span>)</a>
<a class="sourceLine" id="cb5-13" data-line-number="13"> pvalue &lt;-<span class="st"> </span>spliceQTL<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/spliceQTL/topics/test.multiple">test.multiple</a></span>(<span class="dt">Y=</span>exons,<span class="dt">X=</span>snps,<span class="dt">map=</span>map,<span class="dt">rho=</span><span class="dv">1</span>,<span class="dt">spec=</span><span class="dv">1</span>); <span class="kw">cat</span>(<span class="st">"."</span>)</a>
<a class="sourceLine" id="cb5-14" data-line-number="14"> <span class="kw">save</span>(<span class="dt">object=</span>pvalue,<span class="dt">file=</span><span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval."</span>,data,<span class="st">".chr"</span>,chr,<span class="st">".RData"</span>))); <span class="kw">cat</span>(<span class="st">"</span><span class="ch">\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb5-15" data-line-number="15"> }</a>
<a class="sourceLine" id="cb5-16" data-line-number="16"><span class="co">#q()</span></a>
<a class="sourceLine" id="cb5-17" data-line-number="17"><span class="co">#n</span></a>
......
......@@ -116,7 +116,7 @@ for(chr in 1:22){
}
```
On the virtual machine, first restart R and then execute this chunk to test for alternative splicing. (It seems that lme4::lmer in spliceQTL::adjust.covariates fails to release memory on Linux.)
On the virtual machine, first restart R and then execute this chunk to test for alternative splicing. (It seems that lme4::lmer in spliceQTL::adjust.covariates fails to release memory on Linux.)
```{r test,eval=FALSE}
for(chr in 22:1){
......@@ -129,10 +129,10 @@ for(chr in 22:1){
# if(wait){Sys.sleep(60);cat(".")}
#}
rm(list=setdiff(ls(),c("data","chr","path"))); gc()
load(file.path(path,paste0("temp.",data,".chr",chr,".RData")))
pvalue <- spliceQTL::test.multiple(Y=exons,X=snps,map=map,rho=1,spec=20)
save(object=pvalue,file=file.path(path,paste0("pval.",data,".chr",chr,".RData")))
rm(list=setdiff(ls(),c("data","chr","path"))); gc(); cat(".")
load(file.path(path,paste0("temp.",data,".chr",chr,".RData"))); cat(".")
pvalue <- spliceQTL::test.multiple(Y=exons,X=snps,map=map,rho=1,spec=1); cat(".")
save(object=pvalue,file=file.path(path,paste0("pval.",data,".chr",chr,".RData"))); cat("\n")
}
#q()
#n
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment