Skip to content

Instantly share code, notes, and snippets.

@tgirke
tgirke / _Nvim-R-Tmux.md
Last active October 13, 2023 05:29
Nvim-R-Tmux: An Integrated Working Environment for R

Nvim-R-Tmux: Neovim-based IDE for R

!!! This Gist tutorial is deprecated. Its new version is available here !!!

This is some red text.

  • Author: Thomas Girke
  • Last update: 18-Nov-2020

@tgirke
tgirke / DrugBank2SQLite.R
Last active July 28, 2023 06:17
Import DrugBank to SQLite
########################################
## Import of DrugBank Annotation Data ##
########################################
## Function to import DrugBank XML to data.frame
## Last step gives error. To debug, the following function may help.
## Note, this functions needs some major speed improvements. Ideally,
## it should be replaced with a standard XML import method.
## (1) Download
## - download DrugBank XML (https://www.drugbank.ca/releases/latest)
## - name uncompressed file 'drugbank.xml'
@tgirke
tgirke / BiocGitHub.md
Last active June 11, 2023 23:09
New Bioc-GitHub Source Control

Bioconductor-GitHub Package Sync

This page outlines how to maintain and sync R packages to both GitHub and Bioconductor's new git source control system.

Note: the master branch has been renamed to devel branch following the instructions here (Mar-2023).


Table of Content

@tgirke
tgirke / gist-markdown-template.md
Last active April 4, 2023 00:51
Gist Markdown Template

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@tgirke
tgirke / Jekyll_Doc_Theme.md
Last active December 8, 2022 19:28
How to set up and maintain Jekyll Documentation Theme
@tgirke
tgirke / crouton.md
Last active September 10, 2022 23:29
Crouton
## Arranging plots with patchwork. For details see this manual page: https://ggplot2-book.org/arranging-plots.html
## Load libraries and create some sample data
library(ggplot2); library(reshape2); library(patchwork)
iris_mean <- aggregate(iris[,1:4], by=list(Species=iris$Species), FUN=mean)
df_mean <- melt(iris_mean, id.vars=c("Species"), variable.name = "Samples", value.name="Values")
## Create lots of plots
p1 <- ggplot(cbind(iris, Samples="Sepal.Length"), aes(Species, Sepal.Length)) + geom_boxplot(aes(fill = Species)) + ylim(4, 8) + theme(axis.title.x=element_blank(), axis.title.y=element_blank(), legend.position = "none") + facet_grid(rows = ~Samples) + ggtitle("(A)") + theme(plot.title = element_text(hjust=-0.3))
p2 <- ggplot(df_mean[df_mean$Samples=="Sepal.Width",], aes(Species, Values)) + geom_bar(position="dodge", aes(fill = Species), stat="identity") + yli
@tgirke
tgirke / motifEnrich.R
Last active April 11, 2021 23:58
Motif enrichment for ChIP-Seq
###############################
## PWM matching in sequences ##
###############################
## Date: May 22, 2020
## Starter code for ChIP-Seq1 project
library(MotifDb)
as.list(query(MotifDb, 'athaliana'))
as.list(query(MotifDb, 'hsapiens'))
@tgirke
tgirke / Bioconductor_Git_Mirror.md
Last active April 15, 2020 00:36
How to maintain Bioconductor package on GitHub and keep it in sync with SVN repository on Bioconductor
@tgirke
tgirke / reactiveUrl.R
Last active July 26, 2019 13:37
Shiny app example with reactive URL to query database with IDs
###############################################
## Shiny App Example with Reactive URL Input ##
###############################################
## Author: Yuzhu Duan & Thomas Girke
## Last update: 06-Jul-17
## Usage: save this file under name app.R to your shiny app directory, e.g. reactiveUrl
## Run in parent directory the following from within R:
## > library(shiny)
## > runApp(reactiveUrl)