Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
taunometsalu committed Nov 19, 2018
1 parent 753627c commit b73b494
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.Rhistory
8 changes: 4 additions & 4 deletions Rpackage/R/clustvis.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ createCaption = function(type, info){
leg = append(leg, c("N = ", info$n[2], " data points."))
} else if(type == "hm"){
sc = convertIdsToNames(info$rowScaling)
scaling = str_c(sc, " is applied to ", changeRowsCols("rows", transp), ". ")
scaling = paste0(sc, " is applied to ", changeRowsCols("rows", transp), ". ")
if(info$rowCentering){
leg = append(leg, c(changeRowsCols("Rows", transp), " are centered; ", scaling))
} else {
Expand All @@ -81,11 +81,11 @@ createCaption = function(type, info){
}
n = info$n
if(transp) n = rev(n)
leg = append(leg, str_c(str_c(n, c(" rows", " columns.")), collapse = ", "))
leg = append(leg, paste(paste(n, c("rows", "columns.")), collapse = ", "))
} else {
stop("caption type is not supported!")
}
stringr::str_c(leg, collapse = "")
paste(leg, collapse = "")
}

#read file and extract annotations
Expand Down Expand Up @@ -578,7 +578,7 @@ generatePCA = function(proc, pcx = 1, pcy = 2, switchDirX = FALSE, switchDirY =
l = list(NULL, 0, 0, message = paste0("You have ", nColor, " different groups for color, only up to ", maxColorLevels, " are allowed. Please change color grouping!"))
return(structure(l, class = "pca"))
} else if(nShape > maxShapeLevels){
l = ist(NULL, 0, 0, message = paste0("You have ", nShape, " different groups for shape, only up to ", maxShapeLevels, " are allowed. Please change shape grouping!"))
l = list(NULL, 0, 0, message = paste0("You have ", nShape, " different groups for shape, only up to ", maxShapeLevels, " are allowed. Please change shape grouping!"))
return(structure(l, class = "pca"))
}
ellCoord = calcEllipses(x2, ellipseConf)
Expand Down
8 changes: 4 additions & 4 deletions Rpackage/vignettes/vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This vignette shows some minimal examples how to generate plots using R package
```{r, fig.show = 'hold', fig.height = 4, fig.width = 7}
library(clustvis)
file = "https://raw.githubusercontent.com/taunometsalu/ClustVis/master/datasets/nki.csv"
d = importData(file)
proc = processData(d)
imp = importData(file)
proc = processData(imp)
pca = generatePCA(proc)
savePCA(pca, file = NA)
```
Expand All @@ -35,8 +35,8 @@ savePCA(pca, file = NA)
```{r}
library(clustvis)
file = "https://raw.githubusercontent.com/taunometsalu/ClustVis/master/datasets/nki.csv"
d = importData(file)
proc = processData(d)
imp = importData(file)
proc = processData(imp)
hm = generateHeatmap(proc)
saveHeatmap(hm, file = NA)
```
Expand Down
16 changes: 8 additions & 8 deletions Rpackage/vignettes/vignette.html

Large diffs are not rendered by default.

Binary file modified Rpackage/vignettes/vignette_static.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ shinyServer(function(input, output, session) {

output$captionPCA = renderUI({
data = getProc()
info = getPCA()$captionInfo
if(!is.null(data$matPca)){
info = getPCA()$captionInfo
leg = createCaption(type = "pca", info = info)
#http://stackoverflow.com/questions/23233497/outputting-multiple-lines-of-text-with-rendertext-in-r-shiny
return(HTML("<h5>Caption example</h5><p>", leg, "</p>"))
Expand All @@ -1148,8 +1148,8 @@ shinyServer(function(input, output, session) {

output$captionHeatmap = renderUI({
data = getProc()
info = getHeatmap()$captionInfo
if(!is.null(info) && !is.null(data$matImputed) && all(dim(data$matImputed) <= maxDimensionHeatmap)){
if(!is.null(data$matImputed) && all(dim(data$matImputed) <= maxDimensionHeatmap)){
info = getHeatmap()$captionInfo
leg = createCaption(type = "hm", info = info)
return(HTML("<h5>Caption example</h5><p>", leg, "</p>"))
} else {
Expand Down

0 comments on commit b73b494

Please sign in to comment.