X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=PrintRScript.py;h=deaddf51ced131c513700e1eda655a5e86b25a58;hp=f9d7be322567d37067f09f69cb338199db303c86;hb=3d1a621b481e251f8a086af586c7eb0bb87b0004;hpb=246487236ad321045561a260ca393b8394aff653 diff --git a/PrintRScript.py b/PrintRScript.py index f9d7be3..deaddf5 100644 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -319,7 +319,7 @@ def RchdQuest(DicoPath, RscriptPath, nbcl = 10, mincl = 10): fileout.write(txt) fileout.close() -def AlcesteTxtProf(DictChdTxtOut, RscriptsPath, clnb, taillecar): +def ReinertTxtProf(DictChdTxtOut, RscriptsPath, clnb, taillecar): txt = "clnb<-%i\n" % clnb txt += """ source("%s") @@ -909,7 +909,16 @@ class PrintSimiScript(PrintRScript) : if self.parametres['seuil_ok'] : seuil = str(self.parametres['seuil']) else : seuil = 'NULL' - + + if not self.parametres.get('edgecurved', False) : + ec = 'FALSE' + else : + ec = 'TRUE' + + txt += """ + edge.curved <- %s + """ % ec + cols = str(self.parametres['cols']).replace(')',', max=255)') cola = str(self.parametres['cola']).replace(')',',max=255)') @@ -1123,7 +1132,7 @@ class PrintSimiScript(PrintRScript) : vertex.label.color <- colm[membership(com)] } } - coords <- plot.simi(graph.simi, p.type='%s',filename="%s", vertex.label = label.v, edge.label = label.e, vertex.col = vertex.col, vertex.label.color = vertex.label.color, vertex.label.cex=label.cex, vertex.size = vertex.size, edge.col = cola, leg=leg, width = width, height = height, alpha = alpha, movie = film, svg = svg) + coords <- plot.simi(graph.simi, p.type='%s',filename="%s", vertex.label = label.v, edge.label = label.e, vertex.col = vertex.col, vertex.label.color = vertex.label.color, vertex.label.cex=label.cex, vertex.size = vertex.size, edge.col = cola, leg=leg, width = width, height = height, alpha = alpha, movie = film, edge.curved = edge.curved, svg = svg) save.image(file="%s") """ % (type, self.filename, ffr(self.pathout['RData'])) @@ -1213,6 +1222,19 @@ class TgenSpecScript(PrintRScript): """ % ffr(self.pathout['tgenspec.csv']) self.add(txt) +class TgenProfScript(PrintRScript): + def make_script(self): + self.sources([self.analyse.ira.RscriptsPath['chdfunct']]) + txt = """ + tgen <- read.csv2("%s", row.names = 1, sep = '\\t') + """ % ffr(self.parametres['tgeneff']) + txt += """ + res <- build.prof.tgen(tgen) + write.table(res$chi2, file = "%s", sep='\\t', col.names = NA) + write.table(res$pchi2, file = "%s", sep='\\t', col.names = NA) + """ % (ffr(self.pathout['tgenchi2.csv']), ffr(self.pathout['tgenpchi2.csv'])) + self.add(txt) + class FreqMultiScript(PrintRScript): def make_script(self): self.sources([self.analyse.parent.RscriptsPath['Rgraph']])