Skip to content

Commit

Permalink
Feb9
Browse files Browse the repository at this point in the history
  • Loading branch information
Aone committed Feb 10, 2017
1 parent 3fd79e2 commit c0d3669
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
38 changes: 15 additions & 23 deletions annotation_my.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,22 @@

##### FILE PREPARE #####
import sys,os
input_file = sys.argv[1]
import getopt
optlist,args = getopt.getopt(sys.argv[1:],'mdh',["mm10","dm6","hg19"])

# Define the reference genome annotation

# mouse mm10
if sys.argv[2] == 'mm10':
pro = '/Users/Aone/Documents/Bioinf/Annotation/mm10/promoter.bed'
exon = '/Users/Aone/Documents/Bioinf/Annotation/mm10/exon.bed'
down = '/Users/Aone/Documents/Bioinf/Annotation/mm10/downstream.bed'
intron = '/Users/Aone/Documents/Bioinf/Annotation/mm10/intron.bed'

# human hg19
elif sys.argv[2] == 'hg19':
pro = '/Users/Aone/Documents/Bioinf/Annotation/hg19/promoter.bed'
exon = '/Users/Aone/Documents/Bioinf/Annotation/hg19/exon.bed'
down = '/Users/Aone/Documents/Bioinf/Annotation/hg19/downstream.bed'
intron = '/Users/Aone/Documents/Bioinf/Annotation/hg19/intron.bed'

elif sys.argv[2] == 'dm6':
pro = '/Users/Aone/Documents/Bioinf/Annotation/dm6/promoter.bed'
exon = '/Users/Aone/Documents/Bioinf/Annotation/dm6/exon.bed'
down = '/Users/Aone/Documents/Bioinf/Annotation/dm6/downstream.bed'
intron = '/Users/Aone/Documents/Bioinf/Annotation/dm6/intron.bed'

for opt, value in optlist:
if opt in ('--mm10','-m'):
speices = 'mm10'
if opt in ('--dm6','-d'):
speices = 'dm6'
if opt in ('--h19','-m'):
speices = 'hg19'

pro = '/Users/Aone/Documents/Bioinf/Annotation/%s/promoter.bed' % speices
exon = '/Users/Aone/Documents/Bioinf/Annotation/%s/exon.bed' % speices
down = '/Users/Aone/Documents/Bioinf/Annotation/%s/downstream.bed' % speices
intron = '/Users/Aone/Documents/Bioinf/Annotation/%s/intron.bed' % speices

# Define temp file name
output_pro = '%s_pro.bed' % input_file.split('.')[0]
Expand Down Expand Up @@ -60,7 +52,7 @@ def intersect(i,r,o):
length+ = i
return length

# get non-overlapped region for next calculatio
# get non-overlapped region for next calculation
def subtract(i,r,i2):
cmd2 = 'subtractBed -a %s -b %s > %s' % (i, r, i2)
os.system(cmd2)
Expand Down
2 changes: 1 addition & 1 deletion bowtie2_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#######################################################################################################
import sys,os
import getopt
optlist,args = getopt.getopt(sys.argv[1:],'ho',["help","single_end","paired_end"])
optlist,args = getopt.getopt(sys.argv[1:],'ho:',["help","single_end","paired_end"])

#define mapping Flags
###
Expand Down
2 changes: 1 addition & 1 deletion bowtie2_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#######################################################################################################
import sys,os
import getopt
optlist,args = getopt.getopt(sys.argv[1:],'ho',["help","single_end","paired_end"])
optlist,args = getopt.getopt(sys.argv[1:],'ho:',["help","single_end","paired_end"])

########## subroutine ##########
# help_message() print help message for this pipeline
Expand Down

0 comments on commit c0d3669

Please sign in to comment.