Commit e3975fda authored by Simon CHEVOLLEAU's avatar Simon CHEVOLLEAU 💻
Browse files

rescaleWithMatrix : Check if genes are the same between two datasets

parent a3b3c28f
......@@ -308,6 +308,16 @@ rescaleWithMatrix <- function(rescale_with, to_be_rescaled){
min_mat <- apply(rescale_with, 1, min)
max_mat <- apply(rescale_with, 1, max)
to_be_rescaled <- as.matrix(to_be_rescaled)
# GENES SHARED BETWEEN DATASETS
# warning(paste0("These genes are present in your dataset to be rescaled but not in your dataset for rescaling : ", rownames(rescale_with)[!( rownames(rescale_with) %in% rownames(to_be_rescaled) )]), collapse = " ")
# warning(paste0("These genes are present in your dataset for rescaling but not in your dataset to be rescaled : ", rownames(to_be_rescaled)[!( rownames(to_be_rescaled) %in% rownames(rescale_with) )]), collapse = " ")
genes <- intersect(rownames(rescale_with), rownames(to_be_rescaled))
rescale_with <- rescale_with[genes,]
to_be_rescaled <- to_be_rescaled[genes,]
for (gene in rownames(rescale_with))
to_be_rescaled[gene,] <- rescale(to_be_rescaled[gene,], to=c(min_mat[gene], max_mat[gene]))
return(to_be_rescaled)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment