Skip to content

Instantly share code, notes, and snippets.

View MikeDacre's full-sized avatar

Mike Dacre MikeDacre

View GitHub Profile
@MikeDacre
MikeDacre / cnvnator_mouse.patch
Last active August 29, 2015 14:04
Patch for http://sv.gersteinlab.org/cnvnator/ including the black6 genome
Only in ./: cnvnator
diff -u ../../../CNVnator_v0.3/src/cnvnator.cpp ./cnvnator.cpp
--- ../../../CNVnator_v0.3/src/cnvnator.cpp 2014-02-01 20:29:35.000000000 -0800
+++ ./cnvnator.cpp 2014-07-21 13:06:23.022155584 -0700
@@ -39,7 +39,7 @@
usage += argv[0];
usage += " -pe file1.bam ... -qual val(20) -over val(0.8) [-f file]\n";
usage += "\n";
- usage += "Valid genomes (-genome option) are: NCBI36, hg18, GRCh37, hg19\n";
+ usage += "Valid genomes (-genome option) are: NCBI36, hg18, GRCh37, hg19, black6\n";
@MikeDacre
MikeDacre / get_chromosome_length.py
Last active August 29, 2015 14:04
Take a list of FastA files (or just one file) and count the length of the chromosome
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# Copyright © Mike Dacre <mike.dacre@gmail.com>
#
# Distributed under terms of the MIT license
"""
#====================================================================================
#
@MikeDacre
MikeDacre / logme.py
Created August 22, 2014 23:36
Little logging script to make writing timed messages easier
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 tabstop=4 expandtab shiftwidth=4 softtabstop=4
"""
#====================================================================================
#
# FILE: logme (python 3)
# AUTHOR: Michael D Dacre, mike.dacre@gmail.com
# ORGANIZATION: Stanford University
# LICENSE: Open Source - Public - Do as you wish (no license) - Mike Dacre
@MikeDacre
MikeDacre / syslog.log
Last active August 29, 2015 14:07
Kernel error log from 2014-10-13, fraser-server, USB3 related bugs
This file has been truncated, but you can view the full file.
Oct 13 09:25:50 fraser-server kernel: [774197.362929] usb 2-3: USB disconnect, device number 2
Oct 13 09:25:50 fraser-server kernel: [774197.362931] usb 2-3.1: USB disconnect, device number 3
Oct 13 09:25:50 fraser-server kernel: [774197.362933] usb 2-3.1.1: USB disconnect, device number 7
Oct 13 09:25:50 fraser-server kernel: [774197.364620] sd 12:0:0:0: [sdj] Synchronizing SCSI cache
Oct 13 09:25:50 fraser-server kernel: [774197.373022] usb 1-3.1-port2: cannot reset (err = -71)
Oct 13 09:25:50 fraser-server kernel: [774197.373519] usb 1-3.1-port2: cannot reset (err = -71)
Oct 13 09:25:50 fraser-server kernel: [774197.374019] usb 1-3.1-port2: cannot reset (err = -71)
Oct 13 09:25:50 fraser-server kernel: [774197.374518] usb 1-3.1-port2: cannot reset (err = -71)
Oct 13 09:25:50 fraser-server kernel: [774197.375019] usb 1-3.1-port2: cannot reset (err = -71)
Oct 13 09:25:50 fraser-server kernel: [774197.375020] usb 1-3.1-port2: Cannot enable. Maybe the USB cable is bad?
@MikeDacre
MikeDacre / stdout_eqtlbma.txt
Created October 23, 2014 22:45
stdout_eqtlbma.txt
START eqtlbma 2014-10-23 15:43:38
version 1.2 compiled Oct 23 2014 15:01:56
cmd-line: eqtlbma --geno list_genotypes.txt --scoord snp_coords.bed.gz --pheno list_explevels.txt --fcoord gene_coords.bed.gz --anchor TSS --cis 1000 --out out_eqtlbma --step 3 --covar list_covariates.txt --gridL grid_phi2_oma2_general.txt --gridS grid_phi2_oma2_with-configs.txt --bfs all --mvlr
cwd: /home/mike/my_packages/eqtlbma-git/eqtlbma_tutorial_data
load file list_explevels.txt ...
items loaded: 3
load file list_genotypes.txt ...
items loaded: 3
load samples ...
nb of samples (phenotypes): 200
@MikeDacre
MikeDacre / nfs_headnode.txt
Last active August 29, 2015 14:09
NFS Trouble
Server packet stats:
packets udp tcp tcpconn
506158 0 505786 106
Server rpc stats:
calls badcalls badauth badclnt xdrcall
506154 0 0 0 0
Server reply cache:
hits misses nocache
@MikeDacre
MikeDacre / jvarkit-install.py
Created January 27, 2015 23:11
Manage jvarkit files
#!/usr/bin/env python3
import subprocess, sys, os, re
from collections import OrderedDict
jvarkit="/usr/share/jvarkit"
install_location="/usr/local/bin"
def print_tools(tools):
""" Pretty print a list of running interactive jobs from create_queue """
@MikeDacre
MikeDacre / watch_job
Created March 21, 2015 16:41
Watch a submitted qsub job and email the results of qstat -f when complete
#!/bin/bash
if [ $# != 2 ]; then
echo "USAGE: watch_job <submit_script> <email_address>"
exit 1
fi
job=$1
email=$2
while true; do
@MikeDacre
MikeDacre / run-lines.vim
Created April 13, 2015 19:56
Vim-IPython IDE. Execute python and shell lines, cells (like matlab), selected text, and blocks in an interactive session using vim-screen.
"" This part runs commands in an interactive session, it requires
"" [vim-screen](https://github.com/ervandew/screen) to function
" Start Screen Session, Default to IPython in python files
fun StartScreenTmux()
if !g:ScreenShellActive
if &filetype == 'python'
:IPython
elseif &filetype == 'python3'
:IPython
@MikeDacre
MikeDacre / tmux-server-32072.log
Created July 23, 2015 18:22
tmux -vvvv server log output for Ubuntu machine; successfully executes tpm
server started, pid 32072
cmdq 0x1e8a6f0: bind-key C-b send-prefix (client -1)
cmdq 0x1e8a6f0: bind-key C-o rotate-window (client -1)
cmdq 0x1e8a6f0: bind-key C-z suspend-client (client -1)
cmdq 0x1e8a6f0: bind-key Space next-layout (client -1)
cmdq 0x1e8a6f0: bind-key ! break-pane (client -1)
cmdq 0x1e8a6f0: bind-key " split-window (client -1)
cmdq 0x1e8a6f0: bind-key # list-buffers (client -1)
cmdq 0x1e8a6f0: bind-key $ command-prompt -I#S "rename-session '%%'" (client -1)
cmdq 0x1e8a6f0: bind-key % split-window -h (client -1)