-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHKgenesRT.R
More file actions
72 lines (37 loc) · 1.98 KB
/
HKgenesRT.R
File metadata and controls
72 lines (37 loc) · 1.98 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##HKgenesRT.R ##
# This function creates a rank table for the output of the selectHKgenese.
# Code coppied/modified from Package SLqPCR to include other two methods for selecting housekeeping genes.
##############################################
## Author Information ##
# * Author: E.Frolli
# * Orginization: Univeristy of Texas Marine Science Institute
# * Contact: frolli.erin@utexas.edu
# * Date: 01 Feb 2016
## Previouse Author Informaion ##
# * Author: Dr. Matthias Kohl
# * Orginization: SIRS-Lab GmbH
# * Contact: kohl@sirs-lab.com
##############################################
## References ##
# 1). Jo Vandesompele, Katleen De Preter, Filip Pattyn et al. (2002). Accurate normalization of real-time quantitative RT-PCR data
# by geometric averaging of multiple internal control genes. Genome Biology 2002. 3(7):research0034.1-0034.11.
# http://genomebiology.com/2002/3/7/research/0034/
##############################################
## Imputs into the function ##
# * res.Data * : (n X 3 lists) Matrix of nested lists containing results of selectHKgenes function
# * SampleType * : (string) method name to compute most stable genes default = Vandesompele
##############################################
## Outputs of the function ##
# * rankData * : (n X m) gene rank table.
##############################################
## The Code ##
HKgenesRT <- function (res.Data, SampleType){
st = t(data.frame(unique(SampleType))) # get the names of the samples
L = length(res.Data[[1]][[1]]) # how many items were ranked
rankData = data.frame(c(1,1:(L-1))) # start the RT vector with the ranking order
for(i in 1:length(st)){
rankData = data.frame(rankData,res.Data[[i]][[1]]) #pull out the ranking informaion - put them in seprate columns
}
names(rankData) <- c("rank",st) # lable the columns.
return(rankData)
}