diff --git a/R/mavevis.R b/R/mavevis.R
index d3f6ed4..253b2f9 100644
--- a/R/mavevis.R
+++ b/R/mavevis.R
@@ -230,10 +230,14 @@ dashboard <- function(ssid,uniprotId=NULL,pdbs=NULL,mainChains=NULL,
errColIdx <- which(colnames(data) %in% c("se","SE","stderr","sem","SEM","sd","SD","stdev","std","STD"))
if (length(errColIdx) == 0) {
errCol <- NULL
+ errName <- NULL
} else {
errCol <- as.numeric(data[,errColIdx[[1]]])
+ errName <- colnames(data)[errColIdx]
}
+
+
cat("Filtering for single mutant variants...\n")
#Reduce to single mutants
#TODO: Add option to average over multi-mutants
@@ -337,6 +341,7 @@ dashboard <- function(ssid,uniprotId=NULL,pdbs=NULL,mainChains=NULL,
score=sm.data$score,error=sm.errCol,syn.med=syn.med,stop.med=stop.med,
grayBack=TRUE,img.width=img.width,tracks=td,pixelMap=pixelMap)
if (pixelMap && !is.null(pxMap)) {
+ pxMap$errName <- errName
mapFile <- getCacheFile(paste0("result_",outID,"_pxmap_",outFormat,".Rdata"))
save(pxMap,file=mapFile)
}
diff --git a/docker/cgi/getMap.R b/docker/cgi/getMap.R
index a248ee0..375e4a9 100644
--- a/docker/cgi/getMap.R
+++ b/docker/cgi/getMap.R
@@ -54,15 +54,23 @@ if (!file.exists(mapfile)) {
#load the pxMap object from the data file
tryCatch({
load(mapfile)
- mainMap <- na.omit(pxMap$main)
- summaryMap <- na.omit(pxMap$summary)
+ mainMap <- pxMap$main
+ summaryMap <- pxMap$summary
+
+ errName <- "uncertainty"
+ if ("errName" %in% names(pxMap)) {
+ errName <- pxMap$errName
+ }
#translate main map into HTML areas
mainAreas <- paste(do.call(c,lapply(1:nrow(mainMap),function(i) with(mainMap[i,],{
paste0(""
+ paste(x0,y1,x1,y0,sep=","),
+ "\" ","title=\"",
+ sprintf(
+ "Variant: %s%d%s; score = %.2f; %s = %.2f",
+ wt,pos,aa,score,errName,error
+ ),"\"/>"
)
}))),collapse="\n")
@@ -70,7 +78,7 @@ tryCatch({
summaryAreas <- paste(do.call(c,lapply(1:nrow(summaryMap),function(i) with(summaryMap[i,],{
paste0(""
)
}))),collapse="\n")