O2Plib.db.CSD
Class CSDnorm

java.lang.Object
  extended by O2Plib.db.CSD.CSDglb
      extended by O2Plib.db.CSD.CSDnorm

public class CSDnorm
extends CSDglb

Class CSDnorm contains a normalization for a sample for the Composite Samples Database (CSD). This is on a per-sample basis.


 [TODO] make dynamic using hash tables instead of fixed index values.
 [TODO] add capability for dynamic Java plugins and RLO R-plugins
 to do the normalization.
 This file is derived from Open2Dprot, MAExplorer and GELLAB-II code.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. 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. This notice must be included with the code. The Open2Dprot Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.

Version:
$Date: 2005/12/09 15:04:26 $ $Revision: 1.10 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 float bLsqTerm
          Least Square normalization intercept: bj to estimate djR'=mj*d'j+bj.
 float corCoefLsqTerm
          Correlation coefficient when computing Least Square normalization terms:
 int curNormMethod
          Current normalization method set by NORM_xxx
 DbSample dbSample
           
 boolean didLeastSqCalibFlag
          true if EVER did a SET LEAST SQUARES calibration
 boolean didRatioListCalibFlag
          true if EVER did a SET RATIO LIST calibration
 float lsqMcoef
          Least Square normalization slope: mj to estimate djR'=mj*d'j+bj
 float[] meanDprimeRatioMeanSpots
          Median of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization
 float[] medianDprimeRatioMeanSpots
          Median of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization
 int modeDensity
          [TODO-REFACTOR] Density mode String 'A P R L C'
 java.lang.String name
          Name of the normalization
static int NORM_LOESS
          Normalization by LOESS
static int NORM_LSQ
          Normalization by linear least square fit
static int NORM_NONE
          Normalization - none.
static int NORM_OTHER
          Normalization by an other (possible plugin) method
static int NORM_PCT_TOT_DENS
          Normalization by percent of total density'
static int NORM_RATO_MEANS
          Normalization by ratio means
static int NORM_RATO_MEDIANS
          Normalization by ratio means
static java.util.Hashtable normHash
          hashTable for normalization lookup
 int[] normLSQspotNbrs
          [0:nSpotsLsq-1] Ratio-mean spot #'s of spots in ratioMeans for normalization.
 DbSpot[] normLSQspots
          [0:nSpotsLsq-1] list of spots used in least-square fit norm.
 int nRatioMeanSpots
          #'s of spots in ratioMean normalization.
 int nSpotsLsq
          Number of spots used in computing Least Square normalization terms
 java.lang.String otherNormMethod
           
 float ratioMean
          Slope mj OR Tot D'/sample's ratio list.
 int[] ratioMeanSpotNbrs
          [0:nRatioMeanSpots-1] Ratio-mean spot #'s of spots in ratioMeans for normalization.
 CSDRspot[] ratioMeanSpots
          [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization
 int reorderModeDens
          [TODO-REFACTOR]value of modeDensity at time of REORDER
 float[] sumDprimeRatioMeanSpots
          Sum of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization
 float totDensPrime
          Total D' (density corrected for background) for a sample for the percent total density normalization.
 float totNbrSpots
          # of spots in this sample used in Percent total density normalization.
static java.lang.String VERSION
          Version for this module
 
Fields inherited from class O2Plib.db.CSD.CSDglb
allSetSamples, AP, batchDir, BF_IS_LMS_SPOT, BF_ISVALIDSPOT, cacheDir, cdbIsOpenFlag, condListDB, CONSOLE_FLAG, CP, CSD_DBTYPE_CACHE, CSD_DBTYPE_RDBMS, CSD_DBTYPE_TAB_DELIM, CSD_DBTYPE_UNKNOWN, CSD_DBTYPE_XML, csdAcc, csdCache, csdCacheFile, csdDatabaseFile, csdFormatMode, csdIO, csdLMS, csdName, csdRdbmsFile, csdSizes, csdTabDelimFile, csdTotals, CSDversion, csdXMLfile, dataFiltersListDB, dateCreation, dateLastSession, dbRsample, dbSamplesListDB, dbSPFlistsDB, dBugLMsetNbr, dBugPspotNbr, dBugRspotNbr, dBugSampleNbr, EP, epSetSamples, exprListsDB, GS, LM, MAX_NODE_SAFTY_FACTOR, mrl, nbrTimesInitialized, nCondListDB, nDataFiltersDB, needToSaveCSDdataFlag, NEVER, nExprListsDB, nOclDB, nodeSaftyFactor, normListDB, nRmapsDB, nRspotListsDB, nSamplesDB, nSPFfilesUsedDB, nSPFlistsDB, oclListDB, oclNameDB, PP, ppxDir, projDir, rdbmsDir, rMapsListDB, RSAMPLE, rspotListsDB, SAMPLE, sampleNamesDB, sampleNamesUsedDB, SP, tmpDir, US, useInternalDTDflag, wrkAnotation, wrkCalib, wrkERspot, wrkExpr, wrkSetSamples, xmlDir, xSetSamples, ySetSamples
 
Constructor Summary
CSDnorm()
          CSDnorm() - Constructor for new CSDnorm.
CSDnorm(java.lang.String name)
          CSDnorm() - Constructor for new CSDnorm.
 
Method Summary
static java.lang.String getTabDelimitedFields()
          getTabDelimitedFields() - get a string representation of the tab-delimited data fields
 float normalizeData(CSDRspot rspot, float data, int idxSample)
          normalizeData() - normalize data by this normalization.
 float normalizeData(float data, int idxSample)
          normalizeData() - normalize data by this normalization.
 void set_lsq_norm_calib()
          set_lsq_norm_calib() - If least squares mode 'L' is used where we compute D''j=mj*D'i+bi, then store the slopes 'mj' in lsqMcoef[j].
 boolean set_ratio_list(CSDRspot[] rSpotList)
          set_ratio_list() - Get a list of Rspots which will serve as a basis to normalize spots in calculations and reporting for ratio-list normalization mode.
 java.lang.String toString()
          toString() - get a pretty-print string representation of this instance [TODO] add additional state...
 java.lang.String toTabDelimitedData()
          toTabDelimitedData() - get a string representation of this instance as tab-delimited data values
 java.lang.String toXML()
          toXML() - get a string representation of this instance as XML [TODO]
 
Methods inherited from class O2Plib.db.CSD.CSDglb
initGlb
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version for this module

See Also:
Constant Field Values

NORM_NONE

public static final int NORM_NONE
Normalization - none. This is the raw density

See Also:
Constant Field Values

NORM_PCT_TOT_DENS

public static final int NORM_PCT_TOT_DENS
Normalization by percent of total density'

See Also:
Constant Field Values

NORM_RATO_MEANS

public static final int NORM_RATO_MEANS
Normalization by ratio means

See Also:
Constant Field Values

NORM_RATO_MEDIANS

public static final int NORM_RATO_MEDIANS
Normalization by ratio means

See Also:
Constant Field Values

NORM_LSQ

public static final int NORM_LSQ
Normalization by linear least square fit

See Also:
Constant Field Values

NORM_LOESS

public static final int NORM_LOESS
Normalization by LOESS

See Also:
Constant Field Values

NORM_OTHER

public static final int NORM_OTHER
Normalization by an other (possible plugin) method

See Also:
Constant Field Values

otherNormMethod

public java.lang.String otherNormMethod

normHash

public static java.util.Hashtable normHash
hashTable for normalization lookup


reorderModeDens

public int reorderModeDens
[TODO-REFACTOR]value of modeDensity at time of REORDER


modeDensity

public int modeDensity
[TODO-REFACTOR] Density mode String 'A P R L C'


didRatioListCalibFlag

public boolean didRatioListCalibFlag
true if EVER did a SET RATIO LIST calibration


didLeastSqCalibFlag

public boolean didLeastSqCalibFlag
true if EVER did a SET LEAST SQUARES calibration


dbSample

public DbSample dbSample

name

public java.lang.String name
Name of the normalization


curNormMethod

public int curNormMethod
Current normalization method set by NORM_xxx


totNbrSpots

public float totNbrSpots
# of spots in this sample used in Percent total density normalization.


totDensPrime

public float totDensPrime
Total D' (density corrected for background) for a sample for the percent total density normalization.


nRatioMeanSpots

public int nRatioMeanSpots
#'s of spots in ratioMean normalization.


ratioMeanSpotNbrs

public int[] ratioMeanSpotNbrs
[0:nRatioMeanSpots-1] Ratio-mean spot #'s of spots in ratioMeans for normalization.


ratioMeanSpots

public CSDRspot[] ratioMeanSpots
[0:nRatioMeanSpots-1] list of spots used in ratio mean normalization


sumDprimeRatioMeanSpots

public float[] sumDprimeRatioMeanSpots
Sum of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization


meanDprimeRatioMeanSpots

public float[] meanDprimeRatioMeanSpots
Median of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization


medianDprimeRatioMeanSpots

public float[] medianDprimeRatioMeanSpots
Median of the D' of the Rspots in the [0:nRatioMeanSpots-1] list of spots used in ratio mean normalization


ratioMean

public float ratioMean
Slope mj OR Tot D'/sample's ratio list.


nSpotsLsq

public int nSpotsLsq
Number of spots used in computing Least Square normalization terms


normLSQspotNbrs

public int[] normLSQspotNbrs
[0:nSpotsLsq-1] Ratio-mean spot #'s of spots in ratioMeans for normalization.


normLSQspots

public DbSpot[] normLSQspots
[0:nSpotsLsq-1] list of spots used in least-square fit norm.


lsqMcoef

public float lsqMcoef
Least Square normalization slope: mj to estimate djR'=mj*d'j+bj


bLsqTerm

public float bLsqTerm
Least Square normalization intercept: bj to estimate djR'=mj*d'j+bj.


corCoefLsqTerm

public float corCoefLsqTerm
Correlation coefficient when computing Least Square normalization terms:

Constructor Detail

CSDnorm

public CSDnorm()
CSDnorm() - Constructor for new CSDnorm.


CSDnorm

public CSDnorm(java.lang.String name)
CSDnorm() - Constructor for new CSDnorm.

Parameters:
name - of the normalization instance
Method Detail

normalizeData

public float normalizeData(CSDRspot rspot,
                           float data,
                           int idxSample)
normalizeData() - normalize data by this normalization. This version of the method allows for taking the particular Rspot into account. This means there could be separate normalization methods for each Rspot that may be suitable for spots that have different titration curves. [TODO]

Parameters:
rspot - is Rspot set if needed.
data - to normalize
idxSample - is the index of the sample for this spot
Returns:
normalized value if succeed, data value if not.

normalizeData

public float normalizeData(float data,
                           int idxSample)
normalizeData() - normalize data by this normalization. [TODO]

Parameters:
data - to normalize
idxSample - is the index of the sample for this spot
Returns:
normalized value if succeed, data value if not.

set_ratio_list

public boolean set_ratio_list(CSDRspot[] rSpotList)
set_ratio_list() - Get a list of Rspots which will serve as a basis to normalize spots in calculations and reporting for ratio-list normalization mode. The sum of D' for each sample i is computed in ratioMean[i] while the names of these spots are in ratioList[0:nbrRatioSpots-1]. The sum is then divided by the number of samples nn[i] to give us a MEAN normalization ratioMean.

NOTE: if samples are missing from the WORKING SET, then their SUM D' value defaults to 1.0. If the set of spots is specified explicitly then it is also put into the RSL.

[TODO - REFACTOR]


set_lsq_norm_calib

public void set_lsq_norm_calib()
set_lsq_norm_calib() - If least squares mode 'L' is used where we compute D''j=mj*D'i+bi, then store the slopes 'mj' in lsqMcoef[j]. If we have calibrated it, then set the didLeastSqCalibFlag. NOTE: if gels are missing from the WORKING SET of samples, their LSQ parameters(m,b,r,n) default to (1.0, 0.0, 0.0, 0).

[TODO - REFACTOR]


toString

public java.lang.String toString()
toString() - get a pretty-print string representation of this instance [TODO] add additional state...

Overrides:
toString in class java.lang.Object
Returns:
string representation of this instance

getTabDelimitedFields

public static java.lang.String getTabDelimitedFields()
getTabDelimitedFields() - get a string representation of the tab-delimited data fields

Returns:
string representation of this instance, no "\n"

toTabDelimitedData

public java.lang.String toTabDelimitedData()
toTabDelimitedData() - get a string representation of this instance as tab-delimited data values

Returns:
string representation of this instance, no "\n"

toXML

public java.lang.String toXML()
toXML() - get a string representation of this instance as XML [TODO]

Returns:
string representation of this instance