This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p1 <- pw + geom_point() + facet_grid(.~g, scales='fixed') + coord_equal() + | |
stat_smooth(method='lm') | |
p2 <- px + geom_point() + facet_grid(.~g, scales='fixed') + coord_equal() + | |
stat_smooth(method='lm') | |
p3 <- pz + geom_point() + facet_grid(.~g, scales='fixed') + coord_equal() + | |
stat_smooth(method='lm') | |
grid.arrange(p1, p2, p3, ncol=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fp = open("file.txt") | |
data = fp.read().decode("utf-8-sig").encode("utf-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Following code will generate a random sample of size 4. | |
rand_smpl = [ mylist[i] for i in sorted(random.sample(xrange(len(mylist)), 4)) ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import fileinput | |
import sys | |
from argparse import ArgumentParser | |
# https://docs.python.org/dev/library/argparse.html | |
parser = argparse.ArgumentParser(description = """docstring here""") | |
parser.add_argument('-i','--input', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://gist.github.com/stephenturner/5700920 | |
# http://inundata.org/2011/09/29/customizing-your-rprofile/ | |
## Returns names(df) in single column, numbered matrix format. | |
.env$n <- function(df) matrix(names(df)) | |
# Shorten S3 methods so s(obj) instead of summary(obj) | |
s <- base::summary; | |
h <- utils::head; | |
n <- base::names; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Mappings from file extensions to biopython types. | |
Copied from Erik Matsens seqmagick https://github.com/fhcrc/seqmagick/ | |
""" | |
import argparse | |
import contextlib | |
import copy | |
import functools |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unix shell | |
# run if zero exit | |
cd tmp/a/b/c && tar xvf ~/archive.tar # untar if dir exists | |
# run if non-zero exit | |
cd tmp/a/b/c || mkdir -p tmp/a/b/c | |
cd tmp/a/b/c || mkdir -p tmp/a/b/c && tar xvf -C tmp/a/b/c ~/archive.tar | |
which | |
whereis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# emacs backups | |
*~ | |
\#*# | |
# data files | |
*.log | |
*.tsv | |
*.dat | |
# image files |