Skip to content

Instantly share code, notes, and snippets.

View taoliu's full-sized avatar
🌎
Working from the earth

Tao Liu (τν) taoliu

🌎
Working from the earth
  • Roswell Park Comprehensive Cancer Center
  • Buffalo NY
View GitHub Profile
@taoliu
taoliu / prockreport
Last active October 3, 2015 18:17
Check total CPU time and maximum memory usage of a process.
#!/bin/bash
# modified from prockmon
unset LD_LIBRARY_PATH
if [[ $# < 2 ]];then
echo 'Check total CPU time and maximum memory usage of a process.'
echo 'need two parameters: $0 <interval> <pid>'
exit 1;
fi
@taoliu
taoliu / bdg2bw
Last active March 22, 2024 21:00
bedGraph to bigWig
#!/bin/bash
# check commands: slopBed, bedGraphToBigWig and bedClip
which bedtools &>/dev/null || { echo "bedtools not found! Download bedTools: <http://code.google.com/p/bedtools/>"; exit 1; }
which bedGraphToBigWig &>/dev/null || { echo "bedGraphToBigWig not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; }
which bedClip &>/dev/null || { echo "bedClip not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; }
# end of checking
@taoliu
taoliu / ediff.pl
Created April 6, 2012 05:20
find unique or common lines between two files
#!/usr/bin/perl -w
# Time-stamp: <2004-04-02 14:37:41 Tao Liu>
use strict;
if (@ARGV>0 and $ARGV[0] eq "-h") {
print "ediff : compute two sets with \'or diff and\'. \nUsage:\tediff [-h] : help, this info\n\tediff A or B : union of two sets\n\tediff A diff B : elements in
A but not in B\n\tediff A and B : intersection of two sets\n";
exit;
}
@taoliu
taoliu / wrapToSGE
Created January 6, 2012 21:20
SGE script wrapper
#!/usr/bin/env python
import subprocess
import sys
import os
import time
#time_stamp=time.strftime("%y-%m-%d_%H-%M-%S")
time_stamp=str(time.time())
@taoliu
taoliu / prockmon
Created January 6, 2012 21:15
Monitor user time and memory usage of a process
#!/bin/bash
if [[ $# < 2 ]];then
echo 'need two parameters: $0 <interval> <pid>'
exit 1;
fi
INTERVAL=$1
PID=$2
anonymous
anonymous / pyprofile
Created June 2, 2011 22:45
pyrprofile: profile Python script
#!/usr/bin/env bash
## pyprofile: profile Python script
## $Revision$
## Copyright 2011 Michael M. Hoffman <mmh1@uw.edu>
set -o nounset
set -o pipefail
set -o errexit