""" % DicoPath['listeuce2']
txt += """
-# rm(data1)
+ rm(data1)
"""
if classif_mode == 0:
txt += """
-# rm(data2)
+ rm(data2)
"""
txt += """
chd.result <- Rchdtxt("%s",mincl=%i,classif_mode=%i, nbt = nbt)
xmax <- max(afc$rowcoord[,1], na.rm = TRUE) + (0.1 * max(afc$rowcoord[,1], na.rm = TRUE))
ymin <- min(afc$rowcoord[,2], na.rm = TRUE) + (0.1 * min(afc$rowcoord[,2], na.rm = TRUE))
ymax <- max(afc$rowcoord[,2], na.rm = TRUE) + (0.1 * max(afc$rowcoord[,2], na.rm = TRUE))
+ print(xmin)
+ print(xmax)
+ print(ymin)
+ print(ymax)
""" % taillecar
txt += """
PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab, xmin=xmin, xmax=xmax, ymin = ymin, ymax=ymax)
if self.param['tchi'] : tchi = 'TRUE'
else : tchi = 'FALSE'
+ if self.param['svg'] : svg = 'TRUE'
+ else : svg = 'FALSE'
+
with open(self.RscriptsPath['afc_graph'], 'r') as f:
txt = f.read()
tchi,\
self.param['tchi_min'],\
self.param['tchi_max'],\
- ffr(os.path.dirname(self.fileout)))
+ ffr(os.path.dirname(self.fileout)),\
+ svg)
return scripts
def print_simi3d(self):
if not intxt :
#FIXME
txt = """
- inf <- NA
di <- matrix(data=%s, nrow=%i, byrow = TRUE)
- di[is.na(di)] <- max(di, na.rm=TRUE) + 2
+ toinf <- which(di == Inf)
+ tominf <- which(di == -Inf)
+ if (length(toinf)) {
+ di[toinf] <- NA
+ valmax <- max(di, na.rm = TRUE)
+ if (valmax <= 0) {
+ valmax <- 2
+ } else {
+ valmax <- valmax + 2
+ }
+ di[toinf] <- valmax
+ }
+ if (length(tominf)) {
+ di[tominf] <- NA
+ valmin <- min(di, na.rm = TRUE)
+ if (valmin >=0) {
+ valmin <- -2
+ } else {
+ valmin <- valmin - 2
+ }
+ di[tominf] <- valmin
+ }
rownames(di)<- %s
colnames(di) <- %s
""" % (txttable, rownb, rownames, colnames)
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))
- coord <- barplot(as.matrix(di), beside = TRUE, col = color, space = c(0.1,0.6))
+ 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))
+ if (length(toinf)) {
+ coordinf <- coord[toinf]
+ valinf <- di[toinf]
+ text(x=coordinf, y=valinf + 0.1, 'i')
+ }
+ if (length(tominf)) {
+ coordinf <- coord[toinf]
+ valinf <- di[toinf]
+ text(x=coordinf, y=valinf - 0.1, 'i')
+ }
c <- colMeans(coord)
c1 <- c[-1]
c2 <- c[-length(c)]