#
-def RchdTxt(DicoPath, RscriptPath, mincl, classif_mode, nbt = 9, libsvdc = False, libsvdc_path = None, R_max_mem = False):
+def RchdTxt(DicoPath, RscriptPath, mincl, classif_mode, nbt = 9, svdmethod = 'svdR', libsvdc = False, libsvdc_path = None, R_max_mem = False, mode_patate = False):
txt = """
source("%s")
source("%s")
txt += """
nbt <- %i
""" % nbt
- if libsvdc :
+ if svdmethod == 'svdlibc' and libsvdc :
txt += """
- libsvdc <- TRUE
+ svd.method <- 'svdlibc'
libsvdc.path <- "%s"
""" % ffr(libsvdc_path)
+ elif svdmethod == 'irlba' :
+ txt += """
+ library(irlba)
+ svd.method <- 'irlba'
+ libsvdc.path <- NULL
+ """
else :
txt += """
- libsvdc <- FALSE
+ svd.method = 'svdR'
libsvdc.path <- NULL
"""
-
+ if mode_patate :
+ txt += """
+ mode.patate = TRUE
+ """
+ else :
+ txt += """
+ mode.patate = FALSE
+ """
txt +="""
library(Matrix)
data1 <- readMM("%s")
data2 <- as(data2, "dgCMatrix")
row.names(data2) <- 1:nrow(data2)
""" % DicoPath['TableUc2']
- #log.info('ATTENTION ############# MODEPATATE ####################')
txt += """
- chd1<-CHD(data1, x = nbt, mode.patate = FALSE, libsvdc = libsvdc, libsvdc.path = libsvdc.path)
+ chd1<-CHD(data1, x = nbt, mode.patate = mode.patate, svd.method = svd.method, libsvdc.path = libsvdc.path)
"""
if classif_mode == 0:
txt += """
- chd2<-CHD(data2, x = nbt, libsvdc = libsvdc, libsvdc.path = libsvdc.path)
+ chd2<-CHD(data2, x = nbt, mode.patate = mode.patate, svd.method = svd.method, libsvdc.path = libsvdc.path)
"""
else:
txt += """
chd.result<-Rchdquest("%s","%s","%s", nbt = nbt, mincl = mincl)
n1 <- chd.result$n1
classeuce1 <- chd.result$cuce1
- """ % (DicoPath['Act01'], DicoPath['listeuce1'], DicoPath['uce'])
+ """ % (DicoPath['mat01'], DicoPath['listeuce1'], DicoPath['uce'])
txt += """
tree_tot1 <- make_tree_tot(chd.result$chd)
if self.param['tchi'] : tchi = 'TRUE'
else : tchi = 'FALSE'
+ if self.param['svg'] : svg = 'TRUE'
+ else : svg = 'FALSE'
+
with open(self.RscriptsPath['afc_graph'], 'r') as f:
txt = f.read()
tchi,\
self.param['tchi_min'],\
self.param['tchi_max'],\
- ffr(os.path.dirname(self.fileout)))
+ ffr(os.path.dirname(self.fileout)),\
+ svg)
return scripts
def print_simi3d(self):
""" % (self.pathout['mat01.csv'], self.pathout['actives.csv'], self.pathout['selected.csv'])
txt += """
dm <-readMM(dm.path)
- cn <- read.table(cn.path, sep=';', quote='"')
+ cn <- read.table(cn.path, sep='\t', quote='"')
colnames(dm) <- cn[,1]
sel.col <- read.csv2(selected.col)
dm <- dm[, sel.col[,1] + 1]