107 lines
3.6 KiB
R
Executable file
107 lines
3.6 KiB
R
Executable file
#!/usr/bin/Rscript
|
|
getwd()
|
|
setwd('~/git/mosaic_2020/')
|
|
getwd()
|
|
########################################################################
|
|
# TASK: Extract relevant columns from mosaic fp adults data for regression
|
|
# clinical and sig meds
|
|
########################################################################
|
|
|
|
|
|
########################################################################
|
|
# meta data columns
|
|
meta_data_cols = c("mosaic"
|
|
, "gender"
|
|
, "age"
|
|
, "adult"
|
|
, "flustat"
|
|
, "type"
|
|
#, "obese2" #inc peaeds, but once you subset data for adults, its the same!
|
|
#, "height", "height_unit"
|
|
#, "weight", "weight_unit"
|
|
#, "ia_height_ftin", "ia_height_m", "ia_weight"
|
|
#, "visual_est_bmi", "bmi_rating"
|
|
, "obesity")
|
|
|
|
clinical_cols = c("death"
|
|
, "sfluv"
|
|
, "h1n1v"
|
|
, "ia_exac_copd"
|
|
, "onset_2_t1"
|
|
, "asthma"
|
|
, "vl_pfu_ul_npa1"
|
|
, "los"
|
|
, "onset2final"
|
|
, "onsfindeath"
|
|
, "onset_2_initial"
|
|
, "o2_sat_admis"
|
|
#, "o2_sat_suppl"
|
|
, "ethnicity"
|
|
, "smoking"
|
|
, "ia_cxr"
|
|
, "max_resp_score"
|
|
, "T1_resp_score"
|
|
, "com_noasthma"
|
|
, "T2_resp_score"
|
|
, "inresp_sev"
|
|
, "steroid")
|
|
|
|
#clinical_cols_added = c("age_bins"
|
|
# , "o2_sat_bin"
|
|
# , "onset_initial_bin"
|
|
# , "steroid_ics"
|
|
# , "t1_resp_recoded")
|
|
|
|
meta_clinical_cols = c(meta_data_cols, clinical_cols)
|
|
|
|
sig_npa_cols = c("eotaxin_npa1"
|
|
, "eotaxin3_npa1"
|
|
, "eotaxin3_npa2"
|
|
, "gmcsf_npa2"
|
|
, "ifnb_npa1"
|
|
, "ifnb_npa2"
|
|
, "il1_npa1"
|
|
, "il1_npa2"
|
|
, "il10_npa1"
|
|
, "il12p70_npa1"
|
|
, "il12p70_npa2"
|
|
, "il13_npa1"
|
|
, "il2_npa3"
|
|
, "il4_npa1"
|
|
, "il5_npa1"
|
|
, "il5_npa2"
|
|
, "il6_npa1"
|
|
, "il6_npa2"
|
|
, "il8_npa1"
|
|
, "il8_npa2"
|
|
, "il8_2_npa1"
|
|
, "il8_2_npa2"
|
|
, "ip10_npa1"
|
|
, "mcp4_npa1"
|
|
, "mcp4_npa2"
|
|
, "mdc_npa1"
|
|
, "mip17_npa1"
|
|
, "mip17_npa2"
|
|
, "neopterin_npa1"
|
|
, "rantes_npa1"
|
|
, "tarc_npa2"
|
|
, "tnf_npa2"
|
|
, "tnfr1_npa1"
|
|
, "tnfr1_npa2"
|
|
, "tnfr1_npa3"
|
|
, "tnfr2_npa1"
|
|
, "tnfr2_npa2"
|
|
, "tnfr2_npa3")
|
|
|
|
#cols_to_extract = c(clinical_cols, sig_npa_cols, clinical_cols_added)
|
|
|
|
#if ( length(cols_to_extract) == length(clinical_cols) + length(sig_npa_cols) + length(clinical_cols_added) ){
|
|
# cat("PASS: length match"
|
|
# , "\nTotal no. of cols to extract for regression:", length(cols_to_extract)
|
|
# , "\nNo. of clinical cols:", length(clinical_cols)
|
|
# , "\nNo. of sig npa cols: ", length(sig_npa_cols))
|
|
#}else{
|
|
# cat("FAIL: length mismatch"
|
|
# , "\nAborting!")
|
|
# quit()
|
|
#}
|