Skip to content

Instantly share code, notes, and snippets.

View mlin's full-sized avatar

Mike Lin mlin

View GitHub Profile
@mlin
mlin / keybase.md
Last active May 22, 2018 21:34
keybase.md

Keybase proof

I hereby claim:

  • I am mlin on github.
  • I am mlin (https://keybase.io/mlin) on keybase.
  • I have a public key ASCO-NadYMiwqGxb9_4cD-VFjMbVqrk7ors-n9seZl_A5wo

To claim this, I am signing this object:

#!/usr/bin/env python
#
# Initializes a git repository with some suggested best practices for DNAnexus
# WDL workflow development & continuous integration. Run
# dxWDL_ci_init.py hello_world
# to create a subdirectory with that name, initialized as a local git repo,
# with the following which you can then customize:
#
# hello_world.wdl
# Trivial WDL workflow template.
@mlin
mlin / dx-yml-build
Last active July 22, 2016 14:21
dxapp.yml
#!/usr/bin/env python
#
# dx-yml-build: transcodes dxapp.yml to dxapp.json and then runs `dx build`
# with command-line arguments passed through.
#
# Requires PyYAML (apt-get install python-yaml OR pip install pyyaml)
import os, sys
import yaml, json
@mlin
mlin / gist:5e82ef4fa7031258492f
Created November 10, 2015 23:05
build_gcsa size limit exceed error
* index (vg_index:main) (failed) job-Bk01J1Q0QpJ6F3BZv5ZyjBBq
mlin 2015-11-08 19:44:06 (runtime 12:57:05)
2015-11-09 11:33:40 index ALERT This job has been restarted due to UnresponsiveWorker from running this job
2015-11-09 11:33:49 index INFO Logging initialized (priority)
2015-11-09 11:33:50 index INFO Downloading bundled file gcc4.9_runtime_debs.tar
2015-11-09 11:33:51 index STDOUT >>> Unpacking gcc4.9_runtime_debs.tar to /
2015-11-09 11:33:51 index INFO Downloading bundled file vg_bundle.tar.gz
2015-11-09 11:33:52 index STDOUT >>> Unpacking vg_bundle.tar.gz to /
2015-11-09 11:33:53 index INFO Installing apt packages libjansson4, dx-toolkit
2015-11-09 11:33:57 index INFO Setting SSH public key
@mlin
mlin / dx-ci-init.py
Last active October 14, 2020 06:25
Suggested best practices for DNAnexus workflow development & continuous integration
#!/usr/bin/env python
#
# Initializes a git repository with some suggested best practices for DNAnexus
# workflow development & continuous integration. Run dx-ci-init.py in the root
# of your git repository; it creates the following, which you should then
# customize as you like:
#
# applets/hello-world
# Trivial applet template which you can build on or copy.
#
@mlin
mlin / wga_dotplot.R
Last active July 26, 2023 06:42
whole-genome alignment dotplots
require(ggplot2)
require(data.table)
require(compiler)
# First run LASTZ to produce MAF output. Options for matching near-identical assemblies: --notransition --seed=match15 --step=10 --hspthresh=100000 --gapped --ydrop=3400 --gappedthresh=400000 --ambiguous=iupac --allocate:traceback=200M
# Then we postprocess the MAF with: cat alignments.maf | awk 'NF' | tr -s " " | cut -d ' ' -f1-6 | paste - - - | tr " " "\t" | tr "=" "\t" | cut -f 3,5-9,11-15 | gzip -c > alignments.gz
# read and filter hits
fn <- "alignments.gz"
all.hits <- read.delim(gzfile(fn),header=FALSE)
colnames(all.hits) <- c("score","target","tpos","thitlen","tstrand","tlen","query","qpos","qhitlen","qstrand","qlen")
@mlin
mlin / Dockerfile
Last active July 24, 2019 09:17
PhyloCSF Dockerfile (OpenBLAS)
# Dockerfile for PhyloCSF using OpenBLAS to take advantage of vector
# instructions (AVX). On supported processors, this can significantly speed up
# PhyloCSF (25-50%) compared to the default GSL BLAS.
# Example usage:
# docker build -t mlin:PhyloCSF https://gist.githubusercontent.com/mlin/5ea4ca5d2a2a198e5659/raw/Dockerfile
# docker run -v /path/to/host/data:/data mlin:PhyloCSF 29mammals /data/input.fa
# PhyloCSF homepage: https://github.com/mlin/PhyloCSF/wiki
FROM ubuntu:trusty
MAINTAINER Mike Lin <mlin@mlin.net>
RUN apt-get update
@mlin
mlin / Dockerfile
Last active February 16, 2024 04:11
PhyloCSF Dockerfile (basic)
# Basic Dockerfile for PhyloCSF.
# Example usage:
# docker build -t mlin:PhyloCSF https://gist.githubusercontent.com/mlin/31c0a7623f99d3bf3222/raw/Dockerfile
# docker run -v /path/to/host/data:/data mlin:PhyloCSF 29mammals /data/input.fa
# PhyloCSF homepage: https://github.com/mlin/PhyloCSF/wiki
FROM ubuntu:trusty
MAINTAINER Mike Lin <mlin@mlin.net>
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends ca-certificates software-properties-common time git build-essential gfortran
RUN add-apt-repository ppa:avsm/ppa
@mlin
mlin / commonNames_assemblies.semijson
Created December 2, 2013 05:11
Association table of common names and assembly identifiers in the 100-vertebrate genome alignments from UCSC Genome Browser
["Human","hg19"],
["Chimp","panTro4"],
["Gorilla","gorGor3"],
["Orangutan","ponAbe2"],
["Gibbon","nomLeu3"],
["Rhesus","rheMac3"],
["Crab_eating_macaque","macFas5"],
["Baboon","papHam1"],
["Green_monkey","chlSab1"],
["Marmoset","calJac3"],
@mlin
mlin / netclient_https_threads.ml
Created November 27, 2012 02:39
Attempting multithreaded https requests using ocamlnet netclient
(*
ocamlfind ocamlopt -o netclient_https_threads -thread -linkpkg -package threads,netclient,ssl,equeue-ssl netclient_https_threads.ml
http://docs.camlcity.org/docs/godipkg/3.12/godi-ocamlnet/doc/godi-ocamlnet/html/Https_client.html
*)
open Printf
module HTTP = Http_client
module HTTPS = Https_client
;;