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 Rscript | |
suppressPackageStartupMessages(library(lattice, quietly = TRUE)) | |
suppressPackageStartupMessages(library(latticeExtra, quietly = TRUE)) | |
suppressPackageStartupMessages(library(argparse, quietly = TRUE)) | |
main <- function(arguments){ | |
parser <- ArgumentParser() | |
parser$add_argument('infile') |
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
#!/bin/bash | |
set -e | |
REQFILE="${1-requirements.txt}" | |
WHEELSTREET="${2-wheelstreet}" # base dir for wheel dirs | |
if [[ ! -f "$REQFILE" ]]; then | |
echo "Cannot find requirements file named $REQFILE" | |
echo "Usage: $(basename $0) [requirements.txt] [wheelstreet]" |
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 sqlite3 | |
from random import choice | |
from timeit import timeit | |
from itertools import chain | |
con = sqlite3.connect('test_cast.db', isolation_level=None) # autocommit | |
cur = con.cursor() |
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
#!/bin/env/python | |
"""Filter a file of genomic positions given ranges of start positions | |
specified in a bed file - totally untested. | |
""" | |
from collections import defaultdict | |
from operator import itemgetter | |
import csv |
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
function get_ssh_sock(){ | |
sock=$(find /tmp/ssh-* -user $USER -name "agent.*" 2> /dev/null | head -1) | |
if [[ -z $sock ]]; then | |
eval $(ssh-agent -s) | |
fi | |
find /tmp/ssh-* -user $USER -name "agent.*" 2> /dev/null | head -1 | |
} | |
function ssh-refresh() { | |
echo shell: SSH_AUTH_SOCK=$SSH_AUTH_SOCK |
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 | |
# see http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchlit_help.html | |
import sys | |
import urllib | |
import os | |
import xml.dom.minidom | |
import re | |
import urllib2 |
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 Rscript | |
if(Sys.getenv("VIRTUAL_ENV") == ""){ stop("An active virtualenv is required") } | |
source(file.path(Sys.getenv('VIRTUAL_ENV'), 'bin', 'rvenv')) | |
suppressPackageStartupMessages(library(argparse, quietly = TRUE)) | |
suppressPackageStartupMessages(library(lattice, quietly = TRUE)) | |
suppressPackageStartupMessages(library(latticeExtra, quietly = TRUE)) | |
main <- function(arguments){ |
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
label | method | assignment | reads | freq | |
---|---|---|---|---|---|
38894_39171 | a | category-01 | 8944 | 0.0951337552518215 | |
38894_39171 | a | category-17 | 44990 | 0.478540658405574 | |
38894_39171 | a | category-28 | 19142 | 0.203605807583896 | |
38894_39171 | a | category-41 | 11527 | 0.122608094453013 | |
38894_39171 | a | category-45 | 3501 | 0.0372387384991757 | |
38894_39171 | a | category-49 | 5911 | 0.0628729458065202 | |
40454_40882 | a | category-01 | 88304 | 0.414288797350173 | |
40454_40882 | a | category-04 | 17235 | 0.0808600677469903 | |
40454_40882 | a | category-28 | 12581 | 0.0590252690643972 |
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 re | |
import sys | |
rexp = re.compile(r'|'.join([ | |
r'\bactinomycete\b', | |
r'\bcrenarchaeote\b', | |
r'\bculture\b', | |
r'\bchimeric\b', |
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
#!/bin/bash | |
# try me out: | |
# two processors | |
# $ echo {1..9} | xargs -n1 -P2 ./ps.sh | |
# four processors | |
# $ echo {1..9} | xargs -n1 -P4 ./ps.sh | |
# sleeptime set to a random integer between 2 and 5 | |
sleeptime=$(shuf -i 2-5 -n 1) |