Permalink
Browse files

fixed assorted indexing bugs

  • Loading branch information...
1 parent 1155dee commit 6fd7058df402d2506d023e87a586f6d9c4fb61d7 @ryneches committed Dec 27, 2012
Showing with 22 additions and 13 deletions.
  1. +2 −2 pique/analysis.py
  2. +4 −4 pique/peak.pyx
  3. +9 −7 pique/runtime.py
  4. +7 −0 scripts/pique
View
@@ -141,8 +141,8 @@ def find_peaks( self, ar_name ) :
length = len( ipf )
- norm_f = ipf/median(ipf) - bgf/median(bgf)
- norm_r = ipr/median(ipr) - bgr/median(bgr)
+ norm_f = ipf/numpy.median(ipf) - bgf/numpy.median(bgf)
+ norm_r = ipr/numpy.median(ipr) - bgr/numpy.median(bgr)
maxcov = max( numpy.concatenate( ( norm_f, norm_r ) ) )
View
@@ -74,13 +74,13 @@ def peakdet( v, \
mnpos = x[i]
if lookformax:
- if this < mx-delta:
+ if this < mx-delta and mx != -numpy.inf :
maxtab.append((mxpos, mx))
mn = this
mnpos = x[i]
lookformax = False
else:
- if this > mn+delta:
+ if this > mn+delta and mn != numpy.inf:
mintab.append((mnpos, mn))
mx = this
mxpos = x[i]
@@ -105,8 +105,8 @@ def region( v, \
"""
- cdef DTYPE_t x0 = -numpy.inf
- cdef DTYPE_t x1 = numpy.inf
+ cdef DTYPE_t x0 = 0
+ cdef DTYPE_t x1 = 0
cdef int max_v = len(v) - 1
cdef int hang_0 = 0
cdef int hang_1 = 0
View
@@ -135,15 +135,17 @@ def detect( name,
# if a WAV file was requested, write it
if wav_file :
- for contig in PA.keys() :
+ for contig in D.data.keys() :
file = name + '_' + contig + '.wav'
pique.msg( logfile, 'writing WAV output : ' + file )
- pique.fileIO.writeWAV( file,
- PA,
- track='IP',
- minusBG=True,
- amplify=True )
-
+ pique.fileIO.writeWAV( file,
+ D.data,
+ contig,
+ track='IP',
+ minusBG=True,
+ amplify=True )
+
+
# write output files
pique.msg( logfile, 'writing output files...' )
pique.fileIO.writepeaksGFF( name + '.gff', PA.data )
View
@@ -134,6 +134,13 @@ parser_batch.add_argument( '-p',
required = False,
help = 'make a pickel file' )
+parser_batch.add_argument( '-w',
+ action = 'store_true',
+ dest = 'wav_file',
+ default = False,
+ required = False,
+ help = 'make WAV files' )
+
# Tk mode
parser_tk = subparsers.add_parser( 'tk', help='GUI mode for peak detection' )
parser_tk.set_defaults( func=mainTk )

0 comments on commit 6fd7058

Please sign in to comment.