@@ -406,6 +406,7 @@ create.pgs.density.plot <- function(
406406# ' @param filename.prefix character prefix for output filenames
407407# ' @param file.extension character file extension for output plots
408408# ' @param tidy.titles logical whether to reformat PGS plot titles to remove periods
409+ # ' @param alpha numeric alpha value for stripplot points, defaults to 0.5
409410# ' @param width numeric width of output plot in inches
410411# ' @param height numeric height of output plot in inches
411412# ' @param xaxes.cex numeric size for all x-axis labels
@@ -467,6 +468,7 @@ create.pgs.boxplot <- function(
467468 filename.prefix = NULL ,
468469 file.extension = ' png' ,
469470 tidy.titles = FALSE ,
471+ alpha = 0.5 ,
470472 width = 10 ,
471473 height = 10 ,
472474 xaxes.cex = 1.5 ,
@@ -530,8 +532,10 @@ create.pgs.boxplot <- function(
530532 data = pgs.data ,
531533 add.stripplot = add.stripplot ,
532534 jitter.factor = jitter.factor ,
535+ points.alpha = alpha ,
533536 xlab.label = NULL ,
534537 ylab.label = pgs.column.main ,
538+ ylab.cex = titles.cex ,
535539 # main = NULL,
536540 # main.cex = titles.cex,
537541 yaxis.cex = yaxes.cex ,
@@ -584,6 +588,7 @@ create.pgs.boxplot <- function(
584588 boxplot.colors <- ' black' ;
585589 } else {
586590 boxplot.colors <- suppressWarnings(BoutrosLab.plotting.general :: default.colours(length(levels(pgs.data [ , phenotype ]))));
591+ names(boxplot.colors ) <- levels(pgs.data [ , phenotype ]);
587592 }
588593 # plot boxplot
589594 group.yaxis.formatting <- basic.yaxis.formatting ;
@@ -592,14 +597,17 @@ create.pgs.boxplot <- function(
592597 data = pgs.data ,
593598 add.stripplot = add.stripplot ,
594599 jitter.factor = jitter.factor ,
600+ points.alpha = alpha ,
595601 xlab.label = phenotype ,
596602 ylab.label = pgs.column.main ,
597603 xlab.cex = titles.cex ,
604+ ylab.cex = titles.cex ,
598605 yaxis.cex = yaxes.cex ,
599606 xaxis.cex = xaxes.cex ,
600607 yat = group.yaxis.formatting $ at ,
601608 yaxis.lab = group.yaxis.formatting $ axis.lab ,
602- col = boxplot.colors
609+ points.col = boxplot.colors [pgs.data [ , phenotype ]] # color points by phenotype
610+ # col = boxplot.colors
603611 );
604612 }
605613 }
0 commit comments