if (FALSE) {
library(MiMIR)
#load the Nightignale metabolomics dataset
metabolic_measures <- read.csv("Nightingale_file_path",header = TRUE, row.names = 1)
# Do the pre-processing steps to the metabolic measures
metabolic_measures<-QCprep_surrogates(as.matrix(metabolic_measures), Nmax_miss=1,Nmax_zero=1)
#load the phenotypic dataset
phenotypes <- read.csv("phenotypes_file_path",header = TRUE, row.names = 1)
#Calculating the binarized surrogates
bin_pheno<-binarize_all_pheno(phenotypes)
#Apply the surrogate models
surrogates<-foreach::foreach(i=MiMIR::phenotypes_names$out_surro, .combine="cbind") %do% {
pred<-apply.fit_surro(as.matrix(metabo_measures),
PARAM_surrogates$models_betas[i,])}
}
Run the code above in your browser using DataLab