- sel.col <- read.csv2(selected.col)
- dm <- dm[, sel.col[,1] + 1]
+ sel.col <- read.csv2(selected.col, header = FALSE)
+ sel.col <- sel.col[,1] + 1
+ if (!word) {
+ dm <- dm[, sel.col]
+ } else {
+ forme <- colnames(dm)[index]
+ if (!index %in% sel.col) {
+ sel.col <- append(sel.col, index)
+ }
+ dm <- dm[, sel.col]
+ index <- which(colnames(dm) == forme)
+ }
+ """
+ elif not self.parametres['keep_coord'] and self.parametres['type'] == 'simimatrix' :
+ txt += """
+ dm.path <- "%s"
+ selected.col <- "%s"
+ """ % (self.pathout['mat01.csv'], self.pathout['selected.csv'])
+ if 'word' in self.parametres :
+ txt += """
+ word <- TRUE
+ index <- %i + 1
+ """ % self.parametres['word']
+ else :
+ txt += """
+ word <- FALSE
+ """
+ txt += """
+ dm <-read.csv2(dm.path)
+ dm <- as.matrix(dm)
+ sel.col <- read.csv2(selected.col, header = FALSE)
+ sel.col <- sel.col[,1] + 1
+ if (!word) {
+ dm <- dm[, sel.col]
+ } else {
+ forme <- colnames(dm)[index]
+ if (!index %in% sel.col) {
+ sel.col <- append(sel.col, index)
+ }
+ dm <- dm[, sel.col]
+ index <- which(colnames(dm) == forme)
+ }