Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
43c454c
adding trial allocation option
chris263 Apr 15, 2025
2d4514e
adding checks for trial allocation, avoiding override
chris263 Apr 15, 2025
4d639ef
finishing layout
chris263 Apr 15, 2025
ed035bc
handle field grid layout faster
chris263 Apr 15, 2025
1f1665d
organizing javaScript in a separated file
chris263 Apr 16, 2025
fea37ad
adding controllers
chris263 Apr 17, 2025
a4a50cd
adding RCBD to the layout
chris263 Apr 20, 2025
9c4964c
fixing R code for trial allocation, fixing controllers and still work…
chris263 Apr 21, 2025
68f1bb7
fixing trial names available
chris263 Apr 21, 2025
82934b1
adding row and col number to the trial design
chris263 Apr 22, 2025
bd02dc1
fixing block color
chris263 Apr 22, 2025
cc9680f
fixing RCBD
chris263 Apr 23, 2025
ed79d70
Merge branch 'master' into topic/new_trial_design_method
chris263 Apr 23, 2025
aef8194
adding designs to trial allocation
chris263 Apr 24, 2025
50570b2
fixing augmented row column and fixing view problems
chris263 May 8, 2025
7b94d50
Merge branch 'master' into topic/new_trial_design_method
chris263 May 9, 2025
62f2e16
Merge branch 'master' into topic/new_trial_design_method
chris263 May 29, 2025
e784231
Merge branch 'master' into topic/new_trial_design_method
chris263 Jun 1, 2025
21b61fe
Merge remote-tracking branch 'origin/master' into topic/new_trial_des…
chris263 Jun 30, 2025
4310399
fixing augmented row column
chris263 Jun 30, 2025
5379136
Merge branch 'topic/new_trial_design_method' of github.com:solgenomic…
chris263 Jun 30, 2025
4d4e9a7
adding trial allocation option
chris263 Apr 15, 2025
8694651
adding checks for trial allocation, avoiding override
chris263 Apr 15, 2025
3efab74
finishing layout
chris263 Apr 15, 2025
126d863
handle field grid layout faster
chris263 Apr 15, 2025
fc5c4af
organizing javaScript in a separated file
chris263 Apr 16, 2025
080f586
adding controllers
chris263 Apr 17, 2025
f1572a9
adding RCBD to the layout
chris263 Apr 20, 2025
19d9716
fixing R code for trial allocation, fixing controllers and still work…
chris263 Apr 21, 2025
f488672
fixing trial names available
chris263 Apr 21, 2025
b78c19d
adding row and col number to the trial design
chris263 Apr 22, 2025
700e611
fixing block color
chris263 Apr 22, 2025
a628e77
fixing RCBD
chris263 Apr 23, 2025
88e68ad
adding designs to trial allocation
chris263 Apr 24, 2025
3469579
fixing augmented row column and fixing view problems
chris263 May 8, 2025
fe09508
fixing augmented row column
chris263 Jun 30, 2025
88e57f8
fixing trial allocation
chris263 Apr 28, 2026
f8dcfa3
updating multi trial allocation with planting tool
chris263 Apr 28, 2026
2a08bfb
updating augmented row column design, adding graphics for area view
chris263 Apr 29, 2026
2c78ea4
fixing checks allocation for ARCD
chris263 Apr 30, 2026
511033a
changing treatments to accession
chris263 Apr 30, 2026
4da4d3d
cleaning unecessary file
chris263 Apr 30, 2026
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
15 changes: 13 additions & 2 deletions R/DRRC.r
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

args=commandArgs(TRUE)

Check warning on line 2 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=2,col=5,[infix_spaces_linter] Put spaces around all infix operators.

Check warning on line 2 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=2,col=5,[assignment_linter] Use one of <-, <<- for assignment, not =.

##args is now a list of character vectors
## First check to see if arguments are passed.
## Then cycle through each element of the list and evaluate the expressions.

if(length(args)==0){

Check warning on line 8 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=8,col=20,[paren_body_linter] Put a space between a right parenthesis and a body expression.

Check warning on line 8 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=8,col=20,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 8 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=8,col=16,[infix_spaces_linter] Put spaces around all infix operators.

Check warning on line 8 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=8,col=3,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
print("No arguments supplied.")

Check warning on line 9 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=9,col=4,[indentation_linter] Indentation should be 2 spaces but is 4 spaces.
##supply default values
paramfile=''

Check warning on line 11 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=11,col=15,[quotes_linter] Only use double-quotes.

Check warning on line 11 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=11,col=14,[infix_spaces_linter] Put spaces around all infix operators.
} else {
for(i in 1:length(args)){

Check warning on line 13 in R/DRRC.r

View workflow job for this annotation

GitHub Actions / Lint

file=/github/workspace/R/DRRC.r,line=13,col=4,[indentation_linter] Indentation should be 2 spaces but is 4 spaces.
print(paste("Processing arg ", args[[i]]));
eval(parse(text=args[[i]]))
}
Expand All @@ -22,7 +22,8 @@

source(paramfile)
## 1) Preparing dataframe
all.clones <- treatments
if (!exists("engine", inherits = FALSE)) engine <- "breedbase"
if(engine == 'trial_allocation'){ all.clones <- c(treatments, controls) } else { all.clones <- treatments }
nTrt <- length(all.clones)
nRep <- nRep
nRows <- nRow
Expand All @@ -34,7 +35,10 @@
totalPlots <- nTrt*nRep

plot_type <- plot_type
plot_start <- plot_start

plot_start = 1
if( serie == 2){ plot_start <- 101 }
if( serie == 3){ plot_start <- 1001 }

blocks = data.frame(block_number = gl(nRep,nTrt),
Cols = gl(superCols,colsPerBlock,totalPlots),
Expand Down Expand Up @@ -106,6 +110,13 @@

design <- fieldBook %>% dplyr::select(block_number, rep_number, row_number, col_number, plot_number, accession_name, is_a_control)

if(engine == 'trial_allocation'){
design <- design %>% dplyr::select(plot_number, block_number, accession_name, rep_number, is_a_control)
colnames(design) <- c("plots", "block", "all_entries", "rep", "is_control")
}



head(design)

# save result files
Expand Down
60 changes: 60 additions & 0 deletions R/RCBD.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Create Randomized Complete Block Designs
args = commandArgs(TRUE)

if(length(args)==0){
print("No arguments supplied.")
##supply default values
paramfile=''
} else {
for(i in 1:length(args)){
print(paste("Processing arg ", args[[i]]));
eval(parse(text=args[[i]]))
}
}

source(paramfile)
basefile <- tools::file_path_sans_ext(paramfile)

# Printing variables:
print(treatments)
print(controls)
print(n_rep)
print(n_row)
print(n_col)
print(n_blocks)
print(serie)

## Preparing design
library(FielDHub)
library(dplyr)

all_entries <- c(treatments, controls)
new_seed <- sample(1:1e6, 1)

init_plot = 1
if( serie == 2 ){ init_plot = 101}
if( serie == 3 ){ init_plot = 1001}


## Design
outdesign <- RCBD(t = length(all_entries), reps = n_blocks, plotNumber = init_plot, seed = new_seed)

## Extracting field book
book <- outdesign$fieldBook

## Adding treatment names
book$TREATMENT <- all_entries[match(book$TREATMENT, paste0("T", seq_along(all_entries)))]
book$block <- book$REP

## setting controls
book$is_control <- 0
book[book$TREATMENT %in% controls, "is_control"] <- 1
book <- book %>% select(PLOT, block, TREATMENT, REP, is_control)

colnames(book) <- c("plots", "block", "all_entries", "rep", "is_control")
head(book, 10)

outfile <- paste0(basefile, ".design")
sink(outfile)
write.table(book, quote = FALSE, sep = '\t', row.names = FALSE)
sink()
Loading
Loading