org.fhcrc.cpl.viewer.align
Class Aligner

java.lang.Object
  extended by org.fhcrc.cpl.viewer.align.Aligner
Direct Known Subclasses:
QuantileRegressionAligner, SplineAligner

public abstract class Aligner
extends java.lang.Object

Created by IntelliJ IDEA. User: migra Date: Mar 1, 2005 Time: 10:10:36 AM dhmay, 5/7/08. Making this class abstract. Alignment can be performed via two different algorithms: a spline-based regression, or a quantile regression similar to what's used in AMT. The two algorithms perform very similarly on data that are tightly filtered, but the quantile regression performs much better on noisy data.


Nested Class Summary
static interface Aligner.FeaturePairSelector
          Interface for classes that provide a way of selecting pairs of features.
static class Aligner.HybridFeaturePairSelector
          Select pairs of features based on peptide agreement, and also mass tolerance
static class Aligner.MassFeaturePairSelector
           
static class Aligner.MassOrMzFeaturePairSelector
          This class selects pairs of features purely based on m/z -- it pairs up features that are within a given m/z tolerance.
static class Aligner.MzFeaturePairSelector
           
static class Aligner.PeptideFeaturePairSelector
          Selecte pairs of features based on peptide agreement
 
Field Summary
protected  PanelWithChart alignmentChart
           
protected  boolean buildCharts
           
static Aligner.FeaturePairSelector DEFAULT_FEATURE_PAIR_SELECTOR
           
protected  Aligner.FeaturePairSelector featurePairSelector
           
protected  double maxLeverageNumerator
           
protected  double maxStudRes
           
protected  java.util.List<int[]> warpingMaps
           
 
Constructor Summary
Aligner()
           
 
Method Summary
 java.util.List<FeatureSet> alignFeatureSets(java.util.List<FeatureSet> sets, boolean showCharts)
          Perform the non-linear mapping between feature sets
 double[] alignPairs(Pair<java.lang.Integer,java.lang.Double>[] pairs, int maxValueToWarp)
          Cover method.
abstract  double[] alignPairs(Pair<java.lang.Integer,java.lang.Double>[] pairs, int maxValueToWarp, java.lang.String tempFileNameStart)
          Generic method for creating a warping based on pairs of values.
protected  PanelWithChart createChart(Pair<java.lang.Integer,java.lang.Double>[] allPairedScans, Pair<java.lang.Integer,java.lang.Double>[] restrictedPairs, double[] warpedValues)
           
protected  java.lang.String getAlignedFileName(java.util.List featureSets, int i)
          Return a filename with an "align" in it.
 PanelWithChart getAlignmentChart()
           
 Aligner.FeaturePairSelector getFeaturePairSelector()
           
 double getMaxLeverageNumerator()
           
static int getMaxScan(Feature[] features)
          Calculate the maximum scan number of any of these features
 double getMaxStudRes()
           
static float getMaxTime(Feature[] features)
          Calculate the maximum time of any of these features
 java.util.List<int[]> getWarpingMaps()
          Provide access to the scan maps created for individual feature sets.
 boolean isBuildCharts()
           
 void plotWarping(double[] warping)
           
 void plotWarpings()
           
 void plotWarpings(double[][] warpings)
           
protected  Pair<java.lang.Integer,java.lang.Double>[] restrictPairsForRegression(Pair<java.lang.Integer,java.lang.Double>[] allPairs)
           
 void setAlignmentChart(PanelWithChart alignmentChart)
           
 void setBuildCharts(boolean buildCharts)
           
 void setFeaturePairSelector(Aligner.FeaturePairSelector featurePairSelector)
           
 void setMaxLeverageNumerator(double maxLeverageNumerator)
           
 void setMaxStudRes(double maxStudRes)
           
protected  java.io.File writePairsFile(Pair<java.lang.Integer,java.lang.Double>[] pairs, java.lang.String fileName)
          Write a file containing pairs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FEATURE_PAIR_SELECTOR

public static final Aligner.FeaturePairSelector DEFAULT_FEATURE_PAIR_SELECTOR

featurePairSelector

protected Aligner.FeaturePairSelector featurePairSelector

warpingMaps

protected java.util.List<int[]> warpingMaps

buildCharts

protected boolean buildCharts

alignmentChart

protected PanelWithChart alignmentChart

maxStudRes

protected double maxStudRes

maxLeverageNumerator

protected double maxLeverageNumerator
Constructor Detail

Aligner

public Aligner()
Method Detail

getMaxScan

public static int getMaxScan(Feature[] features)
Calculate the maximum scan number of any of these features

Parameters:
features -
Returns:

getMaxTime

public static float getMaxTime(Feature[] features)
Calculate the maximum time of any of these features

Parameters:
features -
Returns:

alignFeatureSets

public java.util.List<FeatureSet> alignFeatureSets(java.util.List<FeatureSet> sets,
                                                   boolean showCharts)
Perform the non-linear mapping between feature sets


restrictPairsForRegression

protected Pair<java.lang.Integer,java.lang.Double>[] restrictPairsForRegression(Pair<java.lang.Integer,java.lang.Double>[] allPairs)

alignPairs

public double[] alignPairs(Pair<java.lang.Integer,java.lang.Double>[] pairs,
                           int maxValueToWarp)
Cover method. In the absence of filename information, use a filename that's likely to be unique

Parameters:
pairs -
maxValueToWarp -
Returns:

alignPairs

public abstract double[] alignPairs(Pair<java.lang.Integer,java.lang.Double>[] pairs,
                                    int maxValueToWarp,
                                    java.lang.String tempFileNameStart)
Generic method for creating a warping based on pairs of values. Create temp files with names based on tempFileNameStart, in case the user wants to peruse them

Parameters:
pairs -
maxValueToWarp -
Returns:

createChart

protected PanelWithChart createChart(Pair<java.lang.Integer,java.lang.Double>[] allPairedScans,
                                     Pair<java.lang.Integer,java.lang.Double>[] restrictedPairs,
                                     double[] warpedValues)

writePairsFile

protected java.io.File writePairsFile(Pair<java.lang.Integer,java.lang.Double>[] pairs,
                                      java.lang.String fileName)
                               throws java.io.FileNotFoundException
Write a file containing pairs

Parameters:
fileName -
Throws:
java.io.FileNotFoundException

getAlignedFileName

protected java.lang.String getAlignedFileName(java.util.List featureSets,
                                              int i)
Return a filename with an "align" in it. If there's a source file for the featureset, use that name to start with. If not, index.

Parameters:
featureSets -
i -
Returns:

getWarpingMaps

public java.util.List<int[]> getWarpingMaps()
Provide access to the scan maps created for individual feature sets. Obviously, only applicable if you've just done alignment on a bunch of feature sets

Returns:

plotWarpings

public void plotWarpings()

plotWarpings

public void plotWarpings(double[][] warpings)

plotWarping

public void plotWarping(double[] warping)

getFeaturePairSelector

public Aligner.FeaturePairSelector getFeaturePairSelector()

setFeaturePairSelector

public void setFeaturePairSelector(Aligner.FeaturePairSelector featurePairSelector)

isBuildCharts

public boolean isBuildCharts()

setBuildCharts

public void setBuildCharts(boolean buildCharts)

getAlignmentChart

public PanelWithChart getAlignmentChart()

setAlignmentChart

public void setAlignmentChart(PanelWithChart alignmentChart)

getMaxStudRes

public double getMaxStudRes()

setMaxStudRes

public void setMaxStudRes(double maxStudRes)

getMaxLeverageNumerator

public double getMaxLeverageNumerator()

setMaxLeverageNumerator

public void setMaxLeverageNumerator(double maxLeverageNumerator)


Fred Hutchinson Cancer Research Center