CalcGene: Calculate HUM value

Description Usage Arguments Details Value Errors References See Also Examples

Description

This is the auxiliary function of the Biocomb package. It computes a HUM value for individual feature and returns a “List” object, consisting of HUM value and the best permutation of class labels in “seq” vector. This “seq” vector can be passed to the function CalculateHUM_ROC.

Usage

1
CalcGene(s_data, seqAll, prodValue,thresholds)

Arguments

s_data

a list, which contains the vectors of sorted feature values for individual class labels.

seqAll

a numeric matrix of all the permutations of the class labels, where each row corresponds to individual permutation vector.

prodValue

a numeric value, which is the product of the sizes of feature vectors, corresponding to analized class labels.

thresholds

a numeric vector, containing the values of thresholds for calculating ROC curve coordinates.

Details

This function's main job is to compute the maximal HUM value between the all possible permutations of class labels for individual feature, selected for analysis. See the “Value” section to this page for more details.

Value

The data must be provided without missing values in order to process. A returned list consists of the following fields:

HUM

a list of HUM values for the specified number of analyzed features

seq

a list of vectors, each containing the sequence of class labels

Errors

If there exists NA values for features or class labels no HUM value can be calculated and an error is triggered with message “Values are missing”.

References

Li, J. and Fine, J. P. (2008): ROC Analysis with Multiple Tests and Multiple Classes: methodology and its application in microarray studies.Biostatistics. 9 (3): 566-576.

See Also

CalculateHUM_Ex, CalculateHUM_ROC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
data(leukemia72)
# Basic example
# class label must be factor
leukemia72[,ncol(leukemia72)]<-as.factor(leukemia72[,ncol(leukemia72)])

xdata=leukemia72
indexF=3
indexClass=ncol(xdata)
label=levels(xdata[,indexClass])

indexLabel=label[1:2]

indexL=NULL
for(i in 1:length(indexLabel))
{
  indexL=c(indexL,which(label==indexLabel[i]))
}

indexEach=NULL
indexUnion=NULL
for(i in 1:length(label))
{
  vrem=which(xdata[,indexClass]==label[i])
  indexEach=c(indexEach,list(vrem))
  if(length(intersect(label[i],indexLabel))==1)
  indexUnion=union(indexUnion,vrem)
}

s_data=NULL
dataV=xdata[,indexF]
prodValue=1

for (j in 1:length(indexLabel))
{
  vrem=sort(dataV[indexEach[[indexL[j]]]])
  s_data=c(s_data,list(vrem))
  prodValue = prodValue*length(vrem)
}

len=length(indexLabel)
seq=permutations(len,len,1:len)

#claculate the threshold values
thresholds <- sort(unique(dataV[indexUnion]))
thresholds=(c(-Inf, thresholds) + c(thresholds, +Inf))/2

out=CalcGene(s_data,seq,prodValue,thresholds)

Biocomb documentation built on May 1, 2019, 9:38 p.m.