org.fhcrc.cpl.toolbox.proteomics
Class Clusterer2D
java.lang.Object
org.fhcrc.cpl.toolbox.proteomics.Clusterer2D
- Direct Known Subclasses:
- FeatureClusterer
public class Clusterer2D
- extends java.lang.Object
_Highly_ generic 2-dimensional clusterer. Adapted from FeatureGrouper, which was specific
to clustering Features by mass and scan.
Arrays of Clusterables are added to a tree structure, which divides them up first by
dimension1 and then by dimension2. Each Clusterable is aware of its value in both dimensions
and (as far as Clusterer2D is concerned) nothing else.
Any calling class will have to implement its own Clusterer class in order for clustering to have
any meaning.
So far so good. Here's the weird bit: we need to be able to cluster Features by mass, and
the max bucket size may be in terms of Daltons or in terms of PPM. If it's in terms of Daltons,
great. If ppm, then the canSplit() method has some very funky behavior. By default it behaves as
you might expect, though.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_dimensionSplitCalculator
protected Clusterer2D.ClusterDimensionSplitCalculator _dimensionSplitCalculator
_dimension1IsInt
protected boolean _dimension1IsInt
_dimension2IsInt
protected boolean _dimension2IsInt
Clusterer2D
public Clusterer2D()
Clusterer2D
public Clusterer2D(Clusterer2D.Clusterable[] clusterableArray)
calculateBestBuckets
public Pair<java.lang.Double,java.lang.Double> calculateBestBuckets(double[] dimension1Buckets,
double[] dimension2Buckets)
setDimensionSplitCalculator
public void setDimensionSplitCalculator(Clusterer2D.ClusterDimensionSplitCalculator dimensionSplitCalculator)
addSet
public void addSet(Clusterer2D.Clusterable[] clusterableArray)
split2D
public void split2D(double maxDimension1Bucket,
double maxDimension2Bucket)
summarize
public Clusterer2D.BucketSummary[] summarize()
histogramBucketCounts
public int[] histogramBucketCounts()
histogramSetCounts
public int[] histogramSetCounts()
numBuckets
public int numBuckets()
rowsWithOneFromEach
public int rowsWithOneFromEach()
rowsWithOneFromEach
public int rowsWithOneFromEach(Clusterer2D.BucketSummary[] bucketSummaries)
- Calculates how many buckets have exactly 1 feature from each feature set.
Useful for testing align
- Returns:
dimension1IsInt
public boolean dimension1IsInt()
setDimension1IsInt
public void setDimension1IsInt(boolean _dimension1IsInt)
dimension2IsInt
public boolean dimension2IsInt()
setDimension2IsInt
public void setDimension2IsInt(boolean _dimension2IsInt)
getClusterableArrays
public java.util.List<Clusterer2D.Clusterable[]> getClusterableArrays()
setClusterableArrays
public void setClusterableArrays(java.util.List<Clusterer2D.Clusterable[]> clusterableArrays)
Fred Hutchinson Cancer Research Center