Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile

This list is outdated. This post has a list of bioinformatics/genomics/genetics workshops and training materials that I haven't updated since 2015.


In-person courses

Note that many of the courses shown below also have course materials from past years publicly available online.

Cold Spring Harbor Courses:

conda create -n gdc python=2.7 libxml2 libxslt libffi gcc progressbar
source activate gdc
git clone https://github.com/NCI-GDC/gdc-client
cd gdc-client
python setup.py install
This file has been truncated, but you can view the full file.
SNP CHR BP P
rs3094315 1 752566 0.5571
rs3131972 1 752721 0.4664
rs12562034 1 768448 0.7376
rs12124819 1 776546 0.6662
rs11240777 1 798959 0.9756
rs6681049 1 800007 0.9759
rs4970383 1 838555 0.2906
rs4475691 1 846808 0.07047
rs7537756 1 854250 0.04206
#!/usr/bin/python
import sys
header=True
for line in sys.stdin:
if line.startswith('##'):
if header:
print line.strip()
continue
@stephenturner
stephenturner / keybindings.json
Created May 31, 2017 21:04
VSCode keybindings to replicate my most commonly used RStudio shortcuts (Mac)
// Place your key bindings in this file to overwrite the defaults
[
// RStudio: Copy lines up/down with alt+cmd+up/down
{
"key": "alt+cmd+down",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
@stephenturner
stephenturner / sublime-keybindings.txt
Last active February 14, 2017 15:07
keybindings for sublime text 3
[
// Auto-pair backticks
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }
]
@stephenturner
stephenturner / clickable-imgs.js
Created September 29, 2016 15:06 — forked from bearloga/clickable-imgs.js
Make the figures click-able in your RMarkdown=>HTML reports.
<script language="JavaScript">
$(function() {
/* Lets the user click on the images to view them in full resolution. */
$("div.figure img").wrap(function() {
var link = $('<a/>');
link.attr('href', $(this).attr('src'));
link.attr('title', $(this).attr('alt'));
link.attr('target', '_blank');
return link;
});
## devtools::install_github("stephenturner/msigdf")
library(msigdf)
library(dplyr)
library(clusterProfiler)
c2 <- msigdf.human %>%
filter(collection == "c2") %>% select(geneset, entrez) %>% as.data.frame
data(geneList)
de <- names(geneList)[1:100]
# Performs principal components analysis on an ExpressionSet
eset_pca <- function (eset) {
mypca <- prcomp(t(na.omit(exprs(eset))))
pca <- as.data.frame(mypca$x)
pc1var <- round(summary(mypca)$importance[2,1]*100, digits<-1)
pc2var <- round(summary(mypca)$importance[2,2]*100, digits<-1)
pc1lab <- paste0("PC1 (",as.character(pc1var),"%)")
pc2lab <- paste0("PC1 (",as.character(pc2var),"%)")
out <- merge(pData(eset), pca, by<-"row.names") %>%
dplyr::rename(id<-Row.names)
@stephenturner
stephenturner / nullarbor-install-ubuntu1404.sh
Last active December 14, 2020 18:09
Nullarbor+dependencies installation script for a fresh Ubuntu 14.04 instance.
#!/bin/bash
# Nullarbor+dependencies installation script for a fresh Ubuntu 14.04 instance.
################################################################################
## Conveniences
################################################################################
# Some essential aliases