nextflow.enable.dsl=2 process CORTO { memory 1.GB container "${params.container_corto}" containerOptions "${params.containerOptions}" publishDir "${params.outdir}/${params.project_name}", mode: 'copy' // debug true // maxForks 1 stageInMode 'copy' input: path TPM path regulon // path TPM_ref // Define output channels output: path "*_metabolome.csv", emit: csv_metabol script: """ #!/usr/bin/Rscript library(corto) library(data.table) TPM <- as.matrix(fread("$TPM"),rownames=1) #TPM_ref <- as.matrix(fread("TPM_ref"),rownames=1) #dollar sign is missing #try normalization; dont use #TPM <- scale(TPM) #TPM_log2 = log2(TPM + 1) load("$regulon") predicted<-mra(TPM, regulon=regulon) #use this if we want to compare patients and reference TPM, data formet output is not csv -> work on data saving if needed #predicted<-mra(TPM, path TPM_ref, regulon=regulon) name = strsplit(strsplit("$TPM", split = "/")[[1]][length(strsplit("$TPM", split = "/")[[1]])], split = "_TPM.csv")[[1]][1] name = paste(name, "_metabolome.csv", sep="") write.csv(predicted, name) """ }