Skip to content

Instantly share code, notes, and snippets.

View andrewparkermorgan's full-sized avatar

Andrew Parker Morgan andrewparkermorgan

View GitHub Profile
#! /usr/bin/env python3
"""
interpolate_cM.py
Annotate a VCF file with genetic position of sites by (linear) interpolation on a user-supplied genetic map.
"""
import os
import sys
import time
import argparse
@andrewparkermorgan
andrewparkermorgan / jobber.py
Created December 15, 2018 14:17
Python script to summarize running jobs under SLURM scheduler
#! /usr/bin/env python
"""
jobber.py
Summarize status of running jobs under SLURM scheduler.
"""
from __future__ import print_function
import os
import sys
@andrewparkermorgan
andrewparkermorgan / rnaseq.R
Created March 16, 2016 15:25
Make coverage plots with splice-junction arcs in R using Bioconductor packages and ggplot2/grid.
# rnaseq.R
# plots related to RNAseq data
library(GenomicAlignments)
library(GenomicRanges)
library(ggplot2)
library(grid)
#library(gtable) # for combining plots vertically
#' Make a 'sashimi plot': coverage plus splice events
@andrewparkermorgan
andrewparkermorgan / gist:457106d6dd429332b59c
Last active March 28, 2019 13:05
Create haplotype bifurcation plot with rehh and ggplot2
#' Draw a haplotype bifurcation diagram
#'
#' @param hh an object of class `haplohh` (from rehh package)
#' @param focal genomic position of the focal site
#' @param left extend haplotypes this many (variant) sites to the left of the focal site
#' @param right extend haplotypes this many (variant) sites to the right of the focal site
#' @param palette name of an RColorBrewer palette used for colors
#' @param reverse logical; if `TRUE`, put derived allele in upper panel
#' @param relabel a named list to use for re-labelling panels; default labels are 'ancestral' and 'derived'
#' @param ... other arguments passed through to rehh::bifurcation.diagram()