Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Doc: Config Files

kmorrisongr edited this page Feb 17, 2020 · 1 revision

Config Files

Here is an example config file, fc_config_rv144.R:

# ---------------------------
# FILE LOCATIONS
# ---------------------------

source_dir = "../source/"
results_dir = "../results/"
fc_location = "../studies/rv144/data_2014/fc_800_trimmed.csv"
surv_location = "../studies/rv144/data_2014/survival_800.csv"

# RV144-specific; used for converting sample aliases to PIDs (rv144_bin)
samples_location = "../studies/rv144/data_2014/sample_ids_800.csv"
samples = read.csv(file=samples_location,stringsAsFactors=FALSE,header=TRUE)


# ---------------------------
# FEATURE FILTERING
# ---------------------------

if (!exists("keep_filter")){
	keep_filter = c()
}

if (!exists("discard_filter")){
	discard_filter = c()
}

if (!exists("k_behavior")){
	k_behavior = "permissive"
}

if (!exists("d_behavior")){
	d_behavior = "permissive"
}

if (!exists("flags")){
	flags = list()
}


# ---------------------------
# PARAMETERS
# ---------------------------

# Are experiments one directory level below fc_config.R?
flags$adj_cwd = TRUE


# ---------------------------
# GRAPHICS OPTIONS
# ---------------------------

if (!exists("gopts")){
	gopts = list()
}
gopts$time_cols = c("black")

# For everything not in feat_ant, you'll get the last ant_shape
gopts$feat_ant = c("gp120","gp140","V1.V2.","gag","p17,p24,p51,p55,p66")
gopts$ant_shapes = c(21,22,23,24,25,7)
gopts$feat_ant_legend = c("gp120","gp140","V1.V2.","gag","p-antigens")

# Put the least specific (like IgG) last to break out by subclass (really, by substring)
	# Put it first if you want them collapsed into a single category
	# http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
# For everything not in these categories, you'll get the last reag_col
gopts$reag_cats = c("IgG1","IgG2","IgG3","IgG4","FcgRIIa","FcgRIIb","FcgRIIIa","FcgRIIIb","C1q","IgG")
gopts$reag_cols = c("blue","pink","turquoise1","saddlebrown","forestgreen","purple","gold","orange","green","black","orchid")

# How we decide what the categories for boxplots, longitudinal plots, etc. are
gopts$plot_antigens = c("gp41.HxBc2","gp41.Ectodomain..HIV.1.","P1.PE.synthetic.lipopeptide")

gopts$volc_xlim = c(-2,2)
gopts$volc_ylim = c(0,4)
gopts$reag_legend_inset = c(-0.20,0) 

Load Fc Analysis Config .R File

fc_load_config(config_location, experiment_name, flags, gopts, fc=NULL, only_group=NULL, bin_method=NULL, ref_group=NULL)

  • Loads the contents of the provided config file, performs data imputation, any specified filtering, binning, and prints out sessionInfo().
  • @param config_location A string specifying the file path to the config.R file, relative to the location from which this function is called, or an absolute file path.
  • @param experiment_name A string specifying the name of the current experiment. Will be used to create a separate subdirectory for results.
  • @param fc The Fc Array data frame. NULL means that it will be loaded from the location specified in the config.R file. If an Fc Array data frame is passed, then it will be subjected to the filtering, binning, etc. that you have specified.
  • @param bin_method If flags$do_bin is TRUE, this is the function you will use to assign new groups.
  • @param ref_group If flags$do_differs is TRUE, this is a string specifying the group you want to define as baseline.
  • @return A list containing the Fc Array data frame modified to your specifications, and the new results_dir string for this experiment, etc

Clone this wiki locally