R/chmi.07_list_traits.source_files.R

Defines functions chmi.l_traits.source_files

#----------------------------
# Source files in CHMI Study
#----------------------------

#' @export
chmi.l_traits.source_files <- function(traits)
{
  ### pre-defined data
  covlist <- list(


   # chmi.l_traits.clinical()
    gender = c('[gender]'),
	  ppp_mal =	c('[ppp_mal]'),
    ppp_time = c('[ppp_time] `LACHMI-001_Patricia.xlsx`, `CHMI_Patricia.xlsx` and `T2A_km.xls`, for the T1 and T2'),
    ppp_tbs = c('[ppp_tbs] `qPCRdata_CHMI_Patricia.xlsx` and `TUCHMI-2A.xlsx`, for the L1 and T2'),
    ppp_mal_rtqpcr = c('[ppp_mal_rtqpcr] `LACHMI-001.xlsx`, `TUCHMI-1.xlsx`, `TUCHMI-2A.xlsx` and `TUCHMI-2B.xlsx`'),
    t_immuno = c('[t_immune]'),
    immune_status = c('[immune_status]'),
    status = c('[status]'),
    mal_exposure = c('[mal_exposure]'),
    group = c('[group]'),
    hb_status = c('[hb_status]'),
    mal_pos = c('[mal_pos] `qPCRdata_CHMI_Patricia.xlsx`'),
    tbs_pos = c('[tbs_pos] `qPCRdata_CHMI_Patricia.xlsx`'),
    pcr_pos = c('[pcr_pos] `chmi_pid_info_PG.xlsx`'),
    height = c('[height]'),
    weight = c('[weight]'),
    dose = c('[dose]'),
    allocation = c('[allocation]'),
    chmi = c('[chmi]'),
    protection = c('[protection]'),
    route = c('[route]'),
    t2_parasit = c('[t2_parasit]'),
    t2_malaria = c('[t2_malaria]'),
    l1_malaria = c('[l1_malaria]'),
    vaccine = c('[vaccine]'),
    gr_hbs = c('[gr_hbs]'),
    gr2_hb = c('[gr2_hb]'))
    

  ### select traits
    if(!missing(traits)) {
      stopifnot(all(traits %in% names(covlist)))
      covlist <- covlist[[traits]]

  ### case of a single trait
    if(length(traits)) {
    covlist <- unlist(covlist)
    }
  }
  return(covlist)
}
mvazquezs/chmitools documentation built on May 1, 2020, 2:06 a.m.