Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Turner stephenturner

View GitHub Profile
@stephenturner
stephenturner / get-licenses-for-loaded-packages.R
Created Sep 26, 2019
Code to get license information for all loaded packages
View get-licenses-for-loaded-packages.R
# 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 Jul 29, 2019
Perl rename script
View rename.pl
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
Getopt::Long::Configure('bundling');
my ($verbose, $no_act, $force, $op);
View RStudio__selection_untitled_725A80CF
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 Jul 25, 2018
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.
View mendeley-scihub.json
[
{
"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": {
View RStudio__selection_untitled_9D45B5CF
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()
View affiliate.user.js
// ==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';
View bioinformatics-workshops-and-training-2015.md

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:

View gdc-client-install-centos6-conda.sh
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
View example-gwas-data.txt
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
View vcffirstheader
#!/usr/bin/python
import sys
header=True
for line in sys.stdin:
if line.startswith('##'):
if header:
print line.strip()
continue