org.fhcrc.cpl.toolbox.proteomics.feature.matching
Class RecursiveFeatureSetMatcher

java.lang.Object
  extended by org.fhcrc.cpl.toolbox.proteomics.feature.matching.BaseFeatureSetMatcherImpl
      extended by org.fhcrc.cpl.toolbox.proteomics.feature.matching.RecursiveFeatureSetMatcher
All Implemented Interfaces:
FeatureSetMatcher

public class RecursiveFeatureSetMatcher
extends BaseFeatureSetMatcherImpl
implements FeatureSetMatcher

Attempts to match one feature set against another. This version is the closest to what CS types would call hierarchical clustering: we don't attempt to guess the global "best" values for every bucket. Instead, we start loose, make what matches we can, and drill down into the smaller buckets, breaking them up until either everything's cool or we hit a defined minimum in both dimensions. Strictly speaking, though, this isn't exactly hierarchical clustering, either. Instead of breaking clusters in half each time, I'm decreasing the cluster size slightly and re-clustering. In order to do true hierarchical clustering appropriately, it would be necessary to rewrite Clusterer2D. I think this is a close enough approximation that that's not a high priority. Since it would affect array creation, too, I'm reluctant to do it.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.fhcrc.cpl.toolbox.proteomics.feature.matching.BaseFeatureSetMatcherImpl
BaseFeatureSetMatcherImpl.FeatureElutionClosenessToBaseFeatureComparatorDesc
 
Nested classes/interfaces inherited from interface org.fhcrc.cpl.toolbox.proteomics.feature.matching.FeatureSetMatcher
FeatureSetMatcher.FeatureMatchingResult
 
Field Summary
protected static double ABSOLUTE_MASS_BUCKET_INCREMENT
           
static double DEFAULT_HYDRO_ELUTION_BUCKET_INCREMENT
           
static double DEFAULT_MIN_DELTA_H
           
static double DEFAULT_MIN_DELTA_MASS_DA
           
static double DEFAULT_MIN_DELTA_MASS_PPM
           
static double DEFAULT_MIN_DELTA_SCAN
           
static double DEFAULT_MIN_DELTA_TIME
           
static double DEFAULT_SCAN_ELUTION_BUCKET_INCREMENT
           
static double DEFAULT_TIME_ELUTION_BUCKET_INCREMENT
           
protected  double elutionBucketIncrement
           
protected  double massBucketIncrement
           
protected  int[] matchedAtDepth
           
protected  double minDeltaElution
           
protected  double minDeltaMass
           
protected static double PPM_MASS_BUCKET_INCREMENT
           
protected  boolean useMassInsteadOfMz
           
 
Fields inherited from class org.fhcrc.cpl.toolbox.proteomics.feature.matching.BaseFeatureSetMatcherImpl
DEFAULT_ELUTION_MODE, deltaElution, deltaMass, deltaMassType, ELUTION_MODE_HYDROPHOBICITY, ELUTION_MODE_SCAN, ELUTION_MODE_TIME, elutionMode, ORDER_BY_ELUTION_CLOSENESS_TO_MASTER_MODE, ORDER_BY_FEATURE_QUALITY_MODE, slaveSetOrderingMode
 
Fields inherited from interface org.fhcrc.cpl.toolbox.proteomics.feature.matching.FeatureSetMatcher
DEFAULT_DELTA_HYDROPHOBICITY, DEFAULT_DELTA_MASS_ABSOLUTE, DEFAULT_DELTA_MASS_PPM, DEFAULT_DELTA_MASS_TYPE, DEFAULT_DELTA_SCAN, DEFAULT_DELTA_TIME, DELTA_MASS_TYPE_ABSOLUTE, DELTA_MASS_TYPE_PPM
 
Constructor Summary
RecursiveFeatureSetMatcher()
           
RecursiveFeatureSetMatcher(float deltaMass, int deltaMassType, float deltaElution)
           
 
Method Summary
 double getElutionBucketIncrement()
           
protected  java.util.List<Feature> getFeatureListForClusterableList(java.util.List<Clusterer2D.Clusterable> clusterableList)
          Convert a list of Clusterables, assumed to be FeatureMassHydroClusterables, to a list of Features
 double getMassBucketIncrement()
           
 double getMinDeltaElution()
           
 double getMinDeltaMass()
           
 void init(float deltaMass, int deltaMassType, float deltaElution)
          Set the parameters that are common to all FeatureSetMatchers
 FeatureSetMatcher.FeatureMatchingResult matchFeatures(FeatureSet featureSet1, FeatureSet featureSet2)
          Match two feature sets using clustering
protected  FeatureSetMatcher.FeatureMatchingResult recursivelyMatch(java.util.List<Feature> set1Features, java.util.List<Feature> set2Features, double currentDeltaMass, double currentDeltaElution, int depth)
           
protected  void setDimensionSplitCalculator(FeatureClusterer clusterer)
          // In the PPM case, we have to convert from PPM to Da before figuring out whether we can split.
 void setElutionBucketIncrement(double elutionBucketIncrement)
           
 void setElutionMode(int newElutionMode)
           
 void setMassBucketIncrement(double massBucketIncrement)
           
 void setMinDeltaElution(double minDeltaElution)
           
 void setMinDeltaMass(double minDeltaMass)
           
 void setUseMassInsteadOfMz(boolean value)
           
 java.lang.String toString()
           
 
Methods inherited from class org.fhcrc.cpl.toolbox.proteomics.feature.matching.BaseFeatureSetMatcherImpl
getDeltaElution, getDeltaMass, getDeltaMassType, getElutionMode, getElutionValue, getSlaveSetOrderingMode, orderSlaveSetFeatures, setDeltaElution, setDeltaMass, setDeltaMassType, setSlaveSetOrderingMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HYDRO_ELUTION_BUCKET_INCREMENT

public static final double DEFAULT_HYDRO_ELUTION_BUCKET_INCREMENT
See Also:
Constant Field Values

DEFAULT_SCAN_ELUTION_BUCKET_INCREMENT

public static final double DEFAULT_SCAN_ELUTION_BUCKET_INCREMENT
See Also:
Constant Field Values

DEFAULT_TIME_ELUTION_BUCKET_INCREMENT

public static final double DEFAULT_TIME_ELUTION_BUCKET_INCREMENT
See Also:
Constant Field Values

ABSOLUTE_MASS_BUCKET_INCREMENT

protected static final double ABSOLUTE_MASS_BUCKET_INCREMENT
See Also:
Constant Field Values

PPM_MASS_BUCKET_INCREMENT

protected static final double PPM_MASS_BUCKET_INCREMENT
See Also:
Constant Field Values

massBucketIncrement

protected double massBucketIncrement

elutionBucketIncrement

protected double elutionBucketIncrement

DEFAULT_MIN_DELTA_MASS_PPM

public static final double DEFAULT_MIN_DELTA_MASS_PPM
See Also:
Constant Field Values

DEFAULT_MIN_DELTA_MASS_DA

public static final double DEFAULT_MIN_DELTA_MASS_DA
See Also:
Constant Field Values

DEFAULT_MIN_DELTA_SCAN

public static final double DEFAULT_MIN_DELTA_SCAN
See Also:
Constant Field Values

DEFAULT_MIN_DELTA_TIME

public static final double DEFAULT_MIN_DELTA_TIME
See Also:
Constant Field Values

DEFAULT_MIN_DELTA_H

public static final double DEFAULT_MIN_DELTA_H
See Also:
Constant Field Values

minDeltaMass

protected double minDeltaMass

minDeltaElution

protected double minDeltaElution

matchedAtDepth

protected int[] matchedAtDepth

useMassInsteadOfMz

protected boolean useMassInsteadOfMz
Constructor Detail

RecursiveFeatureSetMatcher

public RecursiveFeatureSetMatcher()

RecursiveFeatureSetMatcher

public RecursiveFeatureSetMatcher(float deltaMass,
                                  int deltaMassType,
                                  float deltaElution)
Method Detail

init

public void init(float deltaMass,
                 int deltaMassType,
                 float deltaElution)
Description copied from class: BaseFeatureSetMatcherImpl
Set the parameters that are common to all FeatureSetMatchers

Specified by:
init in interface FeatureSetMatcher
Overrides:
init in class BaseFeatureSetMatcherImpl

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setDimensionSplitCalculator

protected void setDimensionSplitCalculator(FeatureClusterer clusterer)
// In the PPM case, we have to convert from PPM to Da before figuring out whether we can split. // This is done by converting maxBucket based on this bucket's getMin() value. This will // ensure that a bucket will be split if any subregion of the bucket would be split for the // given PPM value. // This should be reasonable behavior, perhaps splitting slightly more than necessary.

Parameters:
clusterer -

matchFeatures

public FeatureSetMatcher.FeatureMatchingResult matchFeatures(FeatureSet featureSet1,
                                                             FeatureSet featureSet2)
Match two feature sets using clustering

Specified by:
matchFeatures in interface FeatureSetMatcher
Parameters:
featureSet1 -
featureSet2 -
Returns:

recursivelyMatch

protected FeatureSetMatcher.FeatureMatchingResult recursivelyMatch(java.util.List<Feature> set1Features,
                                                                   java.util.List<Feature> set2Features,
                                                                   double currentDeltaMass,
                                                                   double currentDeltaElution,
                                                                   int depth)

getFeatureListForClusterableList

protected java.util.List<Feature> getFeatureListForClusterableList(java.util.List<Clusterer2D.Clusterable> clusterableList)
Convert a list of Clusterables, assumed to be FeatureMassHydroClusterables, to a list of Features

Parameters:
clusterableList -
Returns:

getMassBucketIncrement

public double getMassBucketIncrement()

setMassBucketIncrement

public void setMassBucketIncrement(double massBucketIncrement)

getElutionBucketIncrement

public double getElutionBucketIncrement()

setElutionBucketIncrement

public void setElutionBucketIncrement(double elutionBucketIncrement)

setUseMassInsteadOfMz

public void setUseMassInsteadOfMz(boolean value)

getMinDeltaMass

public double getMinDeltaMass()

setMinDeltaMass

public void setMinDeltaMass(double minDeltaMass)

getMinDeltaElution

public double getMinDeltaElution()

setMinDeltaElution

public void setMinDeltaElution(double minDeltaElution)

setElutionMode

public void setElutionMode(int newElutionMode)
Overrides:
setElutionMode in class BaseFeatureSetMatcherImpl


Fred Hutchinson Cancer Research Center