# NOT RUN {
# load st library
library("st")
# prostate data set
data(singh2002)
X = singh2002$x
L = singh2002$y
dim(X) # 102 6033
length(L) # 102
# compute correlation-predicted t-score for various choices
# of smoothing span
# }
# NOT RUN {
score1 = lait.stat(X, L, f=0.1)
idx1 = order(abs(score1), decreasing=TRUE)
idx1[1:10]
# 1072 297 1130 4495 4523 4041 1089 955 373 3848
score3 = lait.stat(X, L, f=0.3)
idx3 = order(abs(score3), decreasing=TRUE)
idx3[1:10]
# 1130 962 1688 1223 583 1118 955 297 698 1219
score5 = lait.stat(X, L, f=0.5)
idx5 = order(abs(score5), decreasing=TRUE)
idx5[1:10]
# 698 962 1223 1219 739 1172 583 694 3785 3370
score7 = lait.stat(X, L, f=0.7)
idx7 = order(abs(score7), decreasing=TRUE)
idx7[1:10]
# 698 739 1219 962 3785 725 694 735 3370 1172
# pick the one with highest correlation to Student t score
t = studentt.stat(X, L)
cor(t, score1, method="spearman") # 0.4265832
cor(t, score3, method="spearman") # 0.471273
cor(t, score5, method="spearman") # 0.4750564
cor(t, score7, method="spearman") # 0.4666669
# focus on gene 19
t = studentt.stat(X, L)
R = cor(centroids(X, L, lambda.var=0, centered.data=TRUE,
verbose=TRUE)$centered.data)
lai.tscore(gene=19, t, R, f=0.5, plot=TRUE)
# }
Run the code above in your browser using DataLab