Plate Randomization Vignette

Olink DS team

2024-02-21

Introduction

This vignette describes how to use Olink® Analyze to randomize the samples with an option to keep subjects on the same plate. When a study is well randomized the experimental variables can be considered to be evenly distributed across each plate, even for a larger study. What variables to randomize for should be decided for each study as these vary with the study purpose. Correct sample randomization will empower your study and minimize the risk of introducing any bias that can confound downstream analyses. If at all possible, samples from the same subject that are taken at various times during a longitudinal research should all be placed on the same plate to further limit data fluctuation. In order to evenly disperse the remaining experimental variables between plates, the individuals should subsequently be distributed. If randomization is not performed true biological variation may be missed or misidentified as e.g. technical variations. However, it would be challenging for us to control every variable. Most of the time, a complete randomization will be carried out, and the outcomes can be assessed by visualizing the layout of the plates. In this vignette, you will learn how to achieve this using the olink_plate_randomizer() function. And on top of that, you will also learn how to use olink_displayPlateLayout() and olink_displayPlateDistributions() to evaluate the performed randomization based on a given grouping variable.

Sample randomization

The input manifest should be a tibble/data frame in long format containing all sample ID’s. Sample ID column must be named SampleID. An example manifest is shown in Table 1.

Table 1. Example of Sample manifest
SubjectID Visit SampleID Site
A 1 A 1 Site1
A 2 A 2 Site1
A 3 A 3 Site1
A 4 A 4 Site1
A 5 A 5 Site1
A 6 A 6 Site1
B 1 B 1 Site1
B 2 B 2 Site1
B 3 B 3 Site1
B 4 B 4 Site1

Complete randomization

The simplest way to randomize the samples is to perform complete randomization.

randomized.manifest <- olink_plate_randomizer(manifest, seed=123456)

Generate randomization scheme that keeps subjects on the same plate

In the case of multiple samples per subject (e.g. in longitudinal studies), Olink recommends keeping each subject on the same plate to further reduce variation in the data. The individuals should then be distributed so that the remaining experimental variables of interest are evenly distributed across plates. This could be achieved by using the SubjectColumn argument. The SubjectColumn argument must correspond to a column within the manifest and cannot be SampleID. If SubjectColumn is specified, every SampleID must have a value in the subject column, even if there is only 1 sample for that subject.

However, if there are to many samples per subject (>8), complete randomization is recommended. The number of samples on each plate could be specified via the available.spots argument. For example, the following code will lead to 78 samples on the first plate, and 30 samples on the second and the third plates. The number of iterations for fitting subjects on the same plate can be set by the iterations argument.

randomized.manifest <- olink_plate_randomizer(manifest,
                                                SubjectColumn="SubjectID", 
                                                available.spots=c(48,48,42), 
                                                iterations = 500,
                                                seed=123456)

The plate size can be either directly set to 48 or 96 using the PlateSize argument or can be inferred by setting the Product argument to “Target 96”, “Target 48”, “Explore 384”,“Explore 3072”, or “Explore HT.” The number of Olink external controls can be set using the num_ctrl argument, which defaults to 8 controls. The Olink external controls can also be set to be randomized throughout the plate using the rand_ctrl argument.

randomized_manifest <- olink_plate_randomizer(manifest, 
                                              Product = "Explore HT",
                                              SubjectColumn = "SampleID",
                                              num_ctrl = 10, 
                                              rand_ctrl = TRUE)
Table 2. Example of Randomized Sample manifest
SubjectID Visit SampleID Site plate column row well
W 2 2 W 2 Site2 Plate 1 Column 1 A A1
P 2 2 P 2 Site2 Plate 1 Column 1 B B1
G 1 1 G 1 Site1 Plate 1 Column 1 C C1
C 2 2 C 2 Site1 Plate 1 Column 1 D D1
I 4 4 I 4 Site1 Plate 1 Column 1 E E1
T 2 2 T 2 Site2 Plate 1 Column 1 F F1
D 3 3 D 3 Site1 Plate 1 Column 1 G G1
W 6 6 W 6 Site2 Plate 1 Column 1 H H1
C 6 6 C 6 Site1 Plate 1 Column 2 A A2
F 6 6 F 6 Site1 Plate 1 Column 2 B B2

Visualization

To illustrate the goodness of randomization, both olink_displayPlateLayout() and olink_displayPlateDistributions functions could be used.

Plate layouts

The olink_displayPlateLayout() function could be used to visualize the layouts of the plate and specifying the color for the variable of interest using the color_g argument. The label of the colored variable could be shown in the plot via the include.label argument.

olink_displayPlateLayout(randomized.manifest, fill.color = 'SubjectID', include.label = FALSE)
Figure 1. Randomized samples in 96 well plate format, colored by Subject ID.

Figure 1. Randomized samples in 96 well plate format, colored by Subject ID.

The label of the colored variable could be shown in the plot via the include.label argument.

olink_displayPlateLayout(randomized.manifest, fill.color = 'SubjectID', include.label = TRUE)
Figure 2. Randomized samples in 96 well plate format with labeled wells.

Figure 2. Randomized samples in 96 well plate format with labeled wells.

Plate distribution

The distribution of the given grouping variable on each plate could be visualized via a bar chart using function olink_displayPlateDistributions. By setting fill.color = 'SubjectID', we could make sure all the samples from the same subject were put on the same plate.

olink_displayPlateDistributions(randomized.manifest, fill.color = 'SubjectID')
Figure 3. Distribution of Subject ID across randomized plates.

Figure 3. Distribution of Subject ID across randomized plates.

We could also check the distribution of other variables. For examples, the distribution of the variable Site could be visualized by setting fill.color = 'Site'.

olink_displayPlateDistributions(randomized.manifest, fill.color = 'Site')
Figure 4. Distribution of Site across randomized plates.

Figure 4. Distribution of Site across randomized plates.

In the case of the randomization is not performed well, the randomization could be performed again with different seed number and iterations number.

Data Output

The output of the randomization function would be a “tibble” including SampleID, SubjectID etc. assigned to well positions. Columns include same columns as Manifest with additional columns:

The randomized manifest could be outputted as an Excel file using the write_xlsx function from Package writexl.

library(writexl)
write_xlsx(randomized.manifest,"randomized.manifest.xlsx")

Contact Us!

We are always happy to help. Email us with any questions: