This file contains 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
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin:/Applications/Racket5/bin/:/usr/texbin/")) | |
(setenv "CLASSPATH" ":/Users/hanfei/Documents/Sandbox/TIJ/TIJS/TIJ-3rd-edition-code") | |
(if x-resource-name | |
(progn | |
(set-face-attribute 'default nil :font "inconsolata-18") | |
)) | |
(if (not (equal emacs-version "23.4.1")) | |
(progn |
This file contains 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
import pysam | |
import os | |
t = "./865_rep1_treat.bam" | |
tb = "865_rep1_peaks.bed" | |
sorted_prefix = lambda path: path + ".sorted" | |
sorted_path = lambda path: sorted_prefix(path) + ".bam" | |
This file contains 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
import sys | |
import os | |
from ConfigParser import SafeConfigParser | |
from jinja2 import Environment, PackageLoader | |
from chilin.qc import MappingQC, PeakcallingQC | |
jinja_env = env = Environment(loader=PackageLoader('chilin', 'templates')) | |
def check_conf(conf): | |
if True: |
This file contains 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
from chilin.dc import jinja_env, PathFinder | |
class QC_Controller(object): | |
def __init__(self, conf): | |
self.pathfinder = PathFinder(conf) | |
self.template = jinja_env.get_template(pathfinder.qc_template) | |
self.has_run = False | |
def run(self): | |
pass | |
def check(self): |
This file contains 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/python2.7 | |
import os | |
import sys | |
import argparse | |
from math import sqrt | |
from collections import Counter | |
from itertools import tee, ifilterfalse, ifilter | |
import pysam |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#define SHIFT 4 | |
#define MSK 0x0F | |
#define UNT 1 | |
#define N 300000000 | |
#define print(X) for (i=1;i<1+N;i++) {printf("%d\t%d\n",i,(X)[i]);} | |
unsigned char aln[1+N]; |
This file contains 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
def create_workflow(args, conf): | |
""" | |
:type conf:ChiLinConfig | |
""" | |
root_workflow = Workflow("Main") | |
ShellCommand("prepare","mkdir -p {output}",output = conf.target_dir).attach_to(root_workflow) | |
groom_workflow = attach(root_workflow, Workflow("Groom")) | |
rawQC_workflow = attach(root_workflow, Workflow("RawQC")) | |
map_workflow = attach(root_workflow, Workflow("ReadsMapping")) |
This file contains 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
def _peaks_parse(input): | |
total = 0 | |
fc20n = 0 | |
fc10n = 0 | |
peaks_info = {} | |
with open(input) as peaks_xls: | |
for line in peaks_xls: | |
if line.startswith('# tags after filtering in treatment'): | |
# tags after filtering in treatment: 13438948 | |
peaks_info["uniloc"] = int(line.strip().split(":")[1]) |
This file contains 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
def parseFactorByAntibody(geoPost): | |
targetFlds = ["CHIP_ANTIBODY", "ANTIBODY", "CHIP", "ANTIBODY_SOURCE", "ANTIBODY_ANTIBODYDESCRIPTION", | |
"ANTIBODY_TARGETDESCRIPTION"] | |
#1. try to get the values | |
for t in targetFlds: | |
tmp = getFromPost(geoPost, t).strip() | |
if not tmp: | |
continue | |
tmp = tmp.upper().replace("ANTI-", " ").replace("ANTI", " ").strip() | |
if len(tmp) < 10 and tmp != "": |
This file contains 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 | |
sudo date 03050001 | |
# Replace the following line with any application you need to run | |
open /Applications/Merriam-Webster\ 4.0/Merriam-Webster\ Dictionary.app | |
# sleep 60 | |
# Set back to the current time using apple service (network needed) | |
sudo ntpdate -u time.apple.com |
OlderNewer