chd.result<-Rchdquest("%s","%s","%s", nbt = nbt, mincl = mincl)
n1 <- chd.result$n1
classeuce1 <- chd.result$cuce1
- """ % (DicoPath['mat01'], DicoPath['listeuce1'], DicoPath['uce'])
+ """ % (DicoPath['mat01.csv'], DicoPath['listeuce1'], DicoPath['uce'])
txt += """
tree_tot1 <- make_tree_tot(chd.result$chd)
txt += """
source("%s")
color = rainbow(nrow(di))
- width <- 100 + (20*length(rownames(di))) + (100 * length(colnames(di)))
+ width <- 100 + (10*length(rownames(di))) + (100 * length(colnames(di)))
height <- nrow(di) * 15
if (height < 400) { height <- 400}
open_file_graph("%s",width = width, height = height)
par(mar=c(0,0,0,0))
layout(matrix(c(1,2),1,2, byrow=TRUE),widths=c(3,lcm(7)))
- par(mar=c(2,2,1,0))
+ par(mar=c(6,2,1,0))
yp = ifelse(length(toinf), 0.2, 0)
ym = ifelse(length(tominf), 0.2, 0)
ymin <- ifelse(!length(which(di < 0)), 0, min(di) - ym)
- coord <- barplot(as.matrix(di), beside = TRUE, col = color, space = c(0.1,0.6), ylim=c(ymin, max(di) + yp))
+ coord <- barplot(as.matrix(di), beside = TRUE, col = color, space = c(0.1,0.6), ylim=c(ymin, max(di) + yp), las = 2)
if (length(toinf)) {
coordinf <- coord[toinf]
valinf <- di[toinf]
if self.parametres['type_graph'] == 1 :
graphnb = 1
type = 'nplot'
- dirout = os.path.dirname(self.pathout['mat01'])
+ dirout = os.path.dirname(self.pathout['mat01.csv'])
while os.path.exists(os.path.join(dirout,'graph_simi_'+str(graphnb)+'.png')):
graphnb +=1
self.filename = ffr(os.path.join(dirout,'graph_simi_'+str(graphnb)+'.png'))
if self.parametres['type_graph'] == 3 :
graphnb = 1
type = 'web'
- dirout = os.path.dirname(self.pathout['mat01'])
+ dirout = os.path.dirname(self.pathout['mat01.csv'])
while os.path.exists(os.path.join(dirout,'web_'+str(graphnb))):
graphnb +=1
self.filename = ffr(os.path.join(dirout,'web_'+str(graphnb)))
if self.parametres['type_graph'] == 4 :
graphnb = 1
type = 'rglweb'
- dirout = os.path.dirname(self.pathout['mat01'])
+ dirout = os.path.dirname(self.pathout['mat01.csv'])
while os.path.exists(os.path.join(dirout,'webrgl_'+str(graphnb))):
graphnb +=1
self.filename = ffr(os.path.join(dirout,'webrgl_'+str(graphnb)))
self.sources([self.analyse.parent.RscriptsPath['Rgraph'], self.analyse.parent.RscriptsPath['prototypical.R']])
self.packages(['wordcloud'])
txt = """
+ errorn <- function(x) {
+ qnorm(0.975)*sd(x)/sqrt(lenght(n))
+ }
+ errort <- function(x) {
+ qt(0.975,df=lenght(x)-1)*sd(x)/sqrt(lenght(x))
+ }
mat <- read.csv2("%s", header = FALSE, row.names=1, sep='\t', quote='"', dec='.')
open_file_graph("%s",height=800, width=1000)
prototypical(mat, mfreq = %s, mrank = %s, cloud = FALSE, cexrange=c(1,2.4), cexalpha= c(0.4, 1))
self.packages(['rgexf'])
txt = """
"""
-
+
+class TgenSpecScript(PrintRScript):
+ def make_script(self):
+ self.packages(['textometry'])
+ txt = """
+ tgen <- read.csv2("%s", row.names = 1, sep = '\\t')
+ """ % self.parametres['tgeneff']
+ txt += """
+ tot <- tgen[nrow(tgen), ]
+ result <- NULL
+ tgen <- tgen[-nrow(tgen),]
+ for (i in 1:nrow(tgen)) {
+ mat <- rbind(tgen[i,], tot - tgen[i,])
+ specmat <- specificities(mat)
+ result <- rbind(result, specmat[1,])
+ }
+ colnames(result) <- colnames(tgen)
+ row.names(result) <- rownames(tgen)
+ write.table(result, file = "%s", sep='\\t', col.names = NA)
+ """ % self.pathout['tgenspec.csv']
+ self.add(txt)
+