Convert templates in Jeanette Lyerly's format into T3/Breedbase upload templates

formatTemplates(
  input_file,
  output_dir,
  breeding_program,
  species_name,
  design_type = "RCBD",
  location_tab = "Location Data Form",
  summary_tab = "Summary Data Form",
  data_descriptors_tab = "Data_DESCRIPTORS",
  trial_codes_tab = "TRIAL_CODES",
  location_data_start_row = 3,
  cooperator_start_row = 1,
  summary_data_start_row = 8,
  data_descriptors_start_row = 1,
  trial_codes_start_row = 2,
  trial_codes_start_col = "C",
  year_codes_start_col = "E",
  location_codes_start_col = "J",
  trait_definitions = list(),
  confirm_data = TRUE,
  write_templates = TRUE,
  increment_year = FALSE,
  standardize_trial_names = FALSE,
  trial_name_prefix = NA
)

Arguments

input_file

(required) path to input excel file containing the data to format

output_dir

(required) path to output directory where the accessions, location, trials, and observations templates will be saved

breeding_program

(required) name of breeding program to apply to all trials

species_name

(required) name of species to apply to all accessions

design_type

Trial Design Type applied to all trials (default: RCBD)

location_tab

Name of tab that includes the location data (default: Location Data Form)

summary_tab

Name of tab that includes the summary data (default: Summary Data Form)

data_descriptors_tab

Name of tab that includes the trait codes and their definitions (default: Data_DESCRIPTORS)

trial_codes_tab

Name of tab that includes the trial, year, and location codes (default: TRIAL_CODES)

location_data_start_row

The index of the row that has the header columns for the location data (default: 3)

cooperator_start_row

The index of the row that has the cooperator info in the summary tab (default: 1)

summary_data_start_row

The index of the row that has the header columns for the summary data (default: 8)

data_descriptors_start_row

The index of the row that has the first headers for the data descriptors tables (default: 1)

trial_codes_start_row

The index of the row that has the headers for the trial codes table (default: 2)

trial_codes_start_col

The index of the col that has the values for the trial codes table (default: C)

year_codes_start_col

The index of the col that has the values for the year codes table (default: E)

location_codes_start_col

The index of the col that has the values for the location codes table (default: J)

trait_definitions

Additional trait definitions (this should be a list where the key is the name of the trait in the input data and the value is the trait header used in the breedbase template)

confirm_data

Flag to print input data and have user confirm it is parsed correctly (default: TRUE)

write_templates

Flag to have the function generate output templates (default: TRUE)

increment_year

Flag to increment the year defined in the trial (used for winter crops where the input data is using the planting year as the year and we want to use the harvest year as the year) (default: FALSE)

standardize_trial_names

Flag to generate standardized trial names in the format (PREFIX_YEAR_LOCATION) (Default: False, will use the Trial column in the input data)

trial_name_prefix

When standardize_trial_names is set to True, this will be the prefix used in the generated trial names