trinhan / crc-ihc-classification

0 stars 3 forks source link

Questions about "MedScale" function #1

Closed SeYoungKim closed 6 years ago

SeYoungKim commented 6 years ago

Hello!

I'm now trying to run the classifier code in the repo.

And I got this error

Error in MedScale(AMCdata.train$data[, -grep("Im", colnames(AMCdata.train$data))]) : could not find function "MedScale"

As you wrote in [Supplementary Information for "Practical and robust identification of molecular subtypes in colorectal cancer"], I tried with these libraries

library(gsubfn) library(randomForest) library(e1071) library(nnet) library(rpart) library(survival) library(RColorBrewer) library(preprocessCore) library(ggplot2) library(reshape2) library(MASS) library(scatterplot3d)

source("classifier_functions.R")

But it didn't work... And also I googled it but couldn't find anything regarding MedScale function...

What library or source do I have to import to my source code?

Any help will be appreciated.

Thank you

trinhan commented 6 years ago

Sorry, I forgot to copy the function into the classifier folder. This should be used:

MedScale=function(data){ xmin=apply(data, 2, function(x) quantile(x, 0.025, na.rm=T)) xmax=apply(data, 2, function(x) quantile(x, 0.975, na.rm=T)) temp=sapply(1:ncol(data), function(x) (data[ ,x]-xmin[x])/xmax[x], simplify=T) temp[temp>1.5]=1.5 rownames(temp)=rownames(data) colnames(temp)=colnames(data) temp }

SeYoungKim commented 6 years ago

Thank you It works!