plotSpase | R Documentation |
This function plots stuff for spase results.
plotSpase(
matrix1,
matrix2,
covariates,
spasefit,
coords = NULL,
extrapolate.width = 0.1,
crosshairs = TRUE,
size.scale = TRUE,
point.size = 0.5,
point.outline = TRUE,
theme = "default",
cross.x1 = NULL,
cross.x2 = NULL,
genes = NULL,
save = NULL
)
matrix1 |
a matrix of counts where the rows are genes and the columns are cells for allele 1. This one is the one that gets its probability modeled. Must have row names and column names to identify genes and cells. |
matrix2 |
a matrix of counts where the rows are genes and the columns are cells for allele 2. |
covariates |
data frame that matches pixel IDs to spatial coordinates and other covariates. First column assumed to be pixel IDs, next two columns assumed to be x,y coordinates. Any additional columns assumed to be covariates that will be included in the baseline model. |
spasefit |
the resulting data frame from a call to scase |
coords |
data frame of coordinates to evaluate the model on. Default is NULL which will plot coordinates along the range of the x1 and x2 coordinate values. Highly suggest supplying a custom set of coordinates since the default probably doesn't work well for all data sets. |
extrapolate.width |
numeric which defines the neighborhood around each coordinate from coords to look for an input data point. If there is no point in the neighborhood, |
crosshairs |
boolean default of TRUE indicating plotting the cross- hairs on the 2D spatial plot and the associated confidence intervals of those slices in a separate plot. Set to FALSE to turn off. |
size.scale |
boolean default of TRUE indicating the raw data to be plotted with points that change size depending on the total UMI count at that pixel. Set to FALSE to turn off. |
point.size |
numeric to set the point size, default is 0.5. Must be used with setting size.scale to FALSE. |
point.outline |
boolean to determine whether or not to draw points on raw data with a black outline. default is TRUE. Must be used with setting size.scaleto FALSE. |
theme |
string to set what theme to use for plotting smooth 2D probability functions, default is the default ggplot theme, despite ugly gray background, since the scale uses white as a color. If you're not worried about that you can set to 'classic' to remove gray background and grid lines. |
cross.x1 |
numeric indicating which x1 value to make crosshairs at. default is NULL which, if crosshairs is TRUE, defaults to the middle of the x1 range. |
cross.x2 |
numeric indicating which x2 value to make crosshairs at. default is NULL which, if crosshairs is TRUE, defaults to the middle of the x2 range. |
genes |
a vector of genes given as strings to plot. default is NULL which will plot the first gene in the spasefit results dataframe. |
save |
the filename prefix to save if want to save instead of visualize. Default is null meaning no file will be saved. |
Takes in the result from spase and plots raw data and smoothed allele probability surface
Multiple ggplot2 plots or, instead, each one gets saved to a different file starting with the prefix defined in the save parameter.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.