Skip to content

Instantly share code, notes, and snippets.

Rory Kirchner roryk

Block or report user

Report or block roryk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a3e7381d65a819eb8831db9b1137f5c9
Tom Knight and the Lisp Machine
A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”
Knight turned the machine off and on.
The machine worked.
View test_pe.py
import os
import subprocess
from argparse import ArgumentParser
def find_parallel_environment(queue):
"""Find an SGE/OGE parallel environment for running multicore jobs in specified queue.
"""
base_queue = os.path.splitext(queue)[0]
queue = base_queue + ".q"
View gist:318b347128bf5df8fee5
#!/bin/bash
set -e
# Figure out where this script is located.
SELFSCRIPT="`readlink -f \"$0\"`"
SELFDIR="`dirname \"$SELFSCRIPT\"`"
SELFDIR="`cd \"$SELFDIR\" && pwd`"
# Temporarily set PATH and LD_LIBRARY_PATH
export PATH=$SELFDIR/bin:$PATH
View test_gffutils.py
import tempfile
import gffutils
import os
from argparse import ArgumentParser
def get_gtf_db(gtf, in_memory=False):
"""
create a gffutils DB
"""
db_file = gtf + ".db"
View gist:3a28ede54cc2af6825f1
class Foo(object):
def __init__(self):
self.history = {"var1": [], "var2": [], "var3": [], "var4": []}
def update(self, to_update):
for k, v in self.history.iteritems():
if k == to_update:
v.append(1)
else:
@roryk
roryk / gist:fda5c55fb732ea06a1b5
Created Sep 21, 2015
sparsehash-build-issues
View gist:fda5c55fb732ea06a1b5
[ 51%] Performing build step for 'libsparsehash'
cd /tmp/sailfish20150920-18016-i304l8/sailfish-0.7.4/external/sparsehash-sparsehash-2.0.2 && /Applications/Xcode.app/Contents/Developer/usr/bin/make
[ -d src/sparsehash/internal ] || mkdir -p src/sparsehash/internal
echo "/*" > src/sparsehash/internal/_sparsehash_config
echo " * NOTE: This file is for internal use only." >> src/sparsehash/internal/_sparsehash_config
echo " * Do not use these #defines in your own program!" >> src/sparsehash/internal/_sparsehash_config
echo " */" >> src/sparsehash/internal/_sparsehash_config
awk '{prevline=currline; currline=$0;} \
/^#/ {in_second_file = 1;} \
!in_second_file {if (currline !~ /^ *$/) {inc[currline]=0}}; \
@roryk
roryk / gist:cb554de6b096592fd2d8
Last active Aug 29, 2015
example coverage flagging
View gist:cb554de6b096592fd2d8
import numpy
import scipy.stats as stats
def outlier_resistant(coverage):
median = float(numpy.median(coverage))
deviations = [abs(x - median) for x in coverage]
# median absolute deviation estimator of the standard deviation
mad = 1.4826 * float(numpy.median(deviations))
return int(median), int(mad)
View mm9.fa
>chrM
GTTAATGTAGCTTAATAACAAAGCAAAGCACTGAAAATGCTTAGATGGAT
AATTGTATCCCATAAACACAAAGGTTTGGTCCTGGCCTTATAATTAATTA
GAGGTAAAATTACACATGCAAACCTCCATAGACCGGTGTAAAATCCCTTA
AACATTTACTTAAAATTTAAGGAGAGGGTATCAAGCACATTAAAATAGCT
TAAGACACCTTGCCTAGCCACACCCCCACGGGACTCAGCAGTGATAAATA
TTAAGCAATAAACGAAAGTTTGACTAAGTTATACCTCTTAGGGTTGGTAA
ATTTCGTGCCAGCCACCGCGGTCATACGATTAACCCAAACTAATTATCTT
CGGCGTAAAACGTGTCAACTATAAATAAATAAATAGAATTAAAATCCAAC
TTATATGTGAAAATTCATTGTTAGGACCTAAACTCAATAACGAAAGTAAT
View gist:16b3240c12f09d6c9619
MOD_NAME=Commander's Choice - LW
AUTHOR=Peasly Wellbott
DESCRIPTION=Choose the class of your Squaddies! When being prompted to pick a Squaddie's first skill, the "Cycle Soldier" buttons on the bottom of the screen will instead cycle the soldier's class! Does not affect MECs or any soldier who has locked in their specialty, but should work for reward soldiers and special soldiers.
Version: 1.0
Compatible with XCOM Long War versions:
- All hopefully
@roryk
roryk / gist:3aade4cc66af6db93496
Created Oct 27, 2014
STAR error 2.4.0e with --quantMode
View gist:3aade4cc66af6db93496
STAR version=STAR_2.4.0e
STAR compilation time,server,dir=Fri Oct 24 10:43:53 EDT 2014 verona.cshl.edu:/sonas-hs/gingeras/nlsas_norepl/user/dobin/STAR/STAR.sandbox/source
##### DEFAULT parameters:
versionSTAR 20201
versionGenome 20101 20200
parametersFiles -
runMode alignReads
runThreadN 1
genomeDir ./GenomeDir/
genomeLoad NoSharedMemory
You can’t perform that action at this time.