Browse code

Updated point size Fixed issue with rcdk code

cannin authored on 21/08/2017 17:25:44
Showing 4 changed files

... ...
@@ -16,6 +16,7 @@
16 16
 #' @param numberColPrefix a prefix to add to column names that start with a number that causes issues with ggplot (DEFAULT: X)
17 17
 #' @param xLimVal a two entry vector (min, max) to set the x-axis
18 18
 #' @param yLimVal a two entry vector (min, max) to set the y-axis
19
+#' @param pointSize size of points on plot (DEFAULT: 3)
19 20
 #' 
20 21
 #' @note TROUBLESHOOTING NOTES: 1) Avoid ":" in colnames
21 22
 #' 
... ...
@@ -50,7 +51,7 @@
50 51
 plotCellMiner2D <- function(df, xCol="x", yCol="y", xLabel=xCol, yLabel=yCol, 
51 52
 														title=NULL, colorPalette=NULL, classCol=NULL, tooltipCol=NULL, 
52 53
 														showLegend=FALSE, showTrendLine=TRUE, showTitle=TRUE, singleColor="#0000FF",
53
-														alpha=1, numberColPrefix="X", xLimVal=NULL, yLimVal=NULL) {
54
+														alpha=1, numberColPrefix="X", xLimVal=NULL, yLimVal=NULL, pointSize=3) {
54 55
 	
55 56
 	# nci60DrugActZ <- exprs(getAct(rcellminerData::drugData))
56 57
 	# nci60GeneExpZ <- getAllFeatureData(rcellminerData::molData)[["exp"]]
... ...
@@ -104,10 +105,10 @@ plotCellMiner2D <- function(df, xCol="x", yCol="y", xLabel=xCol, yLabel=yCol,
104 105
 	p1 <- p1 + theme_bw()
105 106
 	
106 107
 	if(!is.null(colorPalette) && !is.null(classCol)) {
107
-		p1 <- p1 + suppressWarnings(geom_point(aes_string(color=classCol, text=tooltipCol), alpha=alpha, size = 3))
108
+		p1 <- p1 + suppressWarnings(geom_point(aes_string(color=classCol, text=tooltipCol), alpha=alpha, size = pointSize))
108 109
 		p1 <- p1 + scale_colour_manual(name="", values=colorPalette)
109 110
 	} else {
110
-		p1 <- p1 + suppressWarnings(geom_point(aes_string(text=tooltipCol), color=singleColor, alpha=alpha, size = 3))
111
+		p1 <- p1 + suppressWarnings(geom_point(aes_string(text=tooltipCol), color=singleColor, alpha=alpha, size = pointSize))
111 112
 	}
112 113
 
113 114
 	if(!is.null(xLabel)) {
... ...
@@ -22,7 +22,8 @@
22 22
 #' @importFrom rcdk view.image.2d
23 23
 rcdkplot <- function(molecule,width=300,height=300,marg=0,main='') {
24 24
 	par(mar=c(marg,marg,2.2,marg)) # set margins to zero since this isn't a real plot; top is 1.5 to accomodate title
25
-	temp1 <- view.image.2d(molecule,width,height) # get Java representation into an image matrix. set number of pixels you want horiz and vertical
25
+  depictor <- get.depictor(width=width, height=height) # Necessary as of Summer 2017
26
+	temp1 <- view.image.2d(molecule,depictor) # get Java representation into an image matrix. set number of pixels you want horiz and vertical
26 27
 	plot(NA,NA,xlim=c(1,10),ylim=c(1,10),xaxt='n',yaxt='n',xlab='',ylab='',main=main) # create an empty plot
27 28
 	rasterImage(temp1,1,1,10,10) # boundaries of raster: xmin, ymin, xmax, ymax. here i set them equal to plot boundaries
28 29
 }
29 30
\ No newline at end of file
... ...
@@ -17,7 +17,9 @@ specified along the rows, with rownames set appropriately.}
17 17
 
18 18
 \item{Z}{An N element  pattern specified as a vector or a k x N matrix of
19 19
 patterns specified along the rows. These are the patterns whose effect (with respect 
20
-to a linear model) is to be excluded when comparing x with Y or each row entry of Y.}
20
+to a linear model) is to be excluded when comparing x with Y or each row entry of Y.
21
+Note that for the partial correlation to be value, the pattern(s) in Z should 
22
+not overlap with those in x or Y.}
21 23
 
22 24
 \item{updateProgress}{A optional function to be invoked with each computed
23 25
 partial correlation to indicate progress.}
... ...
@@ -8,7 +8,7 @@ plotCellMiner2D(df, xCol = "x", yCol = "y", xLabel = xCol,
8 8
   yLabel = yCol, title = NULL, colorPalette = NULL, classCol = NULL,
9 9
   tooltipCol = NULL, showLegend = FALSE, showTrendLine = TRUE,
10 10
   showTitle = TRUE, singleColor = "#0000FF", alpha = 1,
11
-  numberColPrefix = "X", xLimVal = NULL, yLimVal = NULL)
11
+  numberColPrefix = "X", xLimVal = NULL, yLimVal = NULL, pointSize = 3)
12 12
 }
13 13
 \arguments{
14 14
 \item{df}{a data.frame with at least two columns}
... ...
@@ -42,6 +42,8 @@ plotCellMiner2D(df, xCol = "x", yCol = "y", xLabel = xCol,
42 42
 \item{xLimVal}{a two entry vector (min, max) to set the x-axis}
43 43
 
44 44
 \item{yLimVal}{a two entry vector (min, max) to set the y-axis}
45
+
46
+\item{pointSize}{size of points on plot (DEFAULT: 3)}
45 47
 }
46 48
 \value{
47 49
 a ggplot object