Hi All,
I am attempting to use the plotPlatePosition
function in scater
and having some issues with it. Specifically, I have a 96-well plate where the data are incomplete. I have "Cell.Position" as metadata data added to my sce
object using colData()
where locations are listed as A1, A2, A12, B2, B10, etc... However, this standard 96-well plate (rows A-H, columns 1-12) is missing cells. This is what I've tried:
# subseting my plate of interest, here Plate3 (this plate has 72 wells, therefore missing some positions)
example_sce2 <- subset(example_sce1, , Plate.Name=="Plate3")
# defining plate position as a 96-well plate
example_sce2$plate_position <- paste0(
rep(LETTERS[1:8], each = 12),
rep(formatC(1:12, width = 2, flag = "0"), 8))
Error in `[[<-`(`*tmp*`, name, value = c("A01", "A02", "A03", "A04", "A05", :
96 elements in value to replace 72 elements
# when I try running the following either after above or before, I get the same error
plotPlatePosition(example_sce2, colour_by = "total_counts")
Error in `[[<-`(`*tmp*`, name, value = c("A01", "A02", "A03", "A04", "A05", :
96 elements in value to replace 72 elements
If I replace the 96-well plate in plate_position
to create a 72 well plate here by doing letters[1:6]
, it generates a plate plot with A-F instead of A-H that does not show original position of cells. Is there a way for "ignoring" the empty/unlisted positions in a 96-well plate?
Thank you in advance for all of your help!
Thanks, Aaron! That makes sense re first paragraph - I was clearly confused/misunderstood. I do have my metadata loaded and matched to my SCE object, except that I had my cell positions in
colData
namedCell.Position
instead ofplate_position
. I changed the field name toplate_position
, nowplotPlatePosition
works! Thanks again.I have a follow up question about
plate_position
please: I know thatplate_position
can used as a variable forplotExplanatoryVariables
. If I have several 96-well plates that all have certain positions empty in every well for control purposes (e.g. H7-H12), such that now I have 90 cells per plate for multiple plates, does it affect howplotExplanatoryVariables
is calculated? Specifically, does this function assume that these are "0" read counts or gene counts at that same position over several plates and thereforeplotExplanatoryVariables
would assign a "heavier weight" for this?I assume that those 6 wells (H7-H12) don't even have libraries for any plate. If that is the case,
plotExplanatoryVariables
will just ignore them. It won't put zeroes, it won't do anything special - it would be as if you had a set of 90-well plates in the first place. It's not likeplotExplanatoryVariables
sees theplate_position
variable and decides "oh, you must be working with 96-well plates" - for all intents and purposes, it's just another factor. OnlyplotPlatePosition
does something special withplate_position
, as befitting its purpose.The situation gets more complex if you have a different set of empty wells for each plate. If so, the linear model fitted by
plotExplanatoryVariables
will implicitly give more weight to the wells that are occur more frequently across plates. This seems entirely reasonable to me, because that's where more of the information about the gene's variance is available.Thank you, Aaron.
Got it, thanks for clarification. Looking at my plates individually, there are "missing" cells that were not selected for sequencing because they didn't make it past quality control steps.