Movatterモバイル変換


[0]ホーム

URL:


How to use Well Plate Maker

Helene Borges

31 October 2025

Abstract

TheWell-PlateMaker (WPM) is a shiny application deployed as an R package. Functions for a command-line/script use are also available. The WPM allows users to generate well plate maps to carry out their experiments while improving the handling of batch effects. In particular, it helps controlling the “plate effect” thanks to its ability to randomize samples over multiple well plates. The algorithm for placing the samples is inspired by the backtracking algorithm: the samples are placed at random while respecting specific spatial constraints. The use of WPM as well as the definition of configurable spatial constraints are described in the following sections.

1 Introduction

This tutorial explains how to use theWell Plate Maker package.

1.1 General principle

To generate plate maps, the WPM uses an algorithm inspired from the backtrackingalgorithm. More precisely, WPM loops on the following actions until all of thesamples are given a correct location:

  1. Randomly choose a well on the plate
  2. Randomly selects a sample
  3. Check whether all the specified location constraints are met. If yes, place the sample accordingly

This process allows for an experimental design by block randomization.

1.2 Uses and associated input formats

There are two ways to use theWPM:

  • Command line with appropriate R functions: for users who want to work withscripts or want to integrate the WPM into a pre-existing pipeline.
  • Through agraphical interface (GUI): for users who do not necessarily have advancedR programming skills.

Important: Even in case of command line use, we strongly recommend to read the section about theshiny app section, as this is where all terms and concepts are detailed.

Input FormatCommand lineWPM app
CSVyesyes
ExpressionSetyesno
SummarizedExperimentyesno
MSnSetyesno

2 Getting started

2.1 Prerequisites

Make sure you are using a recent version of R (\(\geq 4.0.0\)).For Windows users who do not have the Edge browser, we recommend using theChrome browser rather than Internet Explorer.

2.2 How to install

From GitHub (consider it a devel version):

devtools::install_github("HelBor/wpm", build_vignettes=TRUE)

From Bioconductor (release, stable version):

if (!requireNamespace("BiocManager", quietly = TRUE))    install.packages("BiocManager")BiocManager::install("wpm")

Instructions can also be found on theBioconductor page

3 How to use the WPM shiny application

3.1 Load the WPM package

library(wpm)

3.2 Launch the shiny application

Whether you use RStudio or simply work in an R console, the procedure remainsthe same to launch the shiny app:

library(wpm)wpm()

If everything is in order, a new window will open in your default browser.If not, find the line written in the R console that looks likeListening on http://127.0.0.1:8000, and paste the URL in your web browser.

WPM has 4 main tabs:Home,Parameters,Results andHelp.

3.3 TheHome tab

This tab briefly presents the aim of the app, shows the last package version,explains how to support our work by citing the associated article and gives contact information.

The Home page when wpm is started

3.4 TheParameters tab

Overall the page is organized in two sections.

The one on the left hand side contains all the configuration steps.It is divided into 7 main steps, detailed below. It is of the utmostimportance to correctly specify all the constraints for generating the desiredplate maps.

The one on the right hand side summarizes the input parameters (tuned along the 7 steps ofthe left panel) as well as the chosen (empty) plate layout. The right section isautomatically updated each time a parameter is changed in the left section.

Parameters Panel

3.4.1 Step 1: Upload the dataset

First, you need to upload aComma-separated values (.CSV) or a text (.txt) file.This file contains at least one piece of information: the list of the sample names.

Sample
s1
s2
s3
s4

It is also possible to provide a file containing several other variables describingthe data, as in the example below:

SampleTypeTreatment
s1Atrt1
s2Atr1
s3BCtrl
s4CCtrl

IMPORTANT Please make sure the data in the CSV file respect the following SPECIFIC ORDER of columns:Sample names in thefirst column, and other variables in the other columns,like the example below (if there are rownames, then theSamples Column must bethe second in the file.):

Sample;Type;Treatments1;A;trt1s2;A;trt1s3;B;Ctrls4;C;Ctrl

If this is your first time using the WPM, we recommend that you test thecapabilities of the WPM using thedemo dataset (“Load the demo dataset” tab).

Second, you have to specify if there are quotes in your file or not(If you are using the demo dataset, this is not a requested parameter.):

The default isnone, meaning that there is no" or characters in your file.If you select the appropriate quote, then you will be able to:

  • check if your file does have aheader androw names.
  • select the appropriateseparator field. Default is semicolon (“;”)

Then, you can select one of the variables that you want to use as the groupingfactor for WPM.
This column will be renamed “Group” in the final dataset.

Choose the grouping factor

The names you give to columns in your CSV file do not matter, because the WPM will createa new dataset having 3 fields:“Sample” ,“Group” and“ID”.

You will see your dataset on the right hand side of the window, as well as another datasetwhich will be used by WPM to generate the map(s).
Each sample is assigned a unique ID, which will be used to name itonto the plate maps (for more details on the ID see theResults section ).

Dataset vizualisation

IMPORTANT Please ensure that the dataset is correctly displayed in the rightwindow and that the number of samples / groups is correct.
If you see that the total number of samples is wrong, this means that you havenot chosen the appropriate options among those described above, so that corrections are needed.

3.4.2 Step 2: Choose a Project name

This step is mandatory. It will be used in the plot titles as well as in the outputfile names. Moreover, it be concatenated with sample IDs to limit confusions.

3.4.3 Step 3: Plate(s) dimensions

Here you have to specify the plate dimensions and their number. Currently, WPMsupports plate dimensions of 6, 24, 48, 96, 386, 1534 wells; as well as custom dimensions(where you manually specify the number of rows and columns).

To the right of step 2 you can see an information box, warning you that WPMwill distribute the samples in a balanced manner within the plates (if thereare several of them).

balanced way message

If you select a plate size compatible with the total number of samples, youwill see two blue boxes and a plate plan appear on the right hand side. They summarize allthe elements of your configuration.In the example below, we selected the pre-defined dimension of 96 wells and onlyone plate:

plate dimensions example

The right side of the panel will summarize all these parameters:

parameters summary

This plot updates with each modification of the parameters, thus making itpossible to see if one has made an error.

IMPORTANT: If the WPM detects a problem or incompatibility between parameters,you will see an error message instead of the plate map, providing hints on the possible origin of the problem.

Example of error message

3.4.4 Step 4: Forbidden wells

In this step are listed theForbidden wells, if any (optional):

AForbidden well will not be filled with any kind of sample, eitherbecause the user does not want to (e.g. plate corners in case of non-uniformheat distribution), or because of material constraints (e.g. dirty wells, brokenpipettes).

You fill the text input with the coordinates of the wells (a combination ofletters and numbers, as in the example below):

Example of forbidden wells listed in the text input

You will see the plot updated in the right section:

Updated plot with forbidden wells

The wells filled with forbidden wells will have the“forbidden” ID in thefinal dataset. On the resulting map, these wells will be colored in red.

3.4.5 Step 5: Buffers

At this stage you can specify the wells which correspond to buffers, if thereare any.

Abuffer well corresponds to a well filled filled with solution but without biological material (e.g. to avoid/check for cross-contamination).

Five patterns are available for placing the buffers:

1)no buffers: there will be no buffer on the plate(s).

2)Per line: Automatically places buffers every other row.You can choose to start placing in even or odd row.

Per line mode example with even option

3)Per column: Automatically places buffers every other column.You can choose to start placing in even or odd column.

Per Column mode example with even option

4)Checkerboard: Automatically places buffers like a checkerboard.

Checkerboard mode

5)Choose by hand: It is the same procedure as for specifying forbiddenwells.

3.4.5.1 Specify the neighborhood constraints

These are the spatial constraints that the WPM needs to respect when designing the plates.Currently, 4 types of them are proposed. Note that the patterns are available onlyif they are compatible with the chosen buffer pattern.The question here is: Should samples from the same group be found side by side?

Schematically, the spatial constraints can be summarized as follows (the bluewell is the current well evaluated by WPM; The wells in green are thoseassessed for compliance with the chosen constraint. The blue well therefore hasthe possibility (but not the obligation since the filling of the plate is donerandomly) to be filled with a sample belonging to the same group as the samplesin the wells evaluated.

NS (North South): samples from the same group will not be placed side by sidecolumn-wise.North-South constraint

WE (West East): samples from the same group will not be placed side by siderow-wise.East-West constraint

NSEW (North South East West): samples from the same group will not be placedside by side either row-wise or column-wise.North-South-East-West constraint

None: samples from the same group can be placed anywhere, including side by side.No constraint

The wells filled with buffer solution will have the“buffer” ID in thefinal dataset. On the resulting map, these wells will be colored in grey.

3.4.6 Step 6: Fixed samples

At this stage you can specify the wells which correspond to fixedsamples, if there are any.

Afixed sample corresponds to a quality control sample or standard.The precise location of these samples must be controlled by the researcher.

This step works in exactly the same way as theforbidden well step. The only difference is that the fixed sampleswill appear inblack on the plot.

The fixed samples will have the“fixed” ID inthe final dataset.

3.4.7 Number of iterations

Choose amaximum number of iterations to find a solution, then start theWPM by clicking the“start WPM” button. If the samples do not have a group, then the sampleswill be placed completely randomly on the plates. If there are groups, the WPM willuse an algorithm inspired by the backtracking algorithm (to place thesamples in the wells while respecting the specified constraints).

The default value is 20, but if your configuration is somewhat complex, thenit is advised to increase the number.

Aniteration corresponds to an attempt by the WPM to find a solution. Thealgorithm used is not fully backtracked: the WPM stops as soon as there are nomore possibilities to finalize the current solution; then, it starts back from scratchthe plate map, until a solution that fits all the constraints is found.With this approach, not all possible combinations are explored, but it doesreduce execution time.

When you start the computations, a progress bar appears.

If the WPM finds a solution, you will see this pop in the browser, inviting you togo to theResult Panel:

WPM succeeded

If the WPM fails, an error message will appear, prompting you to try again:

WPM failed

IMPORTANT If after launching WPM and generating the results, you realizethat one or more parameters do not work, you can always return to the“Parameters” tab and modify them. The data displayed in the “Results” tab willnot be automatically changed, you will have to click again on the “start WPM”button to take into account the new changes.

NOTE If you want to create a new plate plan for another project, pressctrl + f5, this will reset the application.


3.5 TheResults tab

The Result panel allows you to look at the final dataset containing the wellchosen for each sample, as well as a plot of your final well-plate map. Dataframe andplots are downloadable separately.

Final dataframe

The dataset contains 7 columns giving all the information needed to implement theexperiment: The sample name with its corresponding group; its ID for the plot;the well chosen; the row and the column to which the well corresponds to; and thenumber of the plate on which the sample must be placed.

This tab also shows the generated plot(s) of the final well-plate map(s).One color corresponds to one group label. The numbers are the IDs used inplace of the sample names which could be too long to keep the plot readable.

Below is an example of 80 samples distributed in 10 groups (of unequal sizes) and placed on a96 well-plate, with the North-South-East-West neighborhood constraint:

Plate map

4 Using the WPM in command lines

As explained before, the WPM can also be used through R command lines byfollowing these steps:

  1. Cast the dataset into the correct format
  2. Run the WPM
  3. Visualize the final plate plan(s)

4.1 Prepare the dataset

The user can work with CSV files,ExpressionSet,MSnSet orSummarizedExperimentobjects.The first step is to create a dataframe containing all the necessary information for the WPMto work correctly. Notably, it is needed to specify which column in the filecorresponds to the grouping factor, if any.

4.1.1 Starting from a CSV file:

imported_csv <- wpm::convertCSV("path-to-CSV-file")

4.1.2 Starting from anExpressionSet orMSnSet object

sample_names <- c("s1","s2","s3","s4", "s5")M <- matrix(NA, nrow = 4, ncol = 5)colnames(M) <- sample_namesrownames(M) <- paste0("id", LETTERS[1:4])pd <- data.frame(Environment = rep_len(LETTERS[1:3], 5),                 Category = rep_len(1:2, 5), row.names = sample_names)rownames(pd) <- colnames(M)my_MSnSet_object <- MSnbase::MSnSet(exprs = M,pData =  pd)

Then, runconvertESet by specifying the object and the variable to use asgrouping factor for samples:

df <- wpm::convertESet(my_MSnSet_object, "Environment")

4.1.3 Starting from aSummarizedExperiment

nrows <- 200ncols <- 6counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)colData <- data.frame(Treatment=rep(c("ChIP", "Input"), 3),                      row.names=LETTERS[1:6])se <- SummarizedExperiment::SummarizedExperiment(assays=list(counts=counts),                                                 colData=colData)df <- wpm::convertSE(se, "Treatment")

For more details about the functions, please use?wpm::<functionName> R command.

4.2 Run the WPM

The next step is to run thewrapperWPM function by giving it all the parametersneeded:

4.2.1 When using a CSV file

In the running toy example (see code shunks around), we do not specify any buffer well.

wpm_result <- wpm::wrapperWPM(user_df = imported_csv$df_wpm,            plate_dims = list(8,12),            nb_plates = 1,            forbidden_wells = "A1,A2,A3",            fixed_wells = "B1,B2",            spatial_constraint = "NS")

4.2.2 When using an R-structured dataset (ExpressionSet,MSnSet orSummarizedExperiment)

wpm_result <- wpm::wrapperWPM(user_df = df,            plate_dims = list(8,12),            nb_plates = 1,            forbidden_wells = "A1,A2,A3",            fixed_wells = "B1,B2",            spatial_constraint = "NS")
## 2025-10-31 20:51:41.82873 INFO::max_iteration: 20## 2025-10-31 20:51:41.844083 INFO:backtrack/map:nrow(c): 6## 2025-10-31 20:51:41.860245 INFO::plate number 1## 2025-10-31 20:51:41.876732 WARNING:fonctions.generateMapPlate:number of attempts: 1## 2025-10-31 20:51:41.879625 INFO:backtracking:class(new_df): data.frame

For more details, see?wpm::wrapperWPM

4.3 Plate map visualization

The final step is to create a visual output of the generated plate plan(s)using thedrawMap() function:

drawned_map <- wpm::drawMap(df = wpm_result,        sample_gps = length(levels(as.factor(colData$Treatment))),        gp_levels = gp_lvl <- levels(as.factor(colData$Treatment)),        plate_lines = 8,        plate_cols = 12,        project_title = "my Project Title")
drawned_map

For more details, see?wpm::drawMap

Plots can be saved with:

ggplot2::ggsave(    filename = "my file name",    plot = drawned_map,    width = 10,    height = 7,    units = "in")

IMPORTANT If multiple plates where specified, thenwpm_result will be alist containing a datasetfor each generated plate. Then, each of them can be accessed withwpm_result[[numberOfThePlate]]:

numberOfThePlate <- 1drawned_map <- wpm::drawMap(df = wpm_result[[numberOfThePlate]],        sample_gps = length(levels(as.factor(pd$Environment))),        gp_levels = gp_lvl <- levels(as.factor(pd$Environment)),        plate_lines = 8,        plate_cols = 12,        project_title = "my Project Title")

5 Citing Our work

Borges, H., Hesse, A. M., Kraut, A., Couté, Y., Brun, V., & Burger, T. (2021). Well Plate Maker: A user-friendly randomized block design application to limit batch effects in largescale biomedical studies. Bioinformatics (link to the publication).

6 SessionInfo

sessionInfo()
## R Under development (unstable) (2025-10-20 r88955)## Platform: x86_64-pc-linux-gnu## Running under: Ubuntu 24.04.3 LTS## ## Matrix products: default## BLAS:   /home/biocbuild/bbs-3.23-bioc/R/lib/libRblas.so ## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0## ## locale:##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              ##  [3] LC_TIME=en_GB              LC_COLLATE=C              ##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   ##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 ##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       ## ## time zone: America/New_York## tzcode source: system (glibc)## ## attached base packages:## [1] stats     graphics  grDevices utils     datasets  methods   base     ## ## other attached packages:## [1] BiocStyle_2.39.0## ## loaded via a namespace (and not attached):##   [1] rlang_1.1.6                 magrittr_2.0.4             ##   [3] clue_0.3-66                 matrixStats_1.5.0          ##   [5] compiler_4.6.0              vctrs_0.6.5                ##   [7] reshape2_1.4.4              stringr_1.5.2              ##   [9] ProtGenerics_1.43.0         pkgconfig_2.0.3            ##  [11] MetaboCoreUtils_1.19.0      crayon_1.5.3               ##  [13] fastmap_1.2.0               magick_2.9.0               ##  [15] XVector_0.51.0              rmarkdown_2.30             ##  [17] preprocessCore_1.73.0       tinytex_0.57               ##  [19] purrr_1.1.0                 xfun_0.54                  ##  [21] MultiAssayExperiment_1.37.0 cachem_1.1.0               ##  [23] jsonlite_2.0.0              DelayedArray_0.37.0        ##  [25] BiocParallel_1.45.0         parallel_4.6.0             ##  [27] cluster_2.1.8.1             R6_2.6.1                   ##  [29] bslib_0.9.0                 stringi_1.8.7              ##  [31] RColorBrewer_1.1-3          limma_3.67.0               ##  [33] GenomicRanges_1.63.0        jquerylib_0.1.4            ##  [35] Rcpp_1.1.0                  Seqinfo_1.1.0              ##  [37] bookdown_0.45               SummarizedExperiment_1.41.0##  [39] iterators_1.0.14            knitr_1.50                 ##  [41] IRanges_2.45.0              BiocBaseUtils_1.13.0       ##  [43] Matrix_1.7-4                igraph_2.2.1               ##  [45] tidyselect_1.2.1            dichromat_2.0-0.1          ##  [47] abind_1.4-8                 yaml_2.3.10                ##  [49] doParallel_1.0.17           codetools_0.2-20           ##  [51] affy_1.89.0                 lattice_0.22-7             ##  [53] tibble_3.3.0                plyr_1.8.9                 ##  [55] Biobase_2.71.0              withr_3.0.2                ##  [57] S7_0.2.0                    evaluate_1.0.5             ##  [59] Spectra_1.21.0              pillar_1.11.1              ##  [61] affyio_1.81.0               BiocManager_1.30.26        ##  [63] MatrixGenerics_1.23.0       foreach_1.5.2              ##  [65] stats4_4.6.0                wpm_1.21.0                 ##  [67] MSnbase_2.37.0              MALDIquant_1.22.3          ##  [69] ncdf4_1.24                  generics_0.1.4             ##  [71] S4Vectors_0.49.0            ggplot2_4.0.0              ##  [73] scales_1.4.0                glue_1.8.0                 ##  [75] lazyeval_0.2.2              tools_4.6.0                ##  [77] mzID_1.49.0                 QFeatures_1.21.0           ##  [79] vsn_3.79.0                  mzR_2.45.0                 ##  [81] fs_1.6.6                    XML_3.99-0.19              ##  [83] grid_4.6.0                  impute_1.85.0              ##  [85] tidyr_1.3.1                 MsCoreUtils_1.23.0         ##  [87] PSMatch_1.15.0              cli_3.6.5                  ##  [89] S4Arrays_1.11.0             dplyr_1.1.4                ##  [91] AnnotationFilter_1.35.0     pcaMethods_2.3.0           ##  [93] gtable_0.3.6                logging_0.10-108           ##  [95] sass_0.4.10                 digest_0.6.37              ##  [97] BiocGenerics_0.57.0         SparseArray_1.11.1         ##  [99] farver_2.1.2                htmltools_0.5.8.1          ## [101] lifecycle_1.0.4             statmod_1.5.1              ## [103] MASS_7.3-65

[8]ページ先頭

©2009-2025 Movatter.jp