Commit bd61088d authored by Rauschenberger's avatar Rauschenberger
Browse files

automation

parent 71b6f5ed
......@@ -934,16 +934,20 @@ test.multiple <- function(Y,X,map,rho=c(0,0.5,1),spec=1,min=100,steps=20){
#' This function ...
#'
#' @param Y
#' to do
#' exon expression\strong{:}
#' matrix with \eqn{n} rows (samples) and \eqn{p} columns (exons)
#'
#' @param X
#' to do
#' SNP genotype\strong{:}
#' matrix with \eqn{n} rows (samples) and \eqn{q} columns (SNPs)
#'
#' @param map
#' to do
#' list with names "genes", "exons", and "snps"
#' (output from \code{map.genes}, \code{map.exons}, and \code{map.snps})
#'
#' @param i
#' to do
#' gene index\strong{:}
#' integer between \eqn{1} and \code{nrow(map$genes)}
#'
#' @examples
#' # see vignette
......@@ -973,7 +977,7 @@ visualise <- function(Y,X,map,i){
graphics::title(main=map$genes$gene_id[i],xlab="exons",ylab="SNPs",line=1)
graphics::box()
# indicate gene location
# indicate gene location (redundant if window approx. gene)
#snp.loc <- as.numeric(sapply(strsplit(x=colnames(X),split=":"),function(x) x[[2]]))
#local <- which(map$genes$start[i] <= snp.loc[xs] & snp.loc[xs] <= map$genes$end[i])
#dx <- 1/(length(xs) - 1)
......
......@@ -182,40 +182,62 @@
<a class="sourceLine" id="cb5-8" data-line-number="8"> }</a>
<a class="sourceLine" id="cb5-9" data-line-number="9">}</a></code></pre></div>
<p>On the virtual machine, execute this chunk to compare the results between the Geuvadis and the BBMRI project.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">table &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">chr=</span><span class="kw">seq_len</span>(<span class="dv">22</span>))</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="cf">for</span>(i <span class="cf">in</span> <span class="kw">seq_len</span>(<span class="dv">22</span>)){</a>
<a class="sourceLine" id="cb6-3" data-line-number="3"> <span class="co"># load p-values</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval.Geuvadis.chr"</span>,i,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb6-5" data-line-number="5"> a &lt;-<span class="st"> </span>pvalue; pvalue &lt;-<span class="st"> </span><span class="ot">NA</span></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval.LLS.chr"</span>,i,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb6-7" data-line-number="7"> b &lt;-<span class="st"> </span>pvalue; pvalue &lt;-<span class="st"> </span><span class="ot">NA</span></a>
<a class="sourceLine" id="cb6-8" data-line-number="8"> </a>
<a class="sourceLine" id="cb6-9" data-line-number="9"> <span class="co"># filter tests</span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"> sel &lt;-<span class="st"> "rho=1"</span></a>
<a class="sourceLine" id="cb6-11" data-line-number="11"> names &lt;-<span class="st"> </span><span class="kw">intersect</span>(<span class="kw">rownames</span>(a),<span class="kw">rownames</span>(b))</a>
<a class="sourceLine" id="cb6-12" data-line-number="12"> a &lt;-<span class="st"> </span>a[names,sel]</a>
<a class="sourceLine" id="cb6-13" data-line-number="13"> b &lt;-<span class="st"> </span>b[names,sel]</a>
<a class="sourceLine" id="cb6-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb6-15" data-line-number="15"> <span class="co"># correlation</span></a>
<a class="sourceLine" id="cb6-16" data-line-number="16"> spliceQTL<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/spliceQTL/topics/grid">grid</a></span>(<span class="dt">x=</span><span class="op">-</span><span class="kw">log</span>(a),<span class="dt">y=</span><span class="op">-</span><span class="kw">log</span>(b),<span class="dt">n=</span><span class="dv">20</span>)</a>
<a class="sourceLine" id="cb6-17" data-line-number="17"> table<span class="op">$</span>cor[i] &lt;-<span class="st"> </span><span class="kw">round</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/cor">cor</a></span>(<span class="op">-</span><span class="kw">log</span>(a),<span class="op">-</span><span class="kw">log</span>(b),<span class="dt">method=</span><span class="st">"pearson"</span>),<span class="dt">digits=</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb6-18" data-line-number="18"> table<span class="op">$</span>cor.test[i] &lt;-<span class="st"> </span><span class="kw">signif</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/cor.test">cor.test</a></span>(<span class="op">-</span><span class="kw">log</span>(a),<span class="op">-</span><span class="kw">log</span>(b),<span class="dt">method=</span><span class="st">"pearson"</span>)<span class="op">$</span>p.value,<span class="dt">digits=</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb6-19" data-line-number="19"> </a>
<a class="sourceLine" id="cb6-20" data-line-number="20"> <span class="co"># significance</span></a>
<a class="sourceLine" id="cb6-21" data-line-number="21"> a &lt;-<span class="st"> </span>stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/p.adjust">p.adjust</a></span>(a)<span class="op">&lt;</span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb6-22" data-line-number="22"> b &lt;-<span class="st"> </span>stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/p.adjust">p.adjust</a></span>(b)<span class="op">&lt;</span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb6-23" data-line-number="23"> table<span class="op">$</span>none[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(<span class="op">!</span>a <span class="op">&amp;</span><span class="st"> </span><span class="op">!</span>b)</a>
<a class="sourceLine" id="cb6-24" data-line-number="24"> table<span class="op">$</span>GEU[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(a <span class="op">&amp;</span><span class="st"> </span><span class="op">!</span>b)</a>
<a class="sourceLine" id="cb6-25" data-line-number="25"> table<span class="op">$</span>LLS[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(<span class="op">!</span>a <span class="op">&amp;</span><span class="st"> </span>b)</a>
<a class="sourceLine" id="cb6-26" data-line-number="26"> table<span class="op">$</span>both[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(a <span class="op">&amp;</span><span class="st"> </span>b)</a>
<a class="sourceLine" id="cb6-27" data-line-number="27"> table<span class="op">$</span>chisq.test[i] &lt;-<span class="st"> </span><span class="kw">suppressWarnings</span>(<span class="kw">signif</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/chisq.test">chisq.test</a></span>(<span class="kw">table</span>(a,b))<span class="op">$</span>p.value,<span class="dt">digits=</span><span class="dv">2</span>))</a>
<a class="sourceLine" id="cb6-28" data-line-number="28"> </a>
<a class="sourceLine" id="cb6-29" data-line-number="29">}</a></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">data &lt;-<span class="st"> "LLS"</span> <span class="co"># "Geuvadis" or "LLS"</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2">chr &lt;-<span class="st"> </span><span class="dv">1</span> <span class="co"># 1,2,3,...,22</span></a>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">list &lt;-<span class="st"> </span><span class="kw">list</span>()</a>
<a class="sourceLine" id="cb6-2" data-line-number="2">table &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">chr=</span><span class="kw">seq_len</span>(<span class="dv">22</span>))</a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="cf">for</span>(i <span class="cf">in</span> <span class="kw">seq_len</span>(<span class="dv">22</span>)){</a>
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="co"># load p-values</span></a>
<a class="sourceLine" id="cb6-5" data-line-number="5"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval.Geuvadis.chr"</span>,i,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb6-6" data-line-number="6"> a &lt;-<span class="st"> </span>pvalue; pvalue &lt;-<span class="st"> </span><span class="ot">NA</span></a>
<a class="sourceLine" id="cb6-7" data-line-number="7"> <span class="kw">load</span>(<span class="kw">file.path</span>(path,<span class="kw">paste0</span>(<span class="st">"pval.LLS.chr"</span>,i,<span class="st">".RData"</span>)))</a>
<a class="sourceLine" id="cb6-8" data-line-number="8"> b &lt;-<span class="st"> </span>pvalue; pvalue &lt;-<span class="st"> </span><span class="ot">NA</span></a>
<a class="sourceLine" id="cb6-9" data-line-number="9"> </a>
<a class="sourceLine" id="cb6-10" data-line-number="10"> <span class="co"># filter tests</span></a>
<a class="sourceLine" id="cb6-11" data-line-number="11"> sel &lt;-<span class="st"> "rho=1"</span></a>
<a class="sourceLine" id="cb6-12" data-line-number="12"> names &lt;-<span class="st"> </span><span class="kw">intersect</span>(<span class="kw">rownames</span>(a),<span class="kw">rownames</span>(b))</a>
<a class="sourceLine" id="cb6-13" data-line-number="13"> a &lt;-<span class="st"> </span>a[names,sel]</a>
<a class="sourceLine" id="cb6-14" data-line-number="14"> b &lt;-<span class="st"> </span>b[names,sel]</a>
<a class="sourceLine" id="cb6-15" data-line-number="15"> </a>
<a class="sourceLine" id="cb6-16" data-line-number="16"> <span class="co">#graphics::plot.new()</span></a>
<a class="sourceLine" id="cb6-17" data-line-number="17"> <span class="co">#graphics::plot.window(xlim=c(0.5,length(a)+0.5),ylim=c(-1,1)*max(c(a,b)))</span></a>
<a class="sourceLine" id="cb6-18" data-line-number="18"> <span class="co">#graphics::box()</span></a>
<a class="sourceLine" id="cb6-19" data-line-number="19"> <span class="co">#graphics::axis(side=1)</span></a>
<a class="sourceLine" id="cb6-20" data-line-number="20"> <span class="co">#graphics::axis(side=2)</span></a>
<a class="sourceLine" id="cb6-21" data-line-number="21"> <span class="co">#graphics::points(a,col="red")</span></a>
<a class="sourceLine" id="cb6-22" data-line-number="22"> <span class="co">#graphics::segments(x0=seq_along(a),y0=0,y1=a,col="red")</span></a>
<a class="sourceLine" id="cb6-23" data-line-number="23"> <span class="co">#graphics::points(-b,col="blue")</span></a>
<a class="sourceLine" id="cb6-24" data-line-number="24"> <span class="co">#graphics::segments(x0=seq_along(b),y0=0,y1=-b,col="blue")</span></a>
<a class="sourceLine" id="cb6-25" data-line-number="25"> <span class="co">#graphics::abline(h=0,col="grey")</span></a>
<a class="sourceLine" id="cb6-26" data-line-number="26"> </a>
<a class="sourceLine" id="cb6-27" data-line-number="27"> <span class="co"># correlation</span></a>
<a class="sourceLine" id="cb6-28" data-line-number="28"> file &lt;-<span class="st"> </span><span class="kw">file.path</span>(path,<span class="st">"plots"</span>,<span class="kw">paste0</span>(<span class="st">"cor.chr"</span>,i,<span class="st">".pdf"</span>))</a>
<a class="sourceLine" id="cb6-29" data-line-number="29"> grDevices<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/grDevices/topics/pdf">pdf</a></span>(<span class="dt">file=</span>file,<span class="dt">width=</span><span class="dv">4</span>,<span class="dt">height=</span><span class="dv">4</span>)</a>
<a class="sourceLine" id="cb6-30" data-line-number="30"> spliceQTL<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/spliceQTL/topics/grid">grid</a></span>(<span class="dt">x=</span><span class="op">-</span><span class="kw">log</span>(a),<span class="dt">y=</span><span class="op">-</span><span class="kw">log</span>(b),<span class="dt">n=</span><span class="dv">20</span>)</a>
<a class="sourceLine" id="cb6-31" data-line-number="31"> grDevices<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/grDevices/topics/dev">dev.off</a></span>()</a>
<a class="sourceLine" id="cb6-32" data-line-number="32"> table<span class="op">$</span>cor[i] &lt;-<span class="st"> </span><span class="kw">round</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/cor">cor</a></span>(<span class="op">-</span><span class="kw">log</span>(a),<span class="op">-</span><span class="kw">log</span>(b),<span class="dt">method=</span><span class="st">"pearson"</span>),<span class="dt">digits=</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb6-33" data-line-number="33"> table<span class="op">$</span>cor.test[i] &lt;-<span class="st"> </span><span class="kw">signif</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/cor.test">cor.test</a></span>(<span class="op">-</span><span class="kw">log</span>(a),<span class="op">-</span><span class="kw">log</span>(b),<span class="dt">method=</span><span class="st">"pearson"</span>)<span class="op">$</span>p.value,<span class="dt">digits=</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb6-34" data-line-number="34"> </a>
<a class="sourceLine" id="cb6-35" data-line-number="35"> <span class="co"># significance</span></a>
<a class="sourceLine" id="cb6-36" data-line-number="36"> a &lt;-<span class="st"> </span>stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/p.adjust">p.adjust</a></span>(a)<span class="op">&lt;</span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb6-37" data-line-number="37"> b &lt;-<span class="st"> </span>stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/p.adjust">p.adjust</a></span>(b)<span class="op">&lt;</span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb6-38" data-line-number="38"> table<span class="op">$</span>none[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(<span class="op">!</span>a <span class="op">&amp;</span><span class="st"> </span><span class="op">!</span>b)</a>
<a class="sourceLine" id="cb6-39" data-line-number="39"> table<span class="op">$</span>onlyGEU[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(a <span class="op">&amp;</span><span class="st"> </span><span class="op">!</span>b)</a>
<a class="sourceLine" id="cb6-40" data-line-number="40"> table<span class="op">$</span>onlyLLS[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(<span class="op">!</span>a <span class="op">&amp;</span><span class="st"> </span>b)</a>
<a class="sourceLine" id="cb6-41" data-line-number="41"> table<span class="op">$</span>both[i] &lt;-<span class="st"> </span><span class="kw">sum</span>(a <span class="op">&amp;</span><span class="st"> </span>b)</a>
<a class="sourceLine" id="cb6-42" data-line-number="42"> table<span class="op">$</span>chisq.test[i] &lt;-<span class="st"> </span><span class="kw">suppressWarnings</span>(<span class="kw">signif</span>(stats<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/stats/topics/chisq.test">chisq.test</a></span>(<span class="kw">table</span>(a,b))<span class="op">$</span>p.value,<span class="dt">digits=</span><span class="dv">2</span>))</a>
<a class="sourceLine" id="cb6-43" data-line-number="43"> </a>
<a class="sourceLine" id="cb6-44" data-line-number="44"> list[[i]] &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">chr=</span>i,<span class="dt">gene=</span><span class="kw">names</span>(a),<span class="dt">Geuvadis=</span><span class="dv">1</span><span class="op">*</span>a,<span class="dt">LLS=</span><span class="dv">1</span><span class="op">*</span>b,<span class="dt">row.names=</span><span class="kw">seq_along</span>(a))</a>
<a class="sourceLine" id="cb6-45" data-line-number="45"> </a>
<a class="sourceLine" id="cb6-46" data-line-number="46">}</a>
<a class="sourceLine" id="cb6-47" data-line-number="47">list &lt;-<span class="st"> </span><span class="kw">do.call</span>(<span class="dt">what=</span><span class="st">"rbind"</span>,<span class="dt">args=</span>list)</a>
<a class="sourceLine" id="cb6-48" data-line-number="48"><span class="kw">save</span>(list,<span class="dt">file=</span><span class="st">"list.RData"</span>)</a>
<a class="sourceLine" id="cb6-49" data-line-number="49"><span class="kw">save</span>(table,<span class="dt">file=</span><span class="st">"table.RData"</span>)</a></code></pre></div>
<p>On the virtual machine, execute this chunk to plot correlations between SNPs and exons (unclear which genes should be examined).</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">data &lt;-<span class="st"> "LLS"</span> <span class="co"># "Geuvadis" or "LLS"</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2">chr &lt;-<span class="st"> </span><span class="dv">22</span> <span class="co"># 1,2,3,...,22</span></a>
<a class="sourceLine" id="cb7-3" data-line-number="3"><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="cb7-4" data-line-number="4">i &lt;-<span class="st"> </span><span class="kw">which</span>(map<span class="op">$</span>genes<span class="op">$</span>gene_id<span class="op">==</span><span class="st">"ENSG00000116171"</span>)</a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="kw"><a href="../reference/visualise.html">visualise</a></span>(<span class="dt">Y=</span>exons,<span class="dt">X=</span>snps,<span class="dt">map=</span>map,<span class="dt">i=</span>i)</a></code></pre></div>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="co"># id &lt;- sample(names(a)[...],size=1) # significance (e.g. a &amp; b)</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="co"># i &lt;- which(map$genes$gene_id=="...") # gene name (e.g. ENSG00000172967)</span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6">spliceQTL<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/spliceQTL/topics/visualise">visualise</a></span>(<span class="dt">Y=</span>exons,<span class="dt">X=</span>snps,<span class="dt">map=</span>map,<span class="dt">i=</span>i)</a></code></pre></div>
<!--
#wait <- TRUE
#while(wait){
......
docs/reference/grid-1.png

11 KB | W: | H:

docs/reference/grid-1.png

11.3 KB | W: | H:

docs/reference/grid-1.png
docs/reference/grid-1.png
docs/reference/grid-1.png
docs/reference/grid-1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -130,19 +130,23 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>Y</th>
<td><p>to do</p></td>
<td><p>exon expression<strong>:</strong>
matrix with \(n\) rows (samples) and \(p\) columns (exons)</p></td>
</tr>
<tr>
<th>X</th>
<td><p>to do</p></td>
<td><p>SNP genotype<strong>:</strong>
matrix with \(n\) rows (samples) and \(q\) columns (SNPs)</p></td>
</tr>
<tr>
<th>map</th>
<td><p>to do</p></td>
<td><p>list with names "genes", "exons", and "snps"
(output from <code>map.genes</code>, <code>map.exons</code>, and <code>map.snps</code>)</p></td>
</tr>
<tr>
<th>i</th>
<td><p>to do</p></td>
<td><p>gene index<strong>:</strong>
integer between \(1\) and <code>nrow(map$genes)</code></p></td>
</tr>
</table>
......
......@@ -7,13 +7,17 @@
visualise(Y, X, map, i)
}
\arguments{
\item{Y}{to do}
\item{Y}{exon expression\strong{:}
matrix with \eqn{n} rows (samples) and \eqn{p} columns (exons)}
\item{X}{to do}
\item{X}{SNP genotype\strong{:}
matrix with \eqn{n} rows (samples) and \eqn{q} columns (SNPs)}
\item{map}{to do}
\item{map}{list with names "genes", "exons", and "snps"
(output from \code{map.genes}, \code{map.exons}, and \code{map.snps})}
\item{i}{to do}
\item{i}{gene index\strong{:}
integer between \eqn{1} and \code{nrow(map$genes)}}
}
\description{
This function ...
......
......@@ -119,6 +119,7 @@ for(chr in 22:1){ # 22:1
On the virtual machine, execute this chunk to compare the results between the Geuvadis and the BBMRI project.
```{r,eval=FALSE}
list <- list()
table <- data.frame(chr=seq_len(22))
for(i in seq_len(22)){
# load p-values
......@@ -133,8 +134,22 @@ for(i in seq_len(22)){
a <- a[names,sel]
b <- b[names,sel]
#graphics::plot.new()
#graphics::plot.window(xlim=c(0.5,length(a)+0.5),ylim=c(-1,1)*max(c(a,b)))
#graphics::box()
#graphics::axis(side=1)
#graphics::axis(side=2)
#graphics::points(a,col="red")
#graphics::segments(x0=seq_along(a),y0=0,y1=a,col="red")
#graphics::points(-b,col="blue")
#graphics::segments(x0=seq_along(b),y0=0,y1=-b,col="blue")
#graphics::abline(h=0,col="grey")
# correlation
file <- file.path(path,"plots",paste0("cor.chr",i,".pdf"))
grDevices::pdf(file=file,width=4,height=4)
spliceQTL::grid(x=-log(a),y=-log(b),n=20)
grDevices::dev.off()
table$cor[i] <- round(stats::cor(-log(a),-log(b),method="pearson"),digits=2)
table$cor.test[i] <- signif(stats::cor.test(-log(a),-log(b),method="pearson")$p.value,digits=2)
......@@ -142,26 +157,31 @@ for(i in seq_len(22)){
a <- stats::p.adjust(a)<0.05
b <- stats::p.adjust(b)<0.05
table$none[i] <- sum(!a & !b)
table$GEU[i] <- sum(a & !b)
table$LLS[i] <- sum(!a & b)
table$onlyGEU[i] <- sum(a & !b)
table$onlyLLS[i] <- sum(!a & b)
table$both[i] <- sum(a & b)
table$chisq.test[i] <- suppressWarnings(signif(stats::chisq.test(table(a,b))$p.value,digits=2))
list[[i]] <- data.frame(chr=i,gene=names(a),Geuvadis=1*a,LLS=1*b,row.names=seq_along(a))
}
list <- do.call(what="rbind",args=list)
save(list,file="list.RData")
save(table,file="table.RData")
```
On the virtual machine, execute this chunk to plot correlations between SNPs and exons (unclear which genes should be examined).
```{r,eval=FALSE}
data <- "LLS" # "Geuvadis" or "LLS"
chr <- 1 # 1,2,3,...,22
data <- "LLS" # "Geuvadis" or "LLS"
chr <- 22 # 1,2,3,...,22
load(file.path(path,paste0("temp.",data,".chr",chr,".RData")))
i <- which(map$genes$gene_id=="ENSG00000116171")
visualise(Y=exons,X=snps,map=map,i=i)
# id <- sample(names(a)[...],size=1) # significance (e.g. a & b)
# i <- which(map$genes$gene_id=="...") # gene name (e.g. ENSG00000172967)
spliceQTL::visualise(Y=exons,X=snps,map=map,i=i)
```
<!--
#wait <- TRUE
#while(wait){
......
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