Skip to content

Instantly share code, notes, and snippets.

@dlaehnemann
dlaehnemann / evidence_plot.json
Last active June 7, 2023 13:41
horizontal stacked bar evidence plot with category selection
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"params": [
{
"name": "orientation",
"bind": {"input": "checkbox"}
},
{
"name": "strand",
"value": "true",
@dlaehnemann
dlaehnemann / gist:97fa14cd8a397080ed5751383ee66933
Created May 28, 2020 10:43
R example to get purity from the GDC HTTP request API
library("tidyverse")
library("httr")
try_fields <- function(case_hash) {
print(str_c("Now on case with hash:", case_hash, sep=" ") )
# all fields that can contain a tumor purity value
fields = c(
"files.cases.samples.portions.slides.percent_tumor_cells",
"files.cases.samples.portions.slides.percent_tumor_nuclei",
"samples.portions.slides.percent_tumor_cells",
@dlaehnemann
dlaehnemann / libprosic_refactor-framework_0b94b7d1dc36c217317d33302e5b38b50abcb839.svg
Created February 26, 2019 12:24
libprosic flamegraph of test09 on branch refactor-framework at commit 0b94b7d1dc36c217317d33302e5b38b50abcb839
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlaehnemann
dlaehnemann / contribute_github_without_write_access.md
Last active May 1, 2024 13:32
contributing to github repo without write access: pull from origin repo, push to your own fork

Whenever I want to create pull requests to a repo that I don't have write access to, I:

  1. Fork the original repo to my account.
  2. Clone the original repo to my local machine.
  3. Add my fork as an additional remote and make it the push default.
  4. Make changes in a new branch locally.
  5. Push this branch to my fork.
  6. Create a pull request from there.
@dlaehnemann
dlaehnemann / Rstudio_ubuntu_conda_r_installation.md
Last active August 25, 2023 09:39
Using Rstudio desktop with a custom R installation under Ubuntu 18.04 (in this case, conda)

I try to use conda for as many software installations in data analysis as possible, as this will ususally guarantee that I can use up to date versions of that software.

This now includes R, and as I mostly use R through Rstudio Desktop, I checked how I can use a custom R installation with Rstudio Desktop. As described in the Rstudio docs, you just have to set the environment variable RSTUDIO_WHICH_R to the R binary of your wanted installation. For this environment variable to be set when launching Rstudio from Ubuntu's application launcher, you have to make the respective environment setting in the rstudio.desktop file.

As a reminder for me, and maybe as info for others, the general setup is:

  1. Install Rstudio: https://www.rstudio.com/products/rstudio/download/#download
  2. Install (Mini-)conda: https://conda.io/miniconda.html
@dlaehnemann
dlaehnemann / libprosic_use-optimized-pairhmm_b7b3dc0b9e35bc527562632fc8cc9c07bb182671.svg
Created November 26, 2018 15:16
libprosic flamegraph of test09 on branch use-optimized-pairhmm at commit b7b3dc0b9e35bc527562632fc8cc9c07bb182671
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlaehnemann
dlaehnemann / libprosic_use-optimized-pairhmm_4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6_desktop_debug-in-bench-profile.svg
Created November 23, 2018 10:39
libprosic flamegraph of test09 on branch use-optimized-pairhmm at commit 4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6 -- debug annotation requested in `profile.bench`, run on desktop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlaehnemann
dlaehnemann / libprosic_use-optimized-pairhmm_4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6_desktop_no-debug-release-profile.svg
Created November 23, 2018 10:35
libprosic flamegraph of test09 on branch use-optimized-pairhmm at commit 4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6 -- no debug annotations included in release binary, run on desktop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlaehnemann
dlaehnemann / libprosic_use-optimized-pairhmm_4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6_desktop.svg
Created November 23, 2018 09:49
libprosic flamegraph of test09 on branch use-optimized-pairhmm at commit 4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6 -- proper debug annotations included in release binary and run on the desktop machine
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlaehnemann
dlaehnemann / flame_libprosic_use-optimized-pairhmm_4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6.svg
Created November 22, 2018 12:57
libprosic flamegraph of test09 on branch use-optimized-pairhmm at commit 4503ae6eebd6586d53f4e8ddb263b4ea28dd9ea6 -- proper debug annotations included in release binary
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.