def labelscan( self, pickingHeight=0.75, absThreshold=0.0, relThreshold=0.0, snThreshold=0.0, baselineWindow=0.1, baselineOffset=0.0, smoothMethod=None, smoothWindow=0.2, smoothCycles=1, ): """Label centroides in current scan. pickingHeight (float) - peak picking height for centroiding absThreshold (float) - absolute intensity threshold relThreshold (float) - relative intensity threshold snThreshold (float) - signal to noise threshold baselineWindow (float) - noise calculation window (in %/100) baselineOffset (float) - baseline offset, relative to noise width (in %/100) smoothMethod (None, MA, GA or SG) - smoothing method smoothWindow (float) - m/z window size for smoothing smoothCycles (int) - number of smoothing cycles """ # get baseline baseline = self.baseline(window=baselineWindow, offset=baselineOffset) # pre-smooth profile profile = self.profile if smoothMethod: profile = mod_signal.smooth(signal=profile, method=smoothMethod, window=smoothWindow, cycles=smoothCycles) # label peaks peaklist = mod_peakpicking.labelscan( signal=profile, pickingHeight=pickingHeight, absThreshold=absThreshold, relThreshold=relThreshold, snThreshold=snThreshold, baseline=baseline, ) # check peaklist if peaklist == None: return False # update peaklist self.peaklist = peaklist return True
def labelscan(self, pickingHeight=0.75, absThreshold=0., relThreshold=0., snThreshold=0., baselineWindow=0.1, baselineOffset=0., smoothMethod=None, smoothWindow=0.2, smoothCycles=1): """Label centroides in current scan. pickingHeight (float) - peak picking height for centroiding absThreshold (float) - absolute intensity threshold relThreshold (float) - relative intensity threshold snThreshold (float) - signal to noise threshold baselineWindow (float) - noise calculation window (in %/100) baselineOffset (float) - baseline offset, relative to noise width (in %/100) smoothMethod (None, MA, GA or SG) - smoothing method smoothWindow (float) - m/z window size for smoothing smoothCycles (int) - number of smoothing cycles """ # get baseline baseline = self.baseline(window=baselineWindow, offset=baselineOffset) # pre-smooth profile profile = self.profile if smoothMethod: profile = mod_signal.smooth(signal=profile, method=smoothMethod, window=smoothWindow, cycles=smoothCycles) # label peaks peaklist = mod_peakpicking.labelscan(signal=profile, pickingHeight=pickingHeight, absThreshold=absThreshold, relThreshold=relThreshold, snThreshold=snThreshold, baseline=baseline) # check peaklist if peaklist == None: return False # update peaklist self.peaklist = peaklist return True
def smooth(self, method, window, cycles=1): """Smooth profile. method (MA GA SG) - smoothing method window (float) - m/z window size for smoothing cycles (int) - number of repeating cycles """ # smooth data profile = mod_signal.smooth(signal=self.profile, method=method, window=window, cycles=cycles) # store data self.profile = profile self.peaklist.empty() # clear buffers self.reset()