Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit new vignettes and add to help page #27

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/mod_multi_loc_prep.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ mod_multi_loc_preps_ui <- function(id){
),
selectInput(
inputId = ns("plant_copies_preps"),
label = "# of Copies Per Plant:",
label = "# of Copies Per Entry:",
choices = 1:6
),
selectInput(
Expand Down
2 changes: 1 addition & 1 deletion R/mod_sparse_allocation.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mod_sparse_allocation_ui <- function(id) {
),
selectInput(
inputId = ns("plant_reps"),
label = "# of Copies Per Plant:",
label = "# of Copies Per Entry:",
choices = 1:6
),
selectInput(
Expand Down
8 changes: 8 additions & 0 deletions inst/app/www/Help.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ <h3> Unreplicated Designs</h3>

<a href="https://didiermurillof.github.io/FielDHub/articles/RCBD_augmented.html" target="_blank">Augmented RCBD</a>

<br>

<a href="https://didiermurillof.github.io/FielDHub/articles/sparse_allocation.html" target="_blank">Sparse Allocation</a>

<br>

<h3>Partially Replicated Designs</h3>
Expand All @@ -40,6 +44,10 @@ <h3>Partially Replicated Designs</h3>

<br>

<a href="https://didiermurillof.github.io/FielDHub/articles/multi_location_prep.html" target="_blank">Optimized Multi-Location Partially Replicated Design</a>

<br>

<h3>Lattice Designs</h3>

<a href="https://didiermurillof.github.io/FielDHub/articles/square_lattice.html" target="_blank">Square Lattice Design</a>
Expand Down
18 changes: 8 additions & 10 deletions vignettes/multi_location_prep.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ the `FielDHub` R package.

## Overview

Partially replicated designs are frequently used in initial generation field trials. This design type involves replicating a portion of the entries, while the remaining entries only appear once in the experiment. The optimized partially replicated (p-rep) design utilizes a genotype allocation matrix to determine the distribution of replicated and non-replicated entries across multiple locations, employing the principles of incomplete blocks
designs (IBD).
Partially replicated designs are frequently used in initial generation field trials. This design type involves replicating a portion of the entries, while the remaining entries only appear once in the experiment. The optimized partially replicated (p-rep) design utilizes a genotype allocation matrix to determine the distribution of replicated and non-replicated entries across multiple locations, employing the principles of incomplete block designs (IBD).

## Use case

Suppose there is a plant breeding field trial with 150 entries to be tested across five environments, where up to seven replications of each entry are allowed. Additionally, the project includes three checks; each replicated six times. We can generate an optimized multi-location partially replicated design using these parameters. This strategy guaranty that all treatments are present in all environments but in different amounts of replications. We can generate this design using the FielDHub Shiny app and the FielDHub multi_location_prep() standalone function in R.
Suppose there is a plant breeding field trial with 150 entries to be tested across five environments, where up to seven replications of each entry are allowed. Additionally, the project includes three checks; each replicated six times. We can generate an optimized multi-location partially replicated design using these parameters. This strategy guarantees that all treatments are present in all environments but in different amounts of replications. We can generate this design using the FielDHub Shiny app and the FielDHub `multi_location_prep()` standalone function in R.

## Running the Shiny App

Expand Down Expand Up @@ -189,10 +188,10 @@ The description for the inputs that we used to generate the design,
* `lines = 150` is the number of entries in the field.
* `l = 5` is the number of locations.
* `copies_per_entry = 7` is the number of copies of each entry.
* `checks = 3` (Optional) is the number of checks.
* `rep_checks = c(6,6,6)` (Optional) is the number of replications of each check,
* `checks = 3` is the (optional) number of checks.
* `rep_checks = c(6,6,6)` is the (optional) number of replications of each check,
in a vector the length of the number of checks.
* `locationNames = c("LOC1", "LOC2", "LOC3", "LOC4", "LOC5")` are optional names for the locations.
* `locationNames = c("LOC1", "LOC2", "LOC3", "LOC4", "LOC5")` are optional names for the locations.
* `seed = 2456` is the random seed to replicate identical randomizations.

### Print `optim_multi_prep` object
Expand All @@ -217,9 +216,8 @@ print(head(optim_multi_prep$allocation, 10))
print(head(optim_multi_prep$allocation, 10))
```

Let us add two new columns to the allocation table. We can ad the number of copies by genotype,
it should be 7 for all of them. Also we can add the average allocation by genotype, we can see each
treatment will appear 1.4 times in average.
Let us add two new columns to the allocation table. We can add the number of copies by genotype;
it should be 7 for all of them. We can also add the average allocation by genotype. Each treatment will appear 1.4 times in average.

```{r, echo=FALSE, eval=TRUE}
optim_multi_prep$allocation %>%
Expand All @@ -234,7 +232,7 @@ optim_multi_prep$allocation %>%
```

We can manipulate the sparse_allocation object as any other list in R. For example, we can save the
design randomizations to an object called `designs`, and then index based on location using the dollar
design randomizations to an object called `designs`, and then index based on location using the dollar
sign operator. We can first display the design parameters for `LOC1` with the following code:

```{r, echo=TRUE, eval=FALSE}
Expand Down
13 changes: 6 additions & 7 deletions vignettes/sparse_allocation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ allocation %>%

The table illustrates the allocation of genotypes across different environments, with genotypes listed
in rows and environments in columns. Specifically, it indicates that Genotype 1 (Gen-1) has been
assigned to locations 1, 2, and 4, but not to environment 3. The allocation process for genotypes to
assigned to locations 1, 2, 3, and 4, but not to environment 5. The process of allocating genotypes to
locations is achieved through an optimization process that employs IBD principles.

## Running the Shiny App
Expand Down Expand Up @@ -104,7 +104,7 @@ Then, follow the following steps where we will show how to generate a sparse all
1. **Import entries' list?** Choose whether to import a list with entry numbers and names for genotypes
or treatments.

* If the selection is `No`, that means the app is going to generate synthetic data for entries and
* If the selection is `No`, the app will generate synthetic data for entries and
names of the treatment/genotypes based on the user inputs.

* If the selection is `Yes`, the entries list must fulfill a specific format and must be a `.csv`
Expand Down Expand Up @@ -232,9 +232,9 @@ sparse_example <- sparse_allocation(
* `l = 5` is the number of locations.
* `copies_per_entry = 4` is the number of copies of each entry.
* `checks = 4` is the number of checks.
* `plotNumber = c(1, 1001, 2001, 3001, 4001)` Optional starting plot numbers
* `locationNames = c("FARGO", "CASSELTON", "MINOT", "PROSPER", "WILLISTON")` Optional name for each location.
* `exptName = "SparseTest2023"` Optional name of the experiment
* `plotNumber = c(1, 1001, 2001, 3001, 4001)` are optional starting plot numbers
* `locationNames = c("FARGO", "CASSELTON", "MINOT", "PROSPER", "WILLISTON")` are optional names for each location.
* `exptName = "SparseTest2023"` is an optional name of the experiment
* `seed = 16` is the random seed number to replicate identical randomizations.

### Print `sparse_example` object
Expand Down Expand Up @@ -313,7 +313,6 @@ head(field_book, 10)

### Plot field layout


#### Plot field layout Location 1

For plotting the layout in function of the coordinates `ROW` and `COLUMN` in the field book object we
Expand All @@ -332,7 +331,7 @@ plot(design_randomization$LOC2)
```

The figure above shows a map of an experiment randomized as an unreplicated arrangement design.
Salmon plots represent the unreplicated treatments, while the yellow-boxed colored check plots are
The salmon plots represent the unreplicated treatments, while the yellow-boxed colored check plots are
replicated throughout the field in a systematic diagonal arrangement. The red plots with 0s are are fillers.

<br>
Expand Down