comparison chipsequtil/map_to_known_genes.py @ 4:0eaa8225a09a draft

Uploaded
author alenail
date Mon, 04 Apr 2016 14:52:14 -0400
parents 4f66143b385a
children 182e829571f7
comparison
equal deleted inserted replaced
3:7a910b2c72ff 4:0eaa8225a09a
58 parser.error('Must provide three filename arguments') 58 parser.error('Must provide three filename arguments')
59 59
60 gene_ref = parse_gene_ref(args[0]) 60 gene_ref = parse_gene_ref(args[0])
61 xref_fn = args[1] 61 xref_fn = args[1]
62 peaks_fn = args[2] 62 peaks_fn = args[2]
63 if opts.peaks_fmt == 'auto' :
64 path,ext = os.path.splitext(peaks_fn)
65 if ext.lower() == '.xls' :
66 opts.peaks_fmt = 'MACS'
67 elif ext.lower() == '.bed' :
68 opts.peaks_fmt = 'BED'
69 elif ext.lower() == '.narrowpeak' :
70 opts.peaks_fmt = 'BED'
71 else :
72 parser.error('Could not guess peaks file format by extension (%s), aborting'%ext)
73 63
74 if opts.peaks_fmt == 'MACS' : 64 if opts.peaks_fmt == 'MACS' :
75 peaks_reader_cls = MACSFile 65 peaks_reader_cls = MACSFile
76 chr_field, start_field, end_field = 'chr', 'start', 'end' 66 chr_field, start_field, end_field = 'chr', 'start', 'end'
77 elif opts.peaks_fmt == 'BED' : 67 elif opts.peaks_fmt == 'BED' :