R/chmi.07_list_traits.units_ranges.R

Defines functions chmi.l_traits.units_ranges

#-----------------------------
# Range & units in CHMI Study
#-----------------------------

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

    # chmi.l_traits.id()
    original_id = c('[original_id] unknown'),
    dataset = c('[dataset] L1, T1 and/or T2'),


   # chmi.l_traits.clinical()
    gender = c('[gender] M or F'),
	  ppp_mal =	c('[ppp_mal] in days'),
    ppp_time = c('[ppp_time] in days'),
    ppp_tbs = c('[ppp_tbs] in days'),
    ppp_mal_rtqpcr = c('[ppp_mal_rtqpcr] in days'),
    t_immuno = c('[t_immune]  naive, sterile, symptomatic or asymptomatic'),
    immune_status = c('[immune_status] naive, semi_immune, vaccinated_3200, vaccinated_12800 & vaccinated_51200'),
    status = c('[status] naive, semi_immune and PfSPZ_vaccinated levels'),
    mal_exposure = c('[mal_exposure] placebo, naive, semi_immune and vaccinated levels'),
    group = c('[group] NI, IS & IA'),
    hb_status = c('[hb_status] AA or AS'),
    mal_pos = c('[mal_pos] presence (1)/absence (0)'),
    tbs_pos = c('[tbs_pos] presence (1)/absence (0)'),
    pcr_pos = c('[pcr_pos] presence (1)/absence (0)'),
    height = c('[height] in meters (m)'),
    weight = c('[weight] in kilograms (kg)'),
    dose = c('[dose] 50, 200, 2500, 3200, 12800, 51200'),
    allocation = c('[allocation] `verum` or placebo)'),
    chmi = c('[chmi] infected (1)/not infected (0)'),
    protection = c('[protection] protected (1)/not protected (0)'),
    route = c('[route_ori] unknown'),
    t2_parasit = c('[t2_parasit] unknown'),
    t2_malaria = c('[t2_malaria] unknown'),
    l1_malaria = c('[l1_malaria] unknown'),
    gr_hbs = c('[gr_hbs] naive, AA or AS'),
    gr2_hb = c('[gr2_hb] naive or A_'),
    vaccine = c('[vaccine] depends on study (naive, semi_immune, placebo, 12800, 3200, 51200)'),


   	# chmi.l_traits.ab()
    t_igg = c('[t_igg] IgG, IgG1, IgG2, IgG3, IgG4 or IgM'),
    antigen = c('[antigen] 21 antigens (roled into `chmitools` readme.md file)'),
    t_point = c('[t_point] C_1, D5, D7, D11, D13, DM, D19, D28 or D84 in days'),
    study_number = c('number of individual'),
    plate = c('[plate] number of plate'),
    batch = c('[batch] number of batch'),
    mfi = c('[mfi] unit of fluorescence'),
    min_half = c('[min_half] unit of fluorescence'),
    mfi_imp = c('[mfi_imp] unit of fluorescence'),
    dil = c('[dil] unit of dilution'),
    mfi_adj = c('[mfi_adj] unit of fluorescence'),
    mean_ratio = c('[mean_ratio] ratio in unit of fluorescence'),
    mfi_corr = c('[mfi_corr] unit of fluorescence'),
    log10_mfi = c('[log10_mfi] unit of fluorescence'),
    t2_point = c('[t2_point] C_1, D7, D11_D13, D19, D28 or D84 in days'),
    fc_mfic = c('[fc_mfic] ratio'),
    fc_mfic_c1 = c('[fc_mfi_c1] unit of fluorescence'),
    fc_log10_mfi = c('[fc_log10_mfic] ratio'),


    # chmi.l_traits.pbmc()
		date = c('[date] %m%d%Y'),
		ct_marker = c('[ct_marker] CD1c, IgG, IgM, PD1 or total Bcell population'),
		cell_population = c('[cell_population] aa_mbc, ac_mbc, act_naive, mzb_cd1_c mzb_cd1c_no_igm, naive, pb_gc, ra_mbc, rc_mbc & vbc_cd10'),
    ct_value = c('[ct_value] percentage (%)'),
    fact_marker = c('[fact_marker] marker, no_marker & na_marker'),
    rt_value_c1 = c('[rt_value_c1] unit of fluorescence'),
    rt_value = c('[rt_value] ratio'))


  ### 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.