Skip to content

Instantly share code, notes, and snippets.

View Buttonwood's full-sized avatar

Buttonwood Buttonwood

View GitHub Profile
@Buttonwood
Buttonwood / fastqdup.cpp
Last active August 29, 2015 14:01
FastQC
// #=============================================================================
// # FileName: fastqdup.cpp
// # Desc: A short program for duplication reads statistics.
// # Author: tanhao
// # Email: tanhao2013@gmail.com
// # HomePage: http://buttonwood.github.io
// # Version: 0.0.1
// # LastChange: 2014-04-15 10:37:49
// # History:
// #=============================================================================
@Buttonwood
Buttonwood / gc_dp_pip.py
Last active August 29, 2015 14:01
GC-Depth
'''
#=============================================================================
# FileName: gc_dp_pip.py
# Desc: A script for gc content and coverage statistics by windows;
# a genome fasta file and soap coverage file needs.
# Author: tanhao
# Email: tanhao2013@gmail.com
# HomePage: http://buttonwood.github.io
# Version: 0.0.1
# LastChange: 2014-04-14 15:29:14
@Buttonwood
Buttonwood / cegma_snap_train.sh
Created May 26, 2014 01:43
Genome annotation
#=============================================================================
# FileName: cegma_train.sh
# Desc: A short script for training a cegma annotation for SNP hmm set!
# Author: tanhao
# Email: tanhao2013@gmail.com
# HomePage: http://buttonwood.github.io
# Version: 0.0.1
# LastChange: 2014-03-21 10:13:08
# History:
#=============================================================================
@Buttonwood
Buttonwood / dict.file
Last active March 29, 2016 14:15
String to word
when you are old and gray and full of sleep,
And nodding by the fire,take down this book,
And slowly read,and dream of the soft look,
Your eyes had once,and of their shadows deep.
How many loved your moments of glad grace,
And loved your beauty with love false or true,
But one man loved the pilgrim soul in you,
And loved the sorrows of your changing face.
And bending down beside the glowing bars,
Murmur,a little sadly,how love fled,
@Buttonwood
Buttonwood / dload_img.py
Last active August 29, 2015 14:02
Download image files of a html page
import argparse
import re
import urllib
def getHtml(url):
page = urllib.urlopen(url)
html = page.read()
return html
def getImg(html):
@Buttonwood
Buttonwood / py-env.sublime-snippet
Last active March 29, 2016 14:14
Sublime snippets
<snippet>
<content><![CDATA[
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File:
@Author: Hao Tan
@Date:
@Email: tanhao2013@foxmail.com
@Buttonwood
Buttonwood / thread.py
Created June 30, 2014 14:37
Python Tips
import os, Queue, threading, urllib2
class DownLoadThread(threading.Thread):
"""docstring for DownLoadThread"""
def __init__(self, queue):
#super(DownLoadThread, self).__init__()
threading.Thread.__init__(self)
self.queue = queue
def run(self):
while True:
@Buttonwood
Buttonwood / change-table-id.sh
Created July 30, 2014 09:56
A short script will change the raw sql table id.
if [ $# != 3 ]; then
echo "Usage: sh $0 id table old.sql | sh "
echo "This script will change the raw sql file directly."
echo "Please make sure you have a backup for checking!"
exit
fi
echo cp $3 ${3}.bak
tmp=$(($1 * 8))
@Buttonwood
Buttonwood / ssh.py
Created August 12, 2014 02:34
pxssh auto ssh servers
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File: pxssh-test.py
@Author: Hao Tan
@Date: 2014-08-08
@Email: tanhao2013@foxmail.com
@Desc: A test script for batch monitoring hundreds of servers.
"""
@Buttonwood
Buttonwood / phaser_cobar_action.pl
Created September 4, 2014 02:36
phasering cobar debug log files
# perl phaser_cobar_action.pl stdout.log.2014-09-02 > actions.tab
my %pool;
my %count;
my $action;
my $action_text;
my %all;
my %route;