Created
April 17, 2014 17:18
-
-
Save nimezhu/10999174 to your computer and use it in GitHub Desktop.
set a makefile as pipeline
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
BAM=your.bam | |
OUT=your.out |
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/env make - | |
HOME=/Users/zhuxp/Projects/lnc | |
GENOME=/Users/zhuxp/Data/genome/mm9.2bit | |
BAM=$(HOME)/BL6RNASeq/long250.miseq.gsnap.sorted.bam | |
PID=test007 | |
INPUT=$(HOME)/tmp.bed | |
all: $(PID).out | |
$(PID).splicesites.bed: $(BAM) | |
xBamToSpliceSites.py -i $(BAM) -o $@ -s read2 -g $(GENOME) | |
$(PID).splicesites.sorted.bed: $(PID).splicesites.bed | |
bedSort $^ $@ | |
$(PID).splicesites.sorted.bed.gz: $(PID).splicesites.sorted.bed | |
bgzip -c $^ > $@ | |
$(PID).splicesites.sorted.bed.gz.tbi: $(PID).splicesites.sorted.bed.gz | |
tabix $^ | |
$(PID).out: $(PID).splicesites.sorted.bed.gz.tbi | |
xBam8.py -s $(PID).splicesites.sorted.bed.gz -i $(INPUT) -b $(BAM) -o $(PID).out | |
clean: | |
rm $(PID).* |
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/env make - | |
HOME=/Users/zhuxp/Projects/lnc | |
GENOME=/Users/zhuxp/Data/genome/mm9.2bit | |
BAM=$(HOME)/BL6RNASeq/long250.miseq.gsnap.bam | |
PID=test007 | |
INPUT=$(HOME)/tmp.bed | |
all: $(PID).out | |
include CONFIG | |
$(PID).splicesites.bed: $(BAM) | |
xBamToSpliceSites.py -i $(BAM) -o $@ -s read2 -g $(GENOME) | |
$(PID).splicesites.bed.gz: $(PID).splicesites.bed | |
bedSort $^ $^ | |
bgzip $^ | |
tabix $@ | |
$(PID).out: $(PID).splicesites.bed.gz | |
xBam8.py -s $(PID).splicesites.bed.gz -i $(INPUT) -b $(BAM) -o $(PID).out | |
clean: | |
rm $(PID).* | |
test: | |
echo $(basename $(PID)) | |
echo $(INPUT) | |
echo $(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
#!/usr/bin/env python | |
# Programmer : zhuxp | |
# Date: | |
# Last-modified: 12-10-2013, 16:26:18 EST | |
VERSION="0.1" | |
import os,sys,argparse | |
from xplib.Tools import IO | |
def ParseArg(): | |
''' This Function Parse the Argument ''' | |
p=argparse.ArgumentParser( description = 'Example: %(prog)s -h', epilog='Library dependency : xplib') | |
p.add_argument('-v','--version',action='version',version='%(prog)s '+VERSION) | |
p.add_argument('-i','--input',dest="input",default="stdin",type=str,help="input file DEFAULT: STDIN") | |
if len(sys.argv)==1: | |
print >>sys.stderr,p.print_help() | |
exit(0) | |
return p.parse_args() | |
def Main(): | |
''' | |
IO TEMPLATE | |
''' | |
global args,out | |
args=ParseArg() | |
fin=IO.fopen(args.input,"r") | |
config=IO.read_config(fin) | |
print config | |
if __name__=="__main__": | |
Main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment