Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile
@stephenturner
stephenturner / bootstrap632.r
Created April 15, 2022 16:34
.632 bootstrap proof
n <- 1e7
x <- sample(n, size=n, replace=TRUE)
length(unique(x))/n
# [1] 0.6321897
1-exp(-1)
# [1] 0.6321206
@stephenturner
stephenturner / build-install-bcftools-home.sh
Last active November 24, 2021 13:14
Install htslib, bcftools, samtools to home directory
# Compile and install htslib, bcftools, samtools 1.9 to home directory
# Set up dirs where stuff will be installed
mkdir -p ${HOME}/bin/htslib
mkdir -p ${HOME}/bin/bcftools
mkdir -p ${HOME}/bin/samtools
# Make a dir to build
mkdir -p ${HOME}/tmp
@stephenturner
stephenturner / get-licenses-for-loaded-packages.R
Created September 26, 2019 15:44
Code to get license information for all loaded packages
# Load some packages
library(knitr)
library(tidyverse)
library(DT)
# Get licenses for all installed packages.
installed_licenses <- installed.packages() %>%
as.data.frame() %>%
rownames_to_column("package") %>%
as_tibble() %>%
@stephenturner
stephenturner / rename.pl
Created July 29, 2019 00:10
Perl rename script
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
Getopt::Long::Configure('bundling');
my ($verbose, $no_act, $force, $op);
have <- tibble::tribble(
~id1, ~id2, ~value,
"a", "b", 1L,
"c", "a", 2L,
"c", "b", 3L
)
have
want <- tibble::tribble(
~id1, ~id2, ~value,
@stephenturner
stephenturner / mendeley-scihub.json
Created July 25, 2018 09:57
Sci-Hub look up engine for Zotero. Add to zotero engines file (https://www.zotero.org/support/locate#managing_lookup_engines). Afterwards, relaunch Zotero, make sure the newly added lookup engine is checked under Locate (green arrow) -> Manage Lookup Engines.
[
{
"name": "Sci-Hub Lookup",
"alias": "Sci-Hub",
"icon": "null",
"_urlTemplate": "https://sci-hub.tw/{z:DOI}",
"description": "Sci-Hub full text PDF search",
"hidden": false,
"_urlParams": [],
"_urlNamespaces": {
library(tidyverse)
d <- tibble::tribble(
~disease, ~gene, ~chr, ~inheritance,
"flu", "x", 1L, "infectious",
"flu", "y", 2L, "infectious",
"flu", "z", 3L, "infectious",
"aids", "x", 1L, "st",
"aids", "p", 4L, "st"
) %>% print()
// ==UserScript==
// @name Use My Amazon Affiliate Code
// @namespace http://www.lysator.liu.se/~jhs/userscript
// @description Puts your own Amazon affiliate ID in Amazon links
// @include http://*
// @include https://*
// ==/UserScript==
// leave intact to sponsor my scripting, or set to your own:
const affiliate = 'gettgenedone-20';

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