self.add('load("%s")' % ffr(val))
def write(self):
- with open(self.scriptout, 'w') as f:
+ with open(self.scriptout, 'w', encoding='utf8') as f:
f.write(self.script)
#
-def RchdTxt(DicoPath, RscriptPath, mincl, classif_mode, nbt = 9, svdmethod = 'svdR', libsvdc = False, libsvdc_path = None, R_max_mem = False, mode_patate = False, nbproc=1):
+def RchdTxt(DicoPath, RscriptPath, mincl, classif_mode, nbt = 9, svdmethod = 'svdR', libsvdc = False, libsvdc_path = None, R_max_mem = False, mode_patate = False, nbproc=10):
txt = """
source("%s")
source("%s")
row.names(data2) <- 1:nrow(data2)
""" % ffr(DicoPath['TableUc2'])
txt += """
- log1 <- "%s"
+ #log1 <- "%s"
#print('FIXME : source newCHD')
#source('/home/pierre/workspace/iramuteq/Rscripts/newCHD.R')
#nbproc <- %s
txt += """
#save.image(file="%s")
""" % (ffr(DicoPath['RData']))
- fileout = open(DicoPath['Rchdtxt'], 'w')
+ fileout = open(DicoPath['Rchdtxt'], 'w', encoding='utf8')
fileout.write(txt)
fileout.close()
txt += """
save.image(file="%s")
""" % DicoPath['RData']
- fileout = open(DicoPath['Rchdtxt'], 'w')
+ fileout = open(DicoPath['Rchdtxt'], 'w', encoding='utf8')
fileout.write(txt)
fileout.close()
txt += """
save.image(file="%s")
""" % ffr(DicoPath['RData'])
- fileout = open(DicoPath['Rchdquest'], 'w')
+ fileout = open(DicoPath['Rchdquest'], 'w', encoding='utf8')
fileout.write(txt)
fileout.close()
rm(tablesqrpet)
save.image(file="%s")
""" % ffr(DictChdTxtOut['RData'])
- file = open(DictChdTxtOut['RTxtProfGraph'], 'w')
+ file = open(DictChdTxtOut['RTxtProfGraph'], 'w', encoding='utf8')
file.write(txt)
file.close()
else:
nodesfile = 'NULL'
edgesfile = 'NULL'
- with open(self.RscriptsPath['afc_graph'], 'r') as f:
+ with open(self.RscriptsPath['afc_graph'], 'r', encoding='utf8') as f:
txt = f.read()
# self.DictPathOut['RData'], \
scripts = txt % (ffr(self.RscriptsPath['Rgraph']),\
make.simi.afc(dm,chistabletot, lim=%i, alpha = %.2f, movie = %s)
""" % (simi3d.spin_1.GetValue(), float(simi3d.slider_1.GetValue())/100, movie)
tmpfile = tempfile.mktemp(dir=self.parent.TEMPDIR)
- tmp = open(tmpfile,'w')
+ tmp = open(tmpfile,'w', encoding='utf8')
tmp.write(txt)
tmp.close()
return tmpfile
"""
txt += """
dm <-readMM(dm.path)
- cn <- read.table(cn.path, sep="\t", quote='"')
+ cn <- read.table(cn.path, sep="\t", quote='"', comment.char="")
colnames(dm) <- cn[,1]
if (file.exists(selected.col)) {
sel.col <- read.csv2(selected.col, header = FALSE)