This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
class Node(object): | |
def __init__(self, val): | |
self.val = val | |
self.left = None | |
self.right = None | |
def __lt__(self, val): | |
return self.val < val | |
def __gt__(self, val): |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="author" content=""> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="icon" href="/favicon.png" /> | |
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon.png" /> |
# This was the order I installed things for a working scientific computing environment on my Mac. | |
brew install python | |
pip install virtualenv virtualenvwrapper | |
# Also add these to your ~/.bash_profile: | |
export PATH=/usr/local/bin:/usr/bin:$PATH | |
source /usr/local/bin/virtualenvwrapper.sh | |
# Not necessary, but quite nice |
SAM and BAM filtering one-liners
@author: David Fredman, david.fredmanAAAAAA@gmail.com (sans poly-A tail)
@dependencies: http://sourceforge.net/projects/bamtools/ and http://samtools.sourceforge.net/
Please extend with additional/faster/better solutions via a pull request!
BWA mapping (using piping for minimal disk I/O)
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
# | |
# This script calculates the depth of coverage and breadth of coverage for a given bam. | |
# Outputs a dictionary containing the contig/chromosome names and the depth and breadth of coverage for each | |
# and for the entire genome. | |
# | |
# If you optionally specify the name of the mitochondrial chromosome (e.g. mtDNA, chrM, chrMT) | |
# The script will also generate breadth and depth of coverage for the nuclear genome AND the ratio | |
# of mtDNA:nuclearDNA; which can act as a proxy in some cases for mitochondrial count within an individual. | |
# | |
# Author: Daniel E. Cook |
#!/usr/bin/env python3 | |
import io | |
import sys | |
import time | |
import datetime | |
import requests | |
from Bio import SeqIO |
This procedure results in a computer that runs both Mac OS X and Ubuntu in a dual-boot configuration, each operating system using full (whole) disk encryption, and with the Ubuntu root file system stored on a ZFS pool encrypted using LUKS. The specific hardware and software versions used to document this procedure are:
import numpy as np | |
def array_for_sliding_window(x, wshape): | |
"""Build a sliding-window representation of x. | |
The last dimension(s) of the output array contain the data of | |
the specific window. The number of dimensions in the output is | |
twice that of the input. | |
Parameters |