+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']])
+ txt = """
+ freq <- read.csv2("%s", row.names=1, sep='\\t', dec='.')
+ """ % ffr(self.pathout['frequences.csv'])
+ txt += """
+ toplot <- freq[order(freq[,2]) ,2]
+ toplot.names = rownames(freq)[order(freq[,2])]
+ h <- 80 + (20 * nrow(freq))
+ open_file_graph("%s",height=h, width=500)
+ par(mar=c(3,20,3,3))
+ barplot(toplot, names = toplot.names, horiz=TRUE, las =1, col = rainbow(nrow(freq)))
+ dev.off()
+ """ % ffr(self.pathout['barplotfreq.png'])
+ txt += """
+ toplot <- freq[order(freq[,4]) ,4]
+ toplot.names = rownames(freq)[order(freq[,4])]
+ open_file_graph("%s",height=h, width=500)
+ par(mar=c(3,20,3,3))
+ barplot(toplot, names = toplot.names, horiz=TRUE, las =1, col = rainbow(nrow(freq)))
+ dev.off()
+ """ % ffr(self.pathout['barplotrow.png'])
+ self.add(txt)
+ self.write()
\ No newline at end of file