# NOT RUN {
#### load the RA data
data(peptide_data)
#### visualize the data
## each row is a peptide with unique peptide sequence
## each column is a subject with information on group and pseudo ID
colnames(peptide_data)
# }
# NOT RUN {
## z-score for peptide
get_zscore = function(x){
n = length(x)
t = t.test(x[1:(n/2)], x[(n/2 + 1):n], var.equal = TRUE)$statistic
return(qnorm(pt(t, df = n-2)))
}
z = apply(peptide_data, 1, get_zscore)
## visualize the density of z-score
hist(z, probability = TRUE, 100, ylim = c(0,0.4), col = "blue")
lines(density(rnorm(10^5)), lwd =2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab