Package: designit 0.5.0.9000

Iakov I. Davydov

designit: Blocking and Randomization for Experimental Design

Intelligently assign samples to batches in order to reduce batch effects. Batch effects can have a significant impact on data analysis, especially when the assignment of samples to batches coincides with the contrast groups being studied. By defining a batch container and a scoring function that reflects the contrasts, this package allows users to assign samples in a way that minimizes the potential impact of batch effects on the comparison of interest. Among other functionality, we provide an implementation for OSAT score by Yan et al. (2012, <doi:10.1186/1471-2164-13-689>).

Authors:Iakov I. Davydov [aut, cre, cph], Juliane Siebourg-Polster [aut, cph], Guido Steiner [aut, cph], Konrad Rudolph [ctb], Jitao David Zhang [aut, cph], Balazs Banfai [aut, cph], F. Hoffman-La Roche [cph, fnd]

designit_0.5.0.9000.tar.gz
designit_0.5.0.9000.zip(r-4.7)designit_0.5.0.9000.zip(r-4.6)designit_0.5.0.9000.zip(r-4.5)
designit_0.5.0.9000.tgz(r-4.6-any)designit_0.5.0.9000.tgz(r-4.5-any)
designit_0.5.0.9000.tar.gz(r-4.7-any)designit_0.5.0.9000.tar.gz(r-4.6-any)
designit_0.5.0.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
designit/json (API)

# Install 'designit' in R:
install.packages('designit', repos = c('https://bedapub.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/bedapub/designit/issues

Pkgdown/docs site:https://bedapub.github.io

Datasets:

On CRAN:

Conda:

design-of-experimentsrandomization

6.73 score 9 stars 30 scripts 646 downloads 32 exports 31 dependencies

Last updated from:47079e63f9. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK184
source / vignettesOK429
linux-release-x86_64OK197
macos-release-arm64OK108
macos-oldrel-arm64OK115
windows-develOK145
windows-releaseOK212
windows-oldrelOK112
wasm-releaseOK182

Exports:accept_leftmost_improvementassign_from_tableassign_in_orderassign_randombatch_container_from_tableBatchContainerBatchContainerDimensioncompile_possible_subgroup_allocationcomplete_random_shufflingdrop_orderfirst_score_onlyform_homogeneous_subgroupsgenerate_termsget_orderL1_normL2s_normmk_exponentially_weighted_acceptance_funcmk_plate_scoring_functionsmk_simanneal_acceptance_funcmk_simanneal_temp_funcmk_subgroup_shuffling_functionmk_swapping_functionoptimize_designoptimize_multi_plate_designosat_scoreosat_score_generatorplot_plateshuffle_grouped_datashuffle_with_constraintsshuffle_with_subgroup_formationsum_scoresworst_score

Dependencies:assertthatclicpp11data.tabledplyrfarvergenericsggplot2gluegtableisobandlabelinglifecyclemagrittrpillarpkgconfigpurrrR6RColorBrewerrlangS7scalesstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithr

Batch effects and false positives: a simulation study
A simple case study about plate effect: the background | Simulating a study in which randomization is not used | Randomization prevents plate effect from interfering with inferences | Discussions and conclusions

Last update: 2024-11-11
Started: 2024-10-16

Basic example of using designit: plate layout with two factors
The samples and the conditions | Plate layout requirements | Setting up a BatchContainer object | Moving samples | Running an optimization | Customizing the plate layout | Summary | Session information

Last update: 2024-10-16
Started: 2022-10-13

OSAT and scoring functions
Running OSAT optimization | Visualize for plates | Compare scores with various implementations | Run using BatchContainer | Using designit OSAT score implementation | Manually work with data.table | Shuffle optimization with burn-in | Score demonstration

Last update: 2024-10-16
Started: 2022-10-13

Plate layouts

Last update: 2024-03-13
Started: 2022-10-13

designit: a flexible engine to generate experiment layouts
Introduction | Batch effects matter | Go fully random? | designit | Sample Batching | Setup | Optimization | Plate layouts | Continuous confounding | 2-step optimization | Across plate optimization using osat score as before | Within plate optimization using distance based sample scoring function | 2-step optimization multi_plate_layout() | Glimpse on more complex application | Conclusion

Last update: 2024-03-13
Started: 2023-02-06

In-vivo study design
Purpose of vignette | Dataset and design task | The animal (sample) sheet | Treatment list | Design constraints and data preparation | Design steps | Assign treatments to animal list | Populate cages | Arrange cages in rack(s)

Last update: 2024-03-13
Started: 2022-10-13

Nested dimension example
Sample annotation overview | Task | Optimize batch | Optimization trace | Final batch layout | Repeat but use shuffle with contraints | Optimize runs within batch | Final run layout

Last update: 2024-03-13
Started: 2022-10-13

Optimizer examples
Sample annotation overview | Task | Setting up batch container | First optimization with fixed shuffling protocol | Optimization trace | Final batch layout | Perform new iterations on optimized batch container | Optimization with specified stopping criteria | Optimization with multi-variate scoring function | Auto-scaling scores | Passing a customized shuffling function | Using simulated annealing (SA) for optimization | Full blown example

Last update: 2024-03-13
Started: 2022-10-13

Shuffling with constraints
Purpose of the vignette | The design problem | Samples and treatments | Subgroup related constraints | Doing it all in one go | Multiple step approach | Form homogeneous subgroups - pools of animals that could go into one cage | Find all valid ways to allocate treatments to the subgroups | Generate shuffling function for potential study designs | Use shuffling function for optimizing design

Last update: 2024-03-13
Started: 2022-10-13

Using custom shuffle schedule

Last update: 2024-03-13
Started: 2022-10-13

Readme and manuals

Help Manual

Help pageTopics
Alternative acceptance function for multi-dimensional scores in which order (left to right, e.g. first to last) denotes relevance.accept_leftmost_improvement
Distributes samples based on a sample sheet.assign_from_table
Distributes samples in order.assign_in_order
Assignment function which distributes samples randomly.assign_random
Creates a BatchContainer from a table (data.frame/tibble::tibble) containing sample and location information.batch_container_from_table
R6 Class representing a batch container.BatchContainer
R6 Class representing a batch container dimension.BatchContainerDimension
Compile list of all possible ways to assign levels of the allocation variable to a given set of subgroupscompile_possible_subgroup_allocation
Reshuffle sample indices completely randomlycomplete_random_shuffling
Drop highest order interactionsdrop_order
Aggregation of scores: take first (primary) score onlyfirst_score_only
Form groups and subgroups of 'homogeneous' samples as defined by certain variables and size constraintsform_homogeneous_subgroups
Generate 'terms.object' (formula with attributes)generate_terms
Get highest order interactionget_order
A sample list from an in vivo experiment with multiple treatments and 2 strainsinvivo_study_samples
A treatment list together with additional constraints on the strain and sex of animalsinvivo_study_treatments
Aggregation of scores: L1 normL1_norm
Aggregation of scores: L2 norm squaredL2s_norm
Create locations table from dimensions and exclude tablelocations_table_from_dimensions
Subject sample list with group and time plus controlslongitudinal_subject_samples
Alternative acceptance function for multi-dimensional scores with exponentially downweighted score improvements from left to rightmk_exponentially_weighted_acceptance_func
Create a list of scoring functions (one per plate) that quantify the spatially homogeneous distribution of conditions across the platemk_plate_scoring_functions
Generate acceptance function for an optimization protocol based on simulated annealingmk_simanneal_acceptance_func
Create a temperature function that returns the annealing temperature at a given step (iteration)mk_simanneal_temp_func
Created a shuffling function that permutes samples within certain subgroups of the container locationsmk_subgroup_shuffling_function
Create function to propose swaps of samples on each call, either with a constant number of swaps or following a user defined protocolmk_swapping_function
Unbalanced treatment and time sample listmulti_trt_day_samples
Generic optimizer that can be customized by user provided functions for generating shuffles and progressing towards the minimal scoreoptimize_design
Convenience wrapper to optimize a typical multi-plate designoptimize_multi_plate_design
Compute OSAT score for sample assignment.osat_score
Convenience wrapper for the OSAT scoreosat_score_generator
Example dataset with a plate effectplate_effect_example
Plot plate layoutsplot_plate
Generate in one go a shuffling function that produces permutations with specific constraints on multiple sample variables and group sizes fitting one specific allocation variableshuffle_grouped_data
Shuffling proposal function with constraints.shuffle_with_constraints
Compose shuffling function based on already available subgrouping and allocation informationshuffle_with_subgroup_formation
Aggregation of scores: sum up all individual scoressum_scores
Validates sample data.frame.validate_samples
Aggregation of scores: take the maximum (i.e. worst score only)worst_score