Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreypullin committed Mar 7, 2024
1 parent 382cf22 commit 7c6b27c
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b5d8cf0d
7cb7ad32
Binary file modified pqtl-eqtl-coloc-analysis_files/figure-html/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pqtl-eqtl-coloc-analysis_files/figure-html/unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pqtl-eqtl-coloc-analysis_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@
"href": "simulation-analysis.html",
"title": "Simulation analysis",
"section": "",
"text": "renv::load(here::here())\n\n- The project is out-of-sync -- use `renv::status()` for details.\n\nlibrary(dplyr)\nlibrary(readr)\nlibrary(ggplot2)\nlibrary(glue)\n\n\nlocus <- c(\"PTPN22\", \"IL21\", \"IRF5\")\nsimulation_data <- lapply(locus, function(x) {\n here::here(glue(\"output/data/sim-result-{x}.rds\")) |>\n read_rds() |>\n mutate(locus = x)\n}) |>\n bind_rows()\n\n\nsimulation_data |>\n mutate(\n fp = hyp == \"h3\" & pp_h4 >= 0.8,\n tp = hyp == \"h4\" & pp_h4 >= 0.8,\n fn = hyp == \"h4\" & pp_h4 < 0.8\n ) |>\n summarise(\n n_tp = sum(tp),\n n_fn = sum(fn), \n n_fp = sum(fp),\n .by = prior\n ) |>\n mutate(\n recall = n_tp / (n_tp + n_fn),\n precision = n_tp / (n_tp + n_fp)\n )\n\n# A tibble: 2 × 6\n prior n_tp n_fn n_fp recall precision\n <chr> <int> <int> <int> <dbl> <dbl>\n1 unif 125 25 14 0.833 0.899\n2 non_unif 124 26 12 0.827 0.912\n\n\n\nsimulation_data |>\n ggplot(aes(hyp, pp_h4, fill = prior)) + \n geom_boxplot(position = \"dodge\") + \n geom_hline(yintercept = 0.8, linetype = \"dashed\") +\n theme_bw() + \n labs(\n x = \"True hypothesis\", \n y = \"Mean Pr(H4)\",\n fill = \"Prior type\"\n )\n\n\n\n\n\nsimulation_data |>\n ggplot(aes(hyp, pp_h4, fill = prior)) +\n geom_boxplot(position = \"dodge\") +\n geom_hline(yintercept = 0.8, linetype = \"dashed\") +\n theme_bw() +\n labs(\n x = \"True hypothesis\",\n y = \"Mean Pr(H4)\",\n fill = \"Prior type\"\n ) +\n facet_wrap(~locus)"
"text": "renv::load(here::here())\n\n- The project is out-of-sync -- use `renv::status()` for details.\n\nlibrary(dplyr)\nlibrary(readr)\nlibrary(ggplot2)\nlibrary(glue)\n\ndevtools::load_all(\"~/coloc\")\n\n\nlocus <- c(\"PTPN22\", \"IL21\", \"IRF5\", \"IFT172\")\nsimulation_data <- lapply(locus, function(x) {\n here::here(glue(\"output/data/sim-result-{x}.rds\")) |>\n read_rds() |>\n mutate(locus = x)\n}) |>\n bind_rows()\n\n\nsimulation_data |>\n mutate(\n fp = hyp == \"h3\" & pp_h4 >= 0.8,\n tp = hyp == \"h4\" & pp_h4 >= 0.8,\n fn = hyp == \"h4\" & pp_h4 < 0.8\n ) |>\n summarise(\n n_tp = sum(tp),\n n_fn = sum(fn), \n n_fp = sum(fp),\n .by = prior\n ) |>\n mutate(\n recall = n_tp / (n_tp + n_fn),\n precision = n_tp / (n_tp + n_fp)\n )\n\n# A tibble: 2 × 6\n prior n_tp n_fn n_fp recall precision\n <chr> <int> <int> <int> <dbl> <dbl>\n1 unif 132 67 9 0.663 0.936\n2 non_unif 141 58 10 0.709 0.934\n\n\n\nsimulation_data |>\n ggplot(aes(hyp, pp_h4, fill = prior)) + \n geom_boxplot(position = \"dodge\") + \n geom_hline(yintercept = 0.8, linetype = \"dashed\") +\n theme_bw() + \n labs(\n x = \"True hypothesis\", \n y = \"Mean Pr(H4)\",\n fill = \"Prior type\"\n )\n\n\n\n\n\nsimulation_data |>\n ggplot(aes(hyp, pp_h4, fill = prior)) +\n geom_boxplot(position = \"dodge\") +\n geom_hline(yintercept = 0.8, linetype = \"dashed\") +\n theme_bw() +\n labs(\n x = \"True hypothesis\",\n y = \"Mean Pr(H4)\",\n fill = \"Prior type\"\n ) +\n facet_wrap(~locus)\n\n\n\n\n\nloci <- c(\"PTPN22\", \"IL21\", \"IRF5\", \"IFT172\")\nprior_weights <- list()\npos <- list()\nlocus <- list()\nfor (i in seq_along(loci)) {\n file <- glue(here::here(\"data/{loci[[i]]}.vcf.gz.impute.legend\"))\n legend <- read_delim(file, show_col_types = FALSE) \n pos[[i]] <- legend$pos\n prior_weights[[i]] <- compute_eqtl_tss_dist_prior_weights(\n pos[[i]],\n round(median(pos[[i]]), 0),\n read_rds(here::here(\"output/densities/eqtlgen.rds\"))\n )\n locus[[i]] <- rep(loci[[i]], length(pos[[i]]))\n}\n\ntibble(\n locus = unlist(locus),\n pos = unlist(pos),\n prior_weight = unlist(prior_weights)\n) |> \n ggplot(aes(pos, prior_weight)) + \n geom_point() + \n facet_wrap(~ locus, scales = \"free_x\") + \n labs(\n x = \"Position\",\n y = \"Prior weight\"\n ) + \n theme_bw()"
}
]
44 changes: 40 additions & 4 deletions simulation-analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ <h1 class="title">Simulation analysis</h1>
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(dplyr)</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(readr)</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(ggplot2)</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(glue)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(glue)</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>devtools<span class="sc">::</span><span class="fu">load_all</span>(<span class="st">"~/coloc"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>locus <span class="ot">&lt;-</span> <span class="fu">c</span>(<span class="st">"PTPN22"</span>, <span class="st">"IL21"</span>, <span class="st">"IRF5"</span>)</span>
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>locus <span class="ot">&lt;-</span> <span class="fu">c</span>(<span class="st">"PTPN22"</span>, <span class="st">"IL21"</span>, <span class="st">"IRF5"</span>, <span class="st">"IFT172"</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>simulation_data <span class="ot">&lt;-</span> <span class="fu">lapply</span>(locus, <span class="cf">function</span>(x) {</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> here<span class="sc">::</span><span class="fu">here</span>(<span class="fu">glue</span>(<span class="st">"output/data/sim-result-{x}.rds"</span>)) <span class="sc">|&gt;</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">read_rds</span>() <span class="sc">|&gt;</span></span>
Expand Down Expand Up @@ -192,8 +194,8 @@ <h1 class="title">Simulation analysis</h1>
<pre><code># A tibble: 2 × 6
prior n_tp n_fn n_fp recall precision
&lt;chr&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;dbl&gt; &lt;dbl&gt;
1 unif 125 25 14 0.833 0.899
2 non_unif 124 26 12 0.827 0.912</code></pre>
1 unif 132 67 9 0.663 0.936
2 non_unif 141 58 10 0.709 0.934</code></pre>
</div>
</div>
<div class="cell">
Expand Down Expand Up @@ -227,6 +229,40 @@ <h1 class="title">Simulation analysis</h1>
<p><img src="simulation-analysis_files/figure-html/unnamed-chunk-4-1.png" class="img-fluid" width="672"></p>
</div>
</div>
<div class="cell">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>loci <span class="ot">&lt;-</span> <span class="fu">c</span>(<span class="st">"PTPN22"</span>, <span class="st">"IL21"</span>, <span class="st">"IRF5"</span>, <span class="st">"IFT172"</span>)</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>prior_weights <span class="ot">&lt;-</span> <span class="fu">list</span>()</span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>pos <span class="ot">&lt;-</span> <span class="fu">list</span>()</span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a>locus <span class="ot">&lt;-</span> <span class="fu">list</span>()</span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> (i <span class="cf">in</span> <span class="fu">seq_along</span>(loci)) {</span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a> file <span class="ot">&lt;-</span> <span class="fu">glue</span>(here<span class="sc">::</span><span class="fu">here</span>(<span class="st">"data/{loci[[i]]}.vcf.gz.impute.legend"</span>))</span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a> legend <span class="ot">&lt;-</span> <span class="fu">read_delim</span>(file, <span class="at">show_col_types =</span> <span class="cn">FALSE</span>) </span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a> pos[[i]] <span class="ot">&lt;-</span> legend<span class="sc">$</span>pos</span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a> prior_weights[[i]] <span class="ot">&lt;-</span> <span class="fu">compute_eqtl_tss_dist_prior_weights</span>(</span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a> pos[[i]],</span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">round</span>(<span class="fu">median</span>(pos[[i]]), <span class="dv">0</span>),</span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">read_rds</span>(here<span class="sc">::</span><span class="fu">here</span>(<span class="st">"output/densities/eqtlgen.rds"</span>))</span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb9-14"><a href="#cb9-14" aria-hidden="true" tabindex="-1"></a> locus[[i]] <span class="ot">&lt;-</span> <span class="fu">rep</span>(loci[[i]], <span class="fu">length</span>(pos[[i]]))</span>
<span id="cb9-15"><a href="#cb9-15" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb9-16"><a href="#cb9-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a><span class="fu">tibble</span>(</span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true" tabindex="-1"></a> <span class="at">locus =</span> <span class="fu">unlist</span>(locus),</span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true" tabindex="-1"></a> <span class="at">pos =</span> <span class="fu">unlist</span>(pos),</span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true" tabindex="-1"></a> <span class="at">prior_weight =</span> <span class="fu">unlist</span>(prior_weights)</span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true" tabindex="-1"></a>) <span class="sc">|&gt;</span> </span>
<span id="cb9-22"><a href="#cb9-22" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>(<span class="fu">aes</span>(pos, prior_weight)) <span class="sc">+</span> </span>
<span id="cb9-23"><a href="#cb9-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>() <span class="sc">+</span> </span>
<span id="cb9-24"><a href="#cb9-24" aria-hidden="true" tabindex="-1"></a> <span class="fu">facet_wrap</span>(<span class="sc">~</span> locus, <span class="at">scales =</span> <span class="st">"free_x"</span>) <span class="sc">+</span> </span>
<span id="cb9-25"><a href="#cb9-25" aria-hidden="true" tabindex="-1"></a> <span class="fu">labs</span>(</span>
<span id="cb9-26"><a href="#cb9-26" aria-hidden="true" tabindex="-1"></a> <span class="at">x =</span> <span class="st">"Position"</span>,</span>
<span id="cb9-27"><a href="#cb9-27" aria-hidden="true" tabindex="-1"></a> <span class="at">y =</span> <span class="st">"Prior weight"</span></span>
<span id="cb9-28"><a href="#cb9-28" aria-hidden="true" tabindex="-1"></a> ) <span class="sc">+</span> </span>
<span id="cb9-29"><a href="#cb9-29" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_bw</span>() </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<p><img src="simulation-analysis_files/figure-html/unnamed-chunk-5-1.png" class="img-fluid" width="672"></p>
</div>
</div>



Expand Down
Binary file modified simulation-analysis_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified simulation-analysis_files/figure-html/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/eqtl-tss-distance-analysis.html</loc>
<lastmod>2024-03-05T17:48:29.034Z</lastmod>
<lastmod>2024-03-07T11:13:26.728Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/pqtl-eqtl-coloc-analysis.html</loc>
<lastmod>2024-03-05T17:48:06.625Z</lastmod>
<lastmod>2024-03-07T11:13:01.778Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/index.html</loc>
<lastmod>2024-03-05T17:46:02.935Z</lastmod>
<lastmod>2024-03-07T11:11:00.679Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/finemapping-analysis.html</loc>
<lastmod>2024-03-05T17:45:51.912Z</lastmod>
<lastmod>2024-03-07T11:10:51.035Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/gwas-eqtl-coloc-analysis.html</loc>
<lastmod>2024-03-05T17:46:02.626Z</lastmod>
<lastmod>2024-03-07T11:11:00.402Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/prior-visualisation.html</loc>
<lastmod>2024-03-05T17:47:46.565Z</lastmod>
<lastmod>2024-03-07T11:12:42.725Z</lastmod>
</url>
<url>
<loc>https://jeffreypullin.github.io/coloc-estimated-eqtl-priors/simulation-analysis.html</loc>
<lastmod>2024-03-05T17:48:13.528Z</lastmod>
<lastmod>2024-03-07T11:13:11.092Z</lastmod>
</url>
</urlset>

0 comments on commit 7c6b27c

Please sign in to comment.