Class GeneGeneDist

java.lang.Object
  |
  +--GeneGeneDist

class GeneGeneDist
extends java.lang.Object


Field Summary
private static Config cfg
          link to global Config instance
private static float[] cv1Tmp
          temporary v1 vector[0:nEP-1] for computations
private static float[] cv1TmpEP
          temporary EP v1 vector[0:nEP-1] for computations
private static float[] cv2Tmp
          temporary v2 vector[0:nEP-1] for computations
private static float[] cv2TmpEP
          temporary EP v2 vector[0:nEP-1] for computations
(package private)  GeneList dataCL
          Gene list to generate geneEPvector
private static FileIO fio
          link to global FileIO instance
(package private)  float[][] geneEPvector
          normalized quantitation vector for all genes [0:nClist-1][0:nEP-1] also [0:nObj-1][0:nEP-1]
private  SampleSets hps
          link to global SampleSets instance
private static MAExplorer mae
          link to global MAExplorer instance
(package private)  int nEP
          size of EP vector
(package private)  int nMlist
          # of genes
 
Constructor Summary
(package private) GeneGeneDist(MAExplorer mae)
          GeneGeneDist() - constructor
 
Method Summary
private static int addr1D(int x, int y)
          addr1D() - lookup lower-diagonal addr1D(x,y) using [y' + x'*(x'+1)/2] address
(package private)  void calcGeneGeneDists(float[] ccDist1D, int nClist, int nEP)
          calcGeneGeneDists() - compute the gene-gene Euclidean distances for all dataCL genes in the lower diagonal matrix.
(package private)  float[][] calcNormGeneVectors(GeneList dataCL, int nClist)
          calcNormGeneVectors() - compute HP-E intensity vector for dataCL.mList[].
(package private)  void cleanup()
          cleanup() - cleanup global static allocated variables in this class.
(package private)  float clusterDistance(Gene geneI, Gene geneJ)
          clusterDistance() - compute genes(I,J) cluster distance for HP-E samples.
(package private) static int findGeneWithLeastSumDistances(float[] ccDist1D, int nClist)
          findGeneWithLeastSumDistances() - find gene with minimum cluster distance toall other genes.
(package private)  float geneGeneDist(float[] geneEPvector1, float[] geneEPvector2, int nEP)
          geneGeneDist() - compute the gene-gene distance between two gene vectors.
private  void makeTmpVectors(int n)
          makeTmpVectors() - create temp vectors if needed.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mae

private static MAExplorer mae
link to global MAExplorer instance

fio

private static FileIO fio
link to global FileIO instance

cfg

private static Config cfg
link to global Config instance

hps

private SampleSets hps
link to global SampleSets instance

dataCL

GeneList dataCL
Gene list to generate geneEPvector

nMlist

int nMlist
# of genes

nEP

int nEP
size of EP vector

cv1Tmp

private static float[] cv1Tmp
temporary v1 vector[0:nEP-1] for computations

cv2Tmp

private static float[] cv2Tmp
temporary v2 vector[0:nEP-1] for computations

cv1TmpEP

private static float[] cv1TmpEP
temporary EP v1 vector[0:nEP-1] for computations

cv2TmpEP

private static float[] cv2TmpEP
temporary EP v2 vector[0:nEP-1] for computations

geneEPvector

float[][] geneEPvector
normalized quantitation vector for all genes [0:nClist-1][0:nEP-1] also [0:nObj-1][0:nEP-1]
Constructor Detail

GeneGeneDist

GeneGeneDist(MAExplorer mae)
GeneGeneDist() - constructor
Parameters:
mae - is instance of MAExplorer
Method Detail

makeTmpVectors

private void makeTmpVectors(int n)
makeTmpVectors() - create temp vectors if needed.

calcNormGeneVectors

float[][] calcNormGeneVectors(GeneList dataCL,
                              int nClist)
calcNormGeneVectors() - compute HP-E intensity vector for dataCL.mList[]. Normalize by the first entry of each vector.
Parameters:
dataCL - is the gene list to use
nClist - is the # of genes in the gene list
Returns:
a dynamic array[nClist][nEP].
See Also:
MaHybridSample.getDataByGID(int, boolean, int), MathMAE.calcPearsonCorrCoef(float[], float[], int, boolean), MathMAE.euclidDist(float[], float[], int, boolean), makeTmpVectors(int)

geneGeneDist

float geneGeneDist(float[] geneEPvector1,
                   float[] geneEPvector2,
                   int nEP)
geneGeneDist() - compute the gene-gene distance between two gene vectors. Note: can either compute the difference with the magnitude either scaled or unscaled Unscaled the data from the current global normalization method. Unscaled is just the distance of the two gebne vectors. Normalized sets the max of each vector to 1.0 before doing the difference. This means we could have two different EPs with the same shape but different magnitudes. They would be picked up by the second, but not the first method.
Parameters:
geneEPvector1 - is the gene vector for gene 1
geneEPvector2 - is the gene vector for gene 2
nEP - is the number of samples if used w/o HP-E list
Returns:
computed cluster distance.

clusterDistance

float clusterDistance(Gene geneI,
                      Gene geneJ)
clusterDistance() - compute genes(I,J) cluster distance for HP-E samples.
Parameters:
geneI - is first gene
geneJ - is 2nd gene
Returns:
computed cluster distance based on global switches.
See Also:
MaHybridSample.getDataByGID(int, boolean, int), geneGeneDist(float[], float[], int), makeTmpVectors(int)

addr1D

private static final int addr1D(int x,
                                int y)
addr1D() - lookup lower-diagonal addr1D(x,y) using [y' + x'*(x'+1)/2] address
 where:
    x' = (x>y) ? x : y,
    y' = (x>y) ? y : x.
Parameters:
x - coordinate
y - coordinate
Returns:
the computed 1D address for the 2D (x,y) address.

calcGeneGeneDists

void calcGeneGeneDists(float[] ccDist1D,
                       int nClist,
                       int nEP)
calcGeneGeneDists() - compute the gene-gene Euclidean distances for all dataCL genes in the lower diagonal matrix. Only need to do the assymetric case Cij (j>i) since Cij == Cji.
Parameters:
ccDist1D - is 1D list emulating 2D list of Cijk distances for sample k
nClist - number of genes to compute
nEP - is the number of samples in ccDist1D list
See Also:
Util.showMsg2(java.lang.String), addr1D(int, int), geneGeneDist(float[], float[], int)

findGeneWithLeastSumDistances

static int findGeneWithLeastSumDistances(float[] ccDist1D,
                                         int nClist)
findGeneWithLeastSumDistances() - find gene with minimum cluster distance toall other genes.
Parameters:
ccDist1D - is 1D list emulating 2D list of Cijk distances for sample k
nClist - number of genes to compute
Returns:
the index or -1 if not found.
See Also:
addr1D(int, int)

cleanup

void cleanup()
cleanup() - cleanup global static allocated variables in this class. If statics are added later to this class, then set them to null here.