org.fhcrc.cpl.viewer.feature.extraction
Class DefaultFeatureScorer

java.lang.Object
  extended by org.fhcrc.cpl.viewer.feature.extraction.DefaultFeatureScorer
All Implemented Interfaces:
FeatureScorer

public class DefaultFeatureScorer
extends java.lang.Object
implements FeatureScorer

Default feature scorer. If we ever implement another one, maybe some machinery can be moved up into a base class* Has side effects on scored features: adjusts m/z, and sets kl, etc.


Field Summary
protected  int _maxPeaksPerFeature
           
protected  double _maxResampledDistanceBetweenFeatures
           
protected  int _resamplingFrequency
           
static int DEFAULT_MAX_PEAKS_PER_FEATURE
           
protected  boolean keepStatistics
           
static float SUMSQUARES_MZ_WEIGHT
           
static float SUMSQUARES_SCALED_INTENSITY_WEIGHT
           
protected  java.util.List<java.lang.Float> unscaledIntensityDistances
           
protected  java.util.List<java.lang.Float> unscaledMzDistances
           
 
Constructor Summary
DefaultFeatureScorer()
           
 
Method Summary
 float calcSumSquaresDistance2D(Feature f, float[] scaledIntensityDistribution, Spectrum.Peak[] peptidePeaks)
          Assign a score to a particular feature, given a scaled representation of its peak intensities and the peaks themselves.
protected  int findClosestPeak(Spectrum.Peak[] peaks, float x, int start)
           
 int getMaxPeaksPerFeature()
           
 int getResamplingFrequency()
           
 boolean isKeepStatistics()
           
 void plotStatistics()
           
 float scoreFeature(Feature f, Spectrum.Peak[] peaks)
          score a candidate feature f, and set the list of peaks that it's comprised of

Expecting charge=0 features and peaks TODO: document this better

 void setKeepStatistics(boolean keepStatistics)
           
 void setMaxPeaksPerFeature(int maxPeaksPerFeature)
           
 void setMaxResampledDistanceBetweenFeatures(double newValue)
           
 void setResamplingFrequency(int resamplingFrequency)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_resamplingFrequency

protected int _resamplingFrequency

_maxResampledDistanceBetweenFeatures

protected double _maxResampledDistanceBetweenFeatures

DEFAULT_MAX_PEAKS_PER_FEATURE

public static final int DEFAULT_MAX_PEAKS_PER_FEATURE
See Also:
Constant Field Values

_maxPeaksPerFeature

protected int _maxPeaksPerFeature

SUMSQUARES_MZ_WEIGHT

public static final float SUMSQUARES_MZ_WEIGHT
See Also:
Constant Field Values

SUMSQUARES_SCALED_INTENSITY_WEIGHT

public static final float SUMSQUARES_SCALED_INTENSITY_WEIGHT
See Also:
Constant Field Values

keepStatistics

protected boolean keepStatistics

unscaledMzDistances

protected java.util.List<java.lang.Float> unscaledMzDistances

unscaledIntensityDistances

protected java.util.List<java.lang.Float> unscaledIntensityDistances
Constructor Detail

DefaultFeatureScorer

public DefaultFeatureScorer()
Method Detail

scoreFeature

public float scoreFeature(Feature f,
                          Spectrum.Peak[] peaks)
score a candidate feature f, and set the list of peaks that it's comprised of

Expecting charge=0 features and peaks TODO: document this better

Specified by:
scoreFeature in interface FeatureScorer
Parameters:
f -
peaks -

calcSumSquaresDistance2D

public float calcSumSquaresDistance2D(Feature f,
                                      float[] scaledIntensityDistribution,
                                      Spectrum.Peak[] peptidePeaks)
Assign a score to a particular feature, given a scaled representation of its peak intensities and the peaks themselves. This is kind of a 2-dimensional sum-squares distance measure. Lower is better

Parameters:
f -
scaledIntensityDistribution -
peptidePeaks -
Returns:

findClosestPeak

protected int findClosestPeak(Spectrum.Peak[] peaks,
                              float x,
                              int start)

getResamplingFrequency

public int getResamplingFrequency()

setResamplingFrequency

public void setResamplingFrequency(int resamplingFrequency)

setMaxResampledDistanceBetweenFeatures

public void setMaxResampledDistanceBetweenFeatures(double newValue)

getMaxPeaksPerFeature

public int getMaxPeaksPerFeature()

setMaxPeaksPerFeature

public void setMaxPeaksPerFeature(int maxPeaksPerFeature)

isKeepStatistics

public boolean isKeepStatistics()

setKeepStatistics

public void setKeepStatistics(boolean keepStatistics)

plotStatistics

public void plotStatistics()


Fred Hutchinson Cancer Research Center