org.fhcrc.cpl.viewer.feature
Class FeatureStrategyPeakClustersOld

java.lang.Object
  extended by org.fhcrc.cpl.viewer.feature.FeatureExtractor
      extended by org.fhcrc.cpl.viewer.feature.FeatureStrategyUsingWindow
          extended by org.fhcrc.cpl.viewer.feature.FeatureStrategyPeakClustersOld
Direct Known Subclasses:
FeatureStrategyPeaks2

public class FeatureStrategyPeakClustersOld
extends FeatureStrategyUsingWindow

User: mbellew Date: Nov 2, 2004


Nested Class Summary
 
Nested classes/interfaces inherited from class org.fhcrc.cpl.viewer.feature.FeatureExtractor
FeatureExtractor.StatusListener
 
Field Summary
 boolean debugReturnPeaks
           
static Smooth2D smoothTHRESHOLD
           
 
Fields inherited from class org.fhcrc.cpl.viewer.feature.FeatureStrategyUsingWindow
_noise
 
Fields inherited from class org.fhcrc.cpl.viewer.feature.FeatureExtractor
_dumpWindowSize, _maxCharge, _mzRange, _run, _scanCount, _sn, _startScan, _status, DEFAULT_EXTRACTOR_PROPERTYNAME, TYPE_1D, TYPE_2D
 
Constructor Summary
FeatureStrategyPeakClustersOld(MSRun run, int scanIndex, int count, int maxCharge, FloatRange range, double sn)
           
 
Method Summary
 Feature[] _analyze()
           
protected static void _logDebug(java.lang.String s)
           
static float[] _thresholdElution(float[] elution)
           
static float AccurateMass(MSRun run, Feature f, int nScans)
           
static float AccurateMassCentroid(MSRun run, Feature f)
           
static float AccurateMassProfile(MSRun run, Feature f, int nScans)
          adjustment of profile-mode mass; average results from some number of adjacent scans
protected  java.util.Collection<Feature> analyze2D(Scan[] scans)
          THIS IS THE MAIN FEATURE FINDING ROUTINE Structure: Spectrum.Resample() Smoothing Separate background from signal (Spectrum.RemoveBackground) Extract peaks -- wavelet decomposition, smooth, ExtractMaxima2D.analyze() Sort by decreasing intensity Throw out peaks with < 5 scans Break up what look like double-humped elution profiles by breaking peaks at valleys in the profile For each peak: -Compute the extents -Walking down scans, make sure that the peak's intensity is greater than the intensities of the two m/z's around it -Make sure that intensity is above threshold -If you start going back up in intensity, stop -Same for end scan -If too short (<5 scans), toss it out -"Integrate" to determine total intensity: for each scan, add a block of intensity corresponding to the intensity on that scan multiplied by half the amount of time between the adjoining scans -Create a feature to represent the individual peak Exclude all features initially Filter features: for each feature: find all neighbors within 5 scans and 1.1 m/z units if the m/z's are too close (within 1.5 / 36, for some reason), no dice make sure they're lined up, scan-wise If not enough scans combined in the two features, no dice If intensities not high enough, no dice If we got here, unexclude both FeatureStrategyUsingWindow.ExtractPeptideFeatures(), to tie features together Dump windows around feature, if asked for Change scan numbers, which are currently indexes, to the actual scan numbers If centroided, call AccurateMassCentroid() to fix mass
protected  float[][] calculateMedian(Scan[] scans, float[][] spectra, int width, int height)
          Calculate median intensity at each point on the grid TODO: parameterize hardcoded window sizes (72, 36), or at least tie them to variables somewhere
 int getType()
           
protected  float[][] resampleSpectra(Scan[] scans, java.lang.Thread currentThread, boolean useMedianSmooth)
          Resample the spectra, within the M/Z range _mzRange, onto a regular grid, with frequency RESAMPLE_FREQ
 
Methods inherited from class org.fhcrc.cpl.viewer.feature.FeatureStrategyUsingWindow
_pickPeaks, _smooth, analyze1D, ExtractPeptideFeatures, ScoreFeature
 
Methods inherited from class org.fhcrc.cpl.viewer.feature.FeatureExtractor
analyze, analyzeScanAtATime, analyzeWindow, CombineScans, getAccurateMassAdjustmentScans, getDefault, getDefaultClass, getDumpWindowSize, getMzExtractionRange, getMzExtractionRange, getScans, setAccurateMassAdjustmentScans, setDefault, setDumpWindowSize, setStatusListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugReturnPeaks

public boolean debugReturnPeaks

smoothTHRESHOLD

public static Smooth2D smoothTHRESHOLD
Constructor Detail

FeatureStrategyPeakClustersOld

public FeatureStrategyPeakClustersOld(MSRun run,
                                      int scanIndex,
                                      int count,
                                      int maxCharge,
                                      FloatRange range,
                                      double sn)
Method Detail

getType

public int getType()
Overrides:
getType in class FeatureExtractor

_thresholdElution

public static float[] _thresholdElution(float[] elution)

_analyze

public Feature[] _analyze()
                   throws java.lang.InterruptedException
Overrides:
_analyze in class FeatureStrategyUsingWindow
Throws:
java.lang.InterruptedException

resampleSpectra

protected float[][] resampleSpectra(Scan[] scans,
                                    java.lang.Thread currentThread,
                                    boolean useMedianSmooth)
                             throws java.lang.InterruptedException
Resample the spectra, within the M/Z range _mzRange, onto a regular grid, with frequency RESAMPLE_FREQ

Parameters:
scans -
currentThread -
useMedianSmooth -
Returns:
Throws:
java.lang.InterruptedException

calculateMedian

protected float[][] calculateMedian(Scan[] scans,
                                    float[][] spectra,
                                    int width,
                                    int height)
Calculate median intensity at each point on the grid TODO: parameterize hardcoded window sizes (72, 36), or at least tie them to variables somewhere

Parameters:
scans -
spectra -
width -
height -
Returns:

analyze2D

protected java.util.Collection<Feature> analyze2D(Scan[] scans)
                                           throws java.lang.InterruptedException
THIS IS THE MAIN FEATURE FINDING ROUTINE Structure: Spectrum.Resample() Smoothing Separate background from signal (Spectrum.RemoveBackground) Extract peaks -- wavelet decomposition, smooth, ExtractMaxima2D.analyze() Sort by decreasing intensity Throw out peaks with < 5 scans Break up what look like double-humped elution profiles by breaking peaks at valleys in the profile For each peak: -Compute the extents -Walking down scans, make sure that the peak's intensity is greater than the intensities of the two m/z's around it -Make sure that intensity is above threshold -If you start going back up in intensity, stop -Same for end scan -If too short (<5 scans), toss it out -"Integrate" to determine total intensity: for each scan, add a block of intensity corresponding to the intensity on that scan multiplied by half the amount of time between the adjoining scans -Create a feature to represent the individual peak Exclude all features initially Filter features: for each feature: find all neighbors within 5 scans and 1.1 m/z units if the m/z's are too close (within 1.5 / 36, for some reason), no dice make sure they're lined up, scan-wise If not enough scans combined in the two features, no dice If intensities not high enough, no dice If we got here, unexclude both FeatureStrategyUsingWindow.ExtractPeptideFeatures(), to tie features together Dump windows around feature, if asked for Change scan numbers, which are currently indexes, to the actual scan numbers If centroided, call AccurateMassCentroid() to fix mass

Overrides:
analyze2D in class FeatureExtractor
Throws:
java.lang.InterruptedException

AccurateMass

public static float AccurateMass(MSRun run,
                                 Feature f,
                                 int nScans)

AccurateMassCentroid

public static float AccurateMassCentroid(MSRun run,
                                         Feature f)

AccurateMassProfile

public static float AccurateMassProfile(MSRun run,
                                        Feature f,
                                        int nScans)
adjustment of profile-mode mass; average results from some number of adjacent scans


_logDebug

protected static void _logDebug(java.lang.String s)


Fred Hutchinson Cancer Research Center