llrs / experDesign

Design experiments distributed in several batches
https://experDesign.llrs.dev
Other
10 stars 1 forks source link

Help fill out a plate or detect it #43

Open llrs opened 1 year ago

llrs commented 1 year ago

If a plate has X positions it would be nice if there were some kind of helper functions to find which samples can go to which positions. This could help to fill up a batch (when still with time).

Also it could help to find how many plates there are in an experiment and thus help diagnose problems better. Example taken from the OSCA book:

library(scRNAseq)
sce.seger <- SegerstolpePancreasData()
df <- data.frame(rownames = rownames(colData(sce.seger)), colData(sce.seger))
dfull <- tidyr::separate_wider_delim(df, cols = rownames, delim = "_", names = c("S", "P"))
s <- strcapture("([A-Z])([0-9]*)", proto = data.frame(row = character(), col = character()), x = dfull$P)
s2 <- cbind(dfull, s)

The experiment was done in plates of 24*16 = 384 samples in a plate. Each donor uses less than a full plate. But there are also 14 different Cell types (at most 12 per donor). [Note to self: in the guide they just do mutual nearest neighbors (MNN)]

Was each donor in a plate? Thus making this a batch effect? Or were multiple donors in the same plate thus reducing the batch effect to compare between donors?

llrs commented 6 months ago

This is partially solved in "create_box": https://github.com/llrs/rutils/blob/master/R/bioinfo.R