Class Filter

java.lang.Object
  |
  +--Filter

public class Filter
extends java.lang.Object

Class Filter.java - Filter the current ProtPlot data. This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government and Djamel Medjahed (SAIC-Frederick). As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file.

Version:
$Date: 2002/10/14 20:17:17 $ $Revision: $
Author:
P. Lemkin (NCI), Djamel Medjahed (SAIC), NCI-Frederick, Frederick, MD
See Also:
ProtPlot Home

This work was derived from MAExplorer under the Mozilla 1.1 Open Source Public License by Peter Lemkin of the National Cancer Institute, an agency of the United States Government subject to the limitations noted in the accompanying LEGAL file. See licence info on http://maexplorer.sourceforge.org/


Field Summary
 double cvEPdata
          computed Coefficient of variation all EP set data for current protein
 double cvXdata
          computed Coefficient of variation all X set data for current protein
 double cvYdata
          computed Coefficient of variation all Y set data for current protein
 boolean didDataSetupFlag
          flag: set by setupData() if successful
 boolean didStatisticsFlag
          flag: set by calcPrimaryStatisticss() if successful
 boolean doingXYscatterPlotFlag
          set if doing display X vs Y in ratio mode
private  DrawProtScatterPlot dwSP
          instance of DrawProtScatterPlot
 double[] epData
          quant data for all EP (set) members
 double mnEPdata
          computed mean intensity EP set data for current protein
 double mnXdata
          computed mean intensity X set data for current protein
 double mnYdata
          computed mean intensity Y set data for current protein
 int nEP
          # of EP set members after setup
 int nEPsamplesPassedMinProteins
          Compute the min # of EP set samples passing > S proteins/Sample test
 int nSamplesPassedMinProteins
          Compute the min # of X&Y or EP set samples passing > S proteins/Sample test
 int nX
          # of X set members after setup
 int nXsamplesPassedMinProteins
          Compute the min # of X set samples passing > S proteins/Sample test
 int nY
          # of Y set members after setup
 int nYsamplesPassedMinProteins
          Compute the min # of Y set samples passing > S proteins/Sample test
 boolean passedDisplayXYRangeTest
          set if doing display X vs Y in ratio mode AND (exprX,exprY) in X and Y range of scatterplot
 int passedEPminSamplesCtr
          counters for missing samples protein test for EP set
 int passedExprCtr
          counters Expr counter
 int passedFamilyCtr
          counters Family counter
 int passedFilterCtr
          counters Filter counter
 int passedKStestCtr
          counters for KS-test
 int passedMaxMWsizeCtr
          counters max MW size counter
 boolean passedMissingProteins
          Combined flag for both X & Y or EP missing proteins tests
 int passedMwPIRangeCtr
          counter for test of (pM.pI,pM.mw) within pI and Mw scroller range limits
 boolean passedMwPIRangeTest
          Flag that tests if (pM.pI,pM.mw) is within the pI and Mw scroller range limits
 int passedNsamplesCtr
          counters N samples counter
 int passedRatioCtr
          counters Ratio counter
 int passedSavedClusterCtr
          counter for proteins in saved Cluster set of proteins
 int passedSavedFilterCtr
          counter for proteins in saved Filter set of proteins
 int passedTissueCtr
          counters Tissue counter
 int passedTtestCtr
          counters for t-test
 int passedXYmissingProteinsCtr
          counter for missing X and Y set protein test
private  ProtPlot prp
          instance of ProtPlot
 float pValue
          computed Computed pValue when use the t-Test for current protein
 float ratioXYsets
          computed ratio of mnXdata/mnYdata if mnYdata NEQ 0 for current protein
private  StatisticsPRP stat
          instance of StatisticsPRP
 double stdDevEPdata
          computed std deviation EP set data for current protein
 double stdDevXdata
          computed std deviation X set data for current protein
 double stdDevYdata
          computed std deviation Y set data for current protein
private  UtilPRP util
          instance of UtilPRP
 double[] xData
          quant data for all X (set) members.
 double[] xDataP1
          quant data for all X (set) members.
 double[] yData
          quant data for all Y (set) members.
 double[] yDataP1
          quant data for all Y (set) members.
 
Constructor Summary
Filter(ProtPlot prp)
          Filter() - constructor
 
Method Summary
 boolean allocLocalEPdataArrays(boolean allocAnywaysFlag)
          allocLocalEPdataArrays() - setup or change EP sets array allocations used by Filter
 boolean allocLocalXYdataArrays(boolean allocAnywaysFlag)
          allocLocalXYdataArrays() - setup or change X, Y, or EP sets array allocations used by Filter
(package private)  boolean calcEPstatistics()
          calcEPstatistics() - compute primary statistics for EP set data in epData[0:nEP-1].
(package private)  boolean calcXYstatistics()
          calcXYstatistics() - compute primary statistics for X and Y sets for current x(y)Data[].
 boolean checkSamplesFilter(int mPid)
          checkSamplesFilter() - check Proteins (pX,pY) to see if it passed filter.
(package private)  java.lang.String getExtraFilterData(int mPid)
          getExtraFilterData() - get extra Filter data from t-Test, KS-test etc.
 java.lang.String[] getSampleListBySubstring(java.lang.String sMatch)
          getSampleListBySubstring() - return a list of sample names by substring matching
 int resetFilterCounters()
          resetFilterCounters() - reset the filter counters
 void saveFilter()
          saveFilter() - save current Filtered proteins into prp.savedFilterMPIDs[]
(package private)  boolean setupLocalEPsetData(int mPid, boolean allocAnywaysFlag)
          setupLocalEPsetData() - setup local EP sets data arrays for pM
(package private)  boolean setupLocalXYsetData(int mPid, boolean allocAnywaysFlag)
          setupLocalXYsetData() - setup local X, and Y sets data arrays for pM
 boolean setupXYlabels()
          setupXYlabels() - set the XY labels based on samples selected.
 boolean test_XYsets_KS_Test(int mPid, float pValueThr, boolean getDataFlag)
          test_XYsets_KS_Test() - test if X and Y sets pass Kolmogorov-Smirnov Test with a pValue better than pValueThr.
 boolean test_XYsets_t_Test(int mPid, float pValueThr, boolean getDataFlag)
          test_XYsets_t_Test() - test if X and Y sets pass the t-Test with a pValue better than pValueThr.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

prp

private ProtPlot prp
instance of ProtPlot

stat

private StatisticsPRP stat
instance of StatisticsPRP

util

private UtilPRP util
instance of UtilPRP

dwSP

private DrawProtScatterPlot dwSP
instance of DrawProtScatterPlot

didDataSetupFlag

public boolean didDataSetupFlag
flag: set by setupData() if successful

didStatisticsFlag

public boolean didStatisticsFlag
flag: set by calcPrimaryStatisticss() if successful

nX

public int nX
# of X set members after setup

nY

public int nY
# of Y set members after setup

nEP

public int nEP
# of EP set members after setup

xData

public double[] xData
quant data for all X (set) members. xDataP1[j+1]= xData[j]

xDataP1

public double[] xDataP1
quant data for all X (set) members. xDataP1[j+1]= xData[j]

yData

public double[] yData
quant data for all Y (set) members. yDataP1[j+1]= yData[j]

yDataP1

public double[] yDataP1
quant data for all Y (set) members. yDataP1[j+1]= yData[j]

epData

public double[] epData
quant data for all EP (set) members

mnXdata

public double mnXdata
computed mean intensity X set data for current protein

mnYdata

public double mnYdata
computed mean intensity Y set data for current protein

mnEPdata

public double mnEPdata
computed mean intensity EP set data for current protein

ratioXYsets

public float ratioXYsets
computed ratio of mnXdata/mnYdata if mnYdata NEQ 0 for current protein

stdDevXdata

public double stdDevXdata
computed std deviation X set data for current protein

stdDevYdata

public double stdDevYdata
computed std deviation Y set data for current protein

stdDevEPdata

public double stdDevEPdata
computed std deviation EP set data for current protein

cvXdata

public double cvXdata
computed Coefficient of variation all X set data for current protein

cvYdata

public double cvYdata
computed Coefficient of variation all Y set data for current protein

cvEPdata

public double cvEPdata
computed Coefficient of variation all EP set data for current protein

pValue

public float pValue
computed Computed pValue when use the t-Test for current protein

nSamplesPassedMinProteins

public int nSamplesPassedMinProteins
Compute the min # of X&Y or EP set samples passing > S proteins/Sample test

nXsamplesPassedMinProteins

public int nXsamplesPassedMinProteins
Compute the min # of X set samples passing > S proteins/Sample test

nYsamplesPassedMinProteins

public int nYsamplesPassedMinProteins
Compute the min # of Y set samples passing > S proteins/Sample test

nEPsamplesPassedMinProteins

public int nEPsamplesPassedMinProteins
Compute the min # of EP set samples passing > S proteins/Sample test

passedMissingProteins

public boolean passedMissingProteins
Combined flag for both X & Y or EP missing proteins tests

passedMwPIRangeTest

public boolean passedMwPIRangeTest
Flag that tests if (pM.pI,pM.mw) is within the pI and Mw scroller range limits

doingXYscatterPlotFlag

public boolean doingXYscatterPlotFlag
set if doing display X vs Y in ratio mode

passedDisplayXYRangeTest

public boolean passedDisplayXYRangeTest
set if doing display X vs Y in ratio mode AND (exprX,exprY) in X and Y range of scatterplot

passedSavedClusterCtr

public int passedSavedClusterCtr
counter for proteins in saved Cluster set of proteins

passedSavedFilterCtr

public int passedSavedFilterCtr
counter for proteins in saved Filter set of proteins

passedMwPIRangeCtr

public int passedMwPIRangeCtr
counter for test of (pM.pI,pM.mw) within pI and Mw scroller range limits

passedXYmissingProteinsCtr

public int passedXYmissingProteinsCtr
counter for missing X and Y set protein test

passedEPminSamplesCtr

public int passedEPminSamplesCtr
counters for missing samples protein test for EP set

passedTtestCtr

public int passedTtestCtr
counters for t-test

passedKStestCtr

public int passedKStestCtr
counters for KS-test

passedMaxMWsizeCtr

public int passedMaxMWsizeCtr
counters max MW size counter

passedNsamplesCtr

public int passedNsamplesCtr
counters N samples counter

passedRatioCtr

public int passedRatioCtr
counters Ratio counter

passedExprCtr

public int passedExprCtr
counters Expr counter

passedFamilyCtr

public int passedFamilyCtr
counters Family counter

passedTissueCtr

public int passedTissueCtr
counters Tissue counter

passedFilterCtr

public int passedFilterCtr
counters Filter counter
Constructor Detail

Filter

public Filter(ProtPlot prp)
Filter() - constructor
Parameters:
prp - is instance of ProtPlot
Method Detail

resetFilterCounters

public int resetFilterCounters()
resetFilterCounters() - reset the filter counters
Returns:
# proteins passing S test

checkSamplesFilter

public boolean checkSamplesFilter(int mPid)
checkSamplesFilter() - check Proteins (pX,pY) to see if it passed filter. If no data exists for samples, (expr==0.0) then return false.
 The data filter takes the intersection of the following filters.
 By definition, a filter that is disabled is true so the intersection
 ignores it. Note the Ratio test and the Expression test are mutually
 exclusive.
   passed Ratio X/Y range (based on ratio, ratio-range and 
          inside/outside flag) test
   passed Expression range test
   passed t-test for X and Y sets
   passed minimum number of samples for both X and Y set if used 
          else EP list test
   passed Tissue membership test
   passed Family membership test

Parameters:
mPid - is the master protein id to check
dataMustExistFlag - makes sure that data exists for ratio data (X or Y or both X and Y exists)
Returns:
true value if passed the filter in various ways

getSampleListBySubstring

public java.lang.String[] getSampleListBySubstring(java.lang.String sMatch)
getSampleListBySubstring() - return a list of sample names by substring matching
Parameters:
sMatch - is the substring to match (e.g " normal" or " cancer")
Returns:
list of sample names if there is a substring match else null

allocLocalXYdataArrays

public boolean allocLocalXYdataArrays(boolean allocAnywaysFlag)
allocLocalXYdataArrays() - setup or change X, Y, or EP sets array allocations used by Filter
Parameters:
allocAnywaysFlag - to the X and Y sample index lists
Returns:
true if succeed

allocLocalEPdataArrays

public boolean allocLocalEPdataArrays(boolean allocAnywaysFlag)
allocLocalEPdataArrays() - setup or change EP sets array allocations used by Filter
Parameters:
allocAnywaysFlag - to recalculate the EP sample index list
Returns:
true if succeed

test_XYsets_t_Test

public boolean test_XYsets_t_Test(int mPid,
                                  float pValueThr,
                                  boolean getDataFlag)
test_XYsets_t_Test() - test if X and Y sets pass the t-Test with a pValue better than pValueThr. If there are not enough members of the X or Y sets, then return true.
Parameters:
mPid - is the Master Protein Id to test
pValueThr - is the p-value threshold to use
getDataFlag - get the data, else assume that precalculated
Returns:
true if succeed, else false if a problem.
See Also:
StatisticsPRP.calcTandPvalues(int, int, double, double, double, double)

test_XYsets_KS_Test

public boolean test_XYsets_KS_Test(int mPid,
                                   float pValueThr,
                                   boolean getDataFlag)
test_XYsets_KS_Test() - test if X and Y sets pass Kolmogorov-Smirnov Test with a pValue better than pValueThr. If there are not enough members of the X or Y sets, then return true.
Parameters:
mPid - is the Master Protein Id to test
pValueThr - is the p-value threshold to use
getDataFlag - get the data, else assume that precalculated
Returns:
true if succeed, else false if a problem.
See Also:
StatisticsPRP.calcTandPvalues(int, int, double, double, double, double)

setupLocalXYsetData

boolean setupLocalXYsetData(int mPid,
                            boolean allocAnywaysFlag)
setupLocalXYsetData() - setup local X, and Y sets data arrays for pM
Parameters:
mPid - is the Master Protein ID if not -1
allocAnywaysFlag - allocate anyways even if < 2 samples for X or Y set
Returns:
false if an illegal mPid
See Also:
allocLocalXYdataArrays(boolean)

getExtraFilterData

java.lang.String getExtraFilterData(int mPid)
getExtraFilterData() - get extra Filter data from t-Test, KS-test etc. for mid if in XY sets mode.
Parameters:
mid - for protein to get extra info
Returns:
extra info if any, else ""

setupLocalEPsetData

boolean setupLocalEPsetData(int mPid,
                            boolean allocAnywaysFlag)
setupLocalEPsetData() - setup local EP sets data arrays for pM
Parameters:
mPid - is the Master Protein ID if not -1
allocAnywaysFlag - allocate anyways even if < 2 samples for RP set
Returns:
false if an illegal mPid
See Also:
allocLocalEPdataArrays(boolean)

calcXYstatistics

boolean calcXYstatistics()
calcXYstatistics() - compute primary statistics for X and Y sets for current x(y)Data[]. Use double precision arithmetic and the shortcut method for computing variance. It computes:
    (mnXdata, mnYdata)        -  mean intensity X, Y
    (cvXdata,cvYdata)         -  Coeff. of variation all X, Y
    (stdDevXdata,stdDevYdata) - std deviation intensity X, Y
Parameters:
allowAnySizeNflag - allow any size nX or NY
Returns:
false if any problems

calcEPstatistics

boolean calcEPstatistics()
calcEPstatistics() - compute primary statistics for EP set data in epData[0:nEP-1]. Use double precision arithmetic and the shortcut method for computing variance. It computes:
    mnEPdata         -  mean intensity of epData[0:nEP-1].
    cvEPdata         -  Coeff. of variation all data epData[0:nEP-1].
    stdDevEPdata     - std deviation of epData[0:nEP-1].
Returns:
false if any problems

setupXYlabels

public boolean setupXYlabels()
setupXYlabels() - set the XY labels based on samples selected. This sets (xLabel, yLabel) may be used for various displays.
Returns:
false if any problems.
See Also:
UtilPRP.cvf2s(float, int)

saveFilter

public void saveFilter()
saveFilter() - save current Filtered proteins into prp.savedFilterMPIDs[]