source("%s")
source("%s")
source("%s")
- """ % (RscriptPath['CHD'], RscriptPath['chdtxt'], RscriptPath['anacor'], RscriptPath['Rgraph'])
+ """ % (ffr(RscriptPath['CHD']), ffr(RscriptPath['chdtxt']), ffr(RscriptPath['anacor']), ffr(RscriptPath['Rgraph']))
if R_max_mem :
txt += """
memory.limit(%i)
data1 <- readMM("%s")
data1 <- as(data1, "dgCMatrix")
row.names(data1) <- 1:nrow(data1)
- """ % DicoPath['TableUc1']
+ """ % ffr(DicoPath['TableUc1'])
if classif_mode == 0:
txt += """
data2 <- readMM("%s")
data2 <- as(data2, "dgCMatrix")
row.names(data2) <- 1:nrow(data2)
- """ % DicoPath['TableUc2']
+ """ % ffr(DicoPath['TableUc2'])
txt += """
chd1<-CHD(data1, x = nbt, mode.patate = mode.patate, svd.method = svd.method, libsvdc.path = libsvdc.path)
"""
txt += """
#lecture des uce
listuce1<-read.csv2("%s")
- """ % DicoPath['listeuce1']
+ """ % ffr(DicoPath['listeuce1'])
if classif_mode == 0:
txt += """
listuce2<-read.csv2("%s")
- """ % DicoPath['listeuce2']
+ """ % ffr(DicoPath['listeuce2'])
txt += """
rm(data1)
classes<-n1[,ncol(n1)]
write.csv2(n1, file="%s")
rm(n1)
- """ % (classif_mode, mincl, DicoPath['uce'], DicoPath['n1.csv'])
+ """ % (classif_mode, mincl, ffr(DicoPath['uce']), ffr(DicoPath['n1.csv']))
txt += """
tree.tot1 <- make_tree_tot(chd1)
# open_file_graph("%s", widt = 600, height=400)
# plot(tree.tot1$tree.cl)
# dev.off()
- """ % DicoPath['arbre1']
+ """ % ffr(DicoPath['arbre1'])
if classif_mode == 0:
txt += """
# open_file_graph("%s", width = 600, height=400)
# plot(tree.tot2$tree.cl)
# dev.off()
- """ % DicoPath['arbre2']
+ """ % ffr(DicoPath['arbre2'] )
txt += """
tree.cut1 <- make_dendro_cut_tuple(tree.tot1$dendro_tuple, chd.result$coord_ok, classeuce1, 1, nbt)
open_file_graph("%s", width = 600, height=400)
plot(tree.cut1$dendro_tot_cl)
dev.off()
- """ % (DicoPath['Rdendro'], DicoPath['dendro1'], DicoPath['arbre1'])
+ """ % (ffr(DicoPath['Rdendro']), ffr(DicoPath['dendro1']), ffr(DicoPath['arbre1']))
if classif_mode == 0:
txt += """
open_file_graph("%s", width = 600, height=400)
plot(tree.cut1$dendro_tot_cl)
dev.off()
- """ % (DicoPath['dendro2'], DicoPath['arbre2'])
+ """ % (ffr(DicoPath['dendro2']), ffr(DicoPath['arbre2']))
txt += """
#save.image(file="%s")
- """ % (DicoPath['RData'])
+ """ % (ffr(DicoPath['RData']))
fileout = open(DicoPath['Rchdtxt'], 'w')
fileout.write(txt)
source("%s")
source("%s")
source("%s")
- """ % (RscriptPath['CHD'], RscriptPath['chdquest'], RscriptPath['anacor'],RscriptPath['Rgraph'])
+ """ % (ffr(RscriptPath['CHD']), ffr(RscriptPath['chdquest']), ffr(RscriptPath['anacor']),ffr(RscriptPath['Rgraph']))
txt += """
nbt <- %i - 1
chd.result<-Rchdquest("%s","%s","%s", nbt = nbt, mincl = mincl)
n1 <- chd.result$n1
classeuce1 <- chd.result$cuce1
- """ % (DicoPath['mat01.csv'], DicoPath['listeuce1'], DicoPath['uce'])
+ """ % (ffr(DicoPath['mat01.csv']), ffr(DicoPath['listeuce1']), ffr(DicoPath['uce']))
txt += """
tree_tot1 <- make_tree_tot(chd.result$chd)
open_file_graph("%s", width = 600, height=400)
plot(tree_tot1$tree.cl)
dev.off()
- """%DicoPath['arbre1']
+ """ % ffr(DicoPath['arbre1'])
txt += """
tree_cut1 <- make_dendro_cut_tuple(tree_tot1$dendro_tuple, chd.result$coord_ok, classeuce1, 1, nbt)
open_file_graph("%s", width = 600, height=400)
classes<-n1[,ncol(n1)]
plot.dendropr(tree_cut1$tree.cl,classes, histo = TRUE)
- """ % (DicoPath['Rdendro'],DicoPath['dendro1'])
+ """ % (ffr(DicoPath['Rdendro']), ffr(DicoPath['dendro1']))
txt += """
save.image(file="%s")
- """ % DicoPath['RData']
+ """ % ffr(DicoPath['RData'])
fileout = open(DicoPath['Rchdquest'], 'w')
fileout.write(txt)
fileout.close()
source("%s")
#load("%s")
n1 <- read.csv2("%s")
-""" % (RscriptsPath['chdfunct'], DictChdTxtOut['RData'], DictChdTxtOut['n1.csv'])
+""" % (ffr(RscriptsPath['chdfunct']), ffr(DictChdTxtOut['RData']), ffr(DictChdTxtOut['n1.csv']))
txt += """
dataact<-read.csv2("%s", header = FALSE, sep = ';',quote = '\"', row.names = 1, na.strings = 'NA')
datasup<-read.csv2("%s", header = FALSE, sep = ';',quote = '\"', row.names = 1, na.strings = 'NA')
dataet<-read.csv2("%s", header = FALSE, sep = ';',quote = '\"', row.names = 1, na.strings = 'NA')
-""" % (DictChdTxtOut['Contout'], DictChdTxtOut['ContSupOut'], DictChdTxtOut['ContEtOut'])
+""" % (ffr(DictChdTxtOut['Contout']), ffr(DictChdTxtOut['ContSupOut']), ffr(DictChdTxtOut['ContEtOut']))
txt += """
tablesqrpact<-BuildProf(as.matrix(dataact),n1,clnb)
tablesqrpsup<-BuildProf(as.matrix(datasup),n1,clnb)
"""
txt += """
PrintProfile(n1,tablesqrpact[4],tablesqrpet[4],tablesqrpact[5],tablesqrpet[5],clnb,"%s","%s",tablesqrpsup[4],tablesqrpsup[5])
-""" % (DictChdTxtOut['PROFILE_OUT'], DictChdTxtOut['ANTIPRO_OUT'])
+""" % (ffr(DictChdTxtOut['PROFILE_OUT']), ffr(DictChdTxtOut['ANTIPRO_OUT']))
txt += """
colnames(tablesqrpact[[2]])<-paste('classe',1:clnb,sep=' ')
colnames(tablesqrpact[[1]])<-paste('classe',1:clnb,sep=' ')
write.csv2(ptabletot,file="%s")
gbcluster<-n1
write.csv2(gbcluster,file="%s")
-""" % (DictChdTxtOut['chisqtable'], DictChdTxtOut['ptable'], DictChdTxtOut['SbyClasseOut'])
+""" % (ffr(DictChdTxtOut['chisqtable']), ffr(DictChdTxtOut['ptable']), ffr(DictChdTxtOut['SbyClasseOut']))
if clnb > 2 :
txt += """
library(ca)
#FIXME : split this!!!
txt += """
source("%s")
- """ % RscriptsPath['Rgraph']
+ """ % ffr(RscriptsPath['Rgraph'])
txt += """
afc <- summary.ca.dm(afc)
write.csv2(afc_table$facteur, file = "%s")
write.csv2(afc_table$colonne, file = "%s")
write.csv2(afc_table$ligne, file = "%s")
- """ % (DictChdTxtOut['afc_facteur'], DictChdTxtOut['afc_col'], DictChdTxtOut['afc_row'])
+ """ % (ffr(DictChdTxtOut['afc_facteur']), ffr(DictChdTxtOut['afc_col']), ffr(DictChdTxtOut['afc_row']))
txt += """
PARCEX<-%s
""" % taillecar
txt += """
xyminmax <- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab)
- """ % (DictChdTxtOut['AFC2DL_OUT'])
+ """ % (ffr(DictChdTxtOut['AFC2DL_OUT']))
txt += """
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debsup, fin=(debet-1), xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active=FALSE)
- """ % (DictChdTxtOut['AFC2DSL_OUT'])
+ """ % (ffr(DictChdTxtOut['AFC2DSL_OUT']))
txt += """
if ((fin - debet) > 2) {
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debet, fin=fin, xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active = FALSE)
}
- """ % (DictChdTxtOut['AFC2DEL_OUT'])
+ """ % (ffr(DictChdTxtOut['AFC2DEL_OUT']))
txt += """
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", col=TRUE, what='coord', xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active=FALSE)
- """ % (DictChdTxtOut['AFC2DCL_OUT'])
+ """ % (ffr(DictChdTxtOut['AFC2DCL_OUT']))
# txt += """
# PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='crl', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab)
# PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='crl', deb=debsup, fin=(debet-1), xlab = xlab, ylab = ylab)
rm(tablesqrpsup)
rm(tablesqrpet)
save.image(file="%s")
-""" % DictChdTxtOut['RData']
+""" % ffr(DictChdTxtOut['RData'])
file = open(DictChdTxtOut['RTxtProfGraph'], 'w')
file.write(txt)
file.close()
txt = f.read()
# self.DictPathOut['RData'], \
- scripts = txt % (self.RscriptsPath['Rgraph'],\
+ scripts = txt % (ffr(self.RscriptsPath['Rgraph']),\
self.param['typegraph'], \
self.param['what'], \
self.param['facteur'][0],\
txt = ''
txt += """
source("%s")
- """ % self.parent.RscriptsPath['chdfunct']
+ """ % ffr(self.parent.RscriptsPath['chdfunct'])
txt += """
load("%s")
- """ % self.pathout['RData']
+ """ % ffr(self.pathout['RData'])
txt += """
dataact<-read.csv2("%s", header = FALSE, sep = ';',quote = '\"', row.names = 1, na.strings = 'NA')
- """ % self.pathout['Contout']
+ """ % ffr(self.pathout['Contout'])
txt += """
dataet<-read.csv2("%s", header = FALSE, sep = ';',quote = '\"', row.names = 1, na.strings = 'NA')
- """ % self.pathout['ContEtOut']
+ """ % ffr(self.pathout['ContEtOut'])
txt += """
clnb<-%i
""" % self.clnb
tablesqrpact<-BuildProf(as.matrix(dataact),n1,clnb)
tablesqrpet<-BuildProf(as.matrix(dataet),n1,clnb)
PrintProfile(n1,tablesqrpact[4],tablesqrpet[4],tablesqrpact[5],tablesqrpet[5],%i,"%s","%s")
- """ % (self.clnb, self.pathout['PROFILE_OUT'], self.pathout['ANTIPRO_OUT'])
+ """ % (self.clnb, ffr(self.pathout['PROFILE_OUT']), ffr(self.pathout['ANTIPRO_OUT']))
txt += """
colnames(tablesqrpact[[2]])<-paste('classe',1:clnb,sep=' ')
colnames(tablesqrpact[[1]])<-paste('classe',1:clnb,sep=' ')
ptabletot<-rbind(as.data.frame(tablesqrpact[1]),as.data.frame(tablesqrpet[1]))
gbcluster<-n1
write.csv2(chistabletot,file="%s")
- """ % self.pathout['chisqtable']
+ """ % ffr(self.pathout['chisqtable'])
txt += """
write.csv2(ptabletot,file="%s")
- """ % self.pathout['ptable']
+ """ % ffr(self.pathout['ptable'])
txt += """
write.csv2(gbcluster,file="%s")
- """ % self.pathout['SbyClasseOut']
+ """ % ffr(self.pathout['SbyClasseOut'])
if self.clnb > 2 :
txt += """
library(ca)
fin<-rowtot
afc<-AddCorrelationOk(afc)
source("%s")
- """ % self.parent.RscriptsPath['Rgraph']
+ """ % ffr(self.parent.RscriptsPath['Rgraph'])
txt += """
afc <- summary.ca.dm(afc)
write.csv2(afc_table$facteur, file = "%s")
write.csv2(afc_table$colonne, file = "%s")
write.csv2(afc_table$ligne, file = "%s")
- """ % (self.pathout['afc_facteur'], self.pathout['afc_col'], self.pathout['afc_row'])
+ """ % (ffr(self.pathout['afc_facteur']), ffr(self.pathout['afc_col']), ffr(self.pathout['afc_row']))
txt += """
xlab <- paste('facteur 1 - ', round(afc$facteur[1,2],2), sep = '')
""" % "0.9"
txt += """
xyminmax <- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=1, fin=(debet-1), xlab = xlab, ylab = ylab)
- """ % (self.pathout['AFC2DL_OUT'])
+ """ % (ffr(self.pathout['AFC2DL_OUT']))
txt += """
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debet, fin=fin, xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2])
- """ % (self.pathout['AFC2DSL_OUT'])
+ """ % (ffr(self.pathout['AFC2DSL_OUT']))
txt += """
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", col = TRUE, what='coord', xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2])
- """ % (self.pathout['AFC2DCL_OUT'])
+ """ % (ffr(self.pathout['AFC2DCL_OUT']))
txt += """
save.image(file="%s")
- """ % self.pathout['RData']
+ """ % ffr(self.pathout['RData'])
tmpfile = tempfile.mktemp(dir=self.parent.TEMPDIR)
tmpscript = open(tmpfile, 'w')
tmpscript.write(txt)
#Copyright (c) 2008-2011 Pierre Ratinaud
#License: GNU/GPL
-from chemins import ConstructPathOut, StatTxtPathOut, PathOut
+from chemins import ConstructPathOut, StatTxtPathOut, PathOut, ffr
#from corpus import Corpus
from analysetxt import AnalyseText
import wx
txt = """
source("%s")
source("%s")
- """ % (self.parent.RscriptsPath['chdfunct'], self.parent.RscriptsPath['Rgraph'])
+ """ % (ffr(self.parent.RscriptsPath['chdfunct']), ffr(self.parent.RscriptsPath['Rgraph']))
txt += """
dmf<-read.csv2("%s",row.names=1)
- """ % self.dictpathout['tableafcm']
+ """ % ffr(self.dictpathout['tableafcm'])
txt += """
dmt<-read.csv2("%s",row.names=1)
- """ % self.dictpathout['tabletypem']
+ """ % ffr(self.dictpathout['tabletypem'])
txt += """
indice <- "%s"
""" % self.parametres['indice']
banalspec <- specf<-outf[[1]][banal,]
banal <- cbind(banalfreq, banalspec)
write.csv2(banal,file="%s")
- """ % self.pathout['banalites.csv']
+ """ % ffr(self.pathout['banalites.csv'])
txt += """
specf<-outf[[1]]
spect<-outt[[1]]
write.csv2(specf,file="%s")
- """ % self.dictpathout['tablespecf']
+ """ % ffr(self.dictpathout['tablespecf'])
txt += """
write.csv2(spect,file="%s")
- """ % self.dictpathout['tablespect']
+ """ % ffr(self.dictpathout['tablespect'])
txt += """
write.csv2(outf[[3]],file="%s")
- """ % self.dictpathout['eff_relatif_forme']
+ """ % ffr(self.dictpathout['eff_relatif_forme'])
txt += """
write.csv2(outt[[3]],file="%s")
- """ % self.dictpathout['eff_relatif_type']
+ """ % ffr(self.dictpathout['eff_relatif_type'])
if self.parametres['clnb'] > 2 :
txt += """
library(ca)
debsup <- NULL
debet <- NULL
clnb <- ncol(specf)
- """ % (self.dictpathout['afcf_row'], self.dictpathout['afcf_col'], self.dictpathout['afct_row'], self.dictpathout['afct_col'], self.dictpathout['afcf_facteur_csv'], self.dictpathout['afcf_col_csv'], self.dictpathout['afcf_row_csv'], self.dictpathout['afct_facteur_csv'], self.dictpathout['afct_col_csv'], self.dictpathout['afct_row_csv'])
+ """ % (ffr(self.dictpathout['afcf_row']), ffr(self.dictpathout['afcf_col']), ffr(self.dictpathout['afct_row']), ffr(self.dictpathout['afct_col']), ffr(self.dictpathout['afcf_facteur_csv']), ffr(self.dictpathout['afcf_col_csv']), ffr(self.dictpathout['afcf_row_csv']), ffr(self.dictpathout['afct_facteur_csv']), ffr(self.dictpathout['afct_col_csv']), ffr(self.dictpathout['afct_row_csv']))
txt += """
save.image("%s")
- """ % self.dictpathout['RData']
+ """ % ffr(self.dictpathout['RData'])
tmpfile = tempfile.mktemp(dir=self.parent.TEMPDIR)
tmpscript = open(tmpfile, 'w')
tmpscript.write(txt)