Mercurial > repos > ynewton > matrix_normalization
changeset 2:f3fe0f64fe91 draft
Uploaded
author | ynewton |
---|---|
date | Mon, 17 Dec 2012 15:25:38 -0500 |
parents | 8389b0c211ae |
children | 6e77048d4d88 |
files | normalize.r |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/normalize.r Thu Dec 13 11:19:57 2012 -0500 +++ b/normalize.r Mon Dec 17 15:25:38 2012 -0500 @@ -1,5 +1,7 @@ #!/usr/bin/Rscript +#Yulia Newton, last updated 20121217 v.3 + #usage, options and doc goes here argspec <- c("normalize.r - takes any flat file and normalizes the rows or the columns using various normalizations (median_shift, mean_shift, t_statistic (z-score), exp_fit, normal_fit, weibull_0.5_fit, weibull_1_fit, weibull_1.5_fit, weibull_5_fit). Requires a single header line and a single cloumn of annotation. Usage: @@ -216,6 +218,12 @@ rownames(normals_numeric) <- normals[,1][2:length(normals[,1])] colnames(normals_numeric) <- normals[1,][2:length(normals[1,])] + #select only the intersection of the rows between the two matrices: + normals_numeric <- normals_numeric[rownames(normals_numeric) %in% rownames(data_matrix),] + data_matrix <- data_matrix[rownames(data_matrix) %in% rownames(normals_numeric),] + normals_numeric <- normals_numeric[order(rownames(normals_numeric)),] + data_matrix <- data_matrix[order(rownames(data_matrix)),] + combined_matrix <- cbind(data_matrix, normals_numeric) tumor_indices <- c(1:length(data_matrix[1,])) normals_indices <- c(length(tumor_indices)+1:length(normals_numeric[1,]))