A highly specialized suite of standardized plotting routines based on the "Grammar of Graphics" framework of mapping variables to aesthetics used in 'ggplot2'. Graphics types are biased towards visualizing SomaScan (proteomic) data.
Note: This issue/feature request was originally made by Eshita Mutt from GSE on Nov 17th, 2023
Checks
[x] Please search previous issues before creating a new
one, to ensure yours is not a duplicate
[x] The proposed feature fits in the scope of SomaPlotr
data visualization of SomaScan.
Problem and/or Feature
Is it possible to add group.var = c("SampleType", "PlateId"), as possible in boxplotGrouped()? From the vignettes, there isn't evidence of this functionality for boxplotSubarray(). Primarily, the goal is to make boxplots for all analytes (log10) and group by SampleType & then color by PlateId.
There are two potential methods to group a boxplotSubarray() plot:
Use facet_wrap() or facet_grid() to split the plot by a variable of interest. This will not require the addition of a new argument to boxplotSubarray(), and will utilize already-available ggplot2 functions. The problem: Metadata variables can't currently be used to group a plot made by boxplotSubarray() via facet_*() because the unused metadata columns are stripped away internally before the final plot is produced.
Example:
reprex::reprex({
suppressPackageStartupMessages({
library(SomaDataIO)
library(SomaPlotr)
library(ggplot2)
})
p <- boxplotSubarray(SomaDataIO::example_data, color.by = "PlateId", do.log = TRUE)
p + facet_wrap(~PlateId) # Produces an error, `PlateId` isn't found
colnames(p$data) # PlateId is not present in plot data
})
Add an argument to boxplotSubarray() that will instruct the function to group based on the specified variable. This variable can then be retained when the plot data object is made, and should resolve the variable not found error produced when using facet_wrap(). The problem: this can already be accomplished by adding a facet_*() layer to the plot.
Note: This issue/feature request was originally made by Eshita Mutt from GSE on Nov 17th, 2023
Checks
Problem and/or Feature
There are two potential methods to group a
boxplotSubarray()
plot:facet_wrap()
orfacet_grid()
to split the plot by a variable of interest. This will not require the addition of a new argument toboxplotSubarray()
, and will utilize already-availableggplot2
functions. The problem: Metadata variables can't currently be used to group a plot made byboxplotSubarray()
viafacet_*()
because the unused metadata columns are stripped away internally before the final plot is produced.Example:
boxplotSubarray()
that will instruct the function to group based on the specified variable. This variable can then be retained when the plot data object is made, and should resolve the variable not found error produced when usingfacet_wrap()
. The problem: this can already be accomplished by adding afacet_*()
layer to the plot.Example:
Priority Level
Thanks for contributing :partying_face:!