This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
keller_and_evans_lab:gscan_db_ga_p [2017/02/14 21:14] scott /* Phenotypes */ |
keller_and_evans_lab:gscan_db_ga_p [2019/10/31 12:28] (current) 66.249.87.23 ↷ Links adapted because of a move operation |
||
---|---|---|---|
Line 576: | Line 576: | ||
====== ARIC ====== | ====== ARIC ====== | ||
- | |||
- | (Hannah/ | ||
- | |||
- | ===== ID Mapping ===== | ||
Line 864: | Line 860: | ||
### sort ARIC.AFR.covariates.ped | uniq > ARIC.AFR.covariates.ped | ### sort ARIC.AFR.covariates.ped | uniq > ARIC.AFR.covariates.ped | ||
- | |||
- | |||
- | |||
- | ===== Genotypes ===== | ||
Line 878: | Line 870: | ||
===== Phenotypes ===== | ===== Phenotypes ===== | ||
- | Description of phenotypes can be found here: {{file_mesa_phenotypes_-_final.pdf}} | + | Description of phenotypes can be found here: {{:file_mesa_phenotypes_-_final.pdf}} |
====== eMERGE ====== | ====== eMERGE ====== | ||
- | (Hannah/ | ||
===== Phenotypes ===== | ===== Phenotypes ===== | ||
- | Description of phenotypes | + | |
+ | |||
+ | options(stringsAsFactors=F) | ||
+ | |||
+ | |||
+ | ### eMERGE is broken into different consent classes. We can conduct analyses on hmb, hmb-gso-nic, | ||
+ | |||
+ | |||
+ | emerge.hmb <- read.table("/ | ||
+ | emerge.hmb.genos <- read.table("/ | ||
+ | |||
+ | |||
+ | emerge.hmb.gso.nic <- read.table("/ | ||
+ | emerge.hmb.gso.nic.genos <- read.table("/ | ||
+ | |||
+ | |||
+ | emerge.hmb.gso <- read.table("/ | ||
+ | emerge.hmb.gso.genos <- read.table("/ | ||
+ | |||
+ | |||
+ | ### Merge all files above according to SUBJID, which is used in the | ||
+ | ### genotype files. | ||
+ | |||
+ | emerge <- merge(emerge.hmb, | ||
+ | emerge <- merge(d, emerge.hmb.gso.nic, | ||
+ | |||
+ | ### SMOKING INITIATION | ||
+ | ### | ||
+ | ### The eMERGE variable name is SMOKING_STATUS | ||
+ | ### C65108 = never smoker | ||
+ | ### C67147 = current smoker | ||
+ | ### C67148 = past smoker | ||
+ | ### C67151 = Unknown if ever smoked | ||
+ | ### | ||
+ | ### Descriptives: | ||
+ | ### | ||
+ | ### table(emerge$SMOKING_STATUS) | ||
+ | ### | ||
+ | ### C65108 C67147 C67148 C67151 | ||
+ | ### | ||
+ | |||
+ | si <- emerge$SMOKING_STATUS | ||
+ | si[si == " | ||
+ | si[si == " | ||
+ | si[si != 1 & si != 2] <- NA | ||
+ | |||
+ | ### SMOKING Cessation | ||
+ | ### | ||
+ | ### Current == 2 & Former == 1 in GSCAN. This is already the case for these data. | ||
+ | |||
+ | sc <- emerge$SMOKING_STATUS | ||
+ | sc[sc == " | ||
+ | sc[sc == " | ||
+ | sc[sc != 1 & sc != 2] <- NA | ||
+ | |||
+ | |||
+ | ### eMERGE age variable is tricky because there is no obvious age at | ||
+ | ### assessment. We will use their " | ||
+ | ### approximation. | ||
+ | ### 1=1900-1919; | ||
+ | ### | ||
+ | ### Descriptives: | ||
+ | ### | ||
+ | ### table(emerge$DECADE_BIRTH) | ||
+ | ### | ||
+ | ### | ||
+ | ### | ||
+ | birthyear <- emerge$DECADE_BIRTH | ||
+ | birthyear[birthyear == " | ||
+ | birthyear[birthyear == " | ||
+ | |||
+ | |||
+ | ### SEX | ||
+ | sex <- emerge$SEX | ||
+ | sex[sex == " | ||
+ | sex[sex == " | ||
+ | |||
+ | |||
+ | ### Scott decided not to correct for additional case-control variables | ||
+ | ### given what appears to be a highly complex sample and uncertainty | ||
+ | ### about the best course of action to account for disease status in | ||
+ | ### conducting smoking analyses. | ||
+ | |||
+ | phenotypes <- data.frame(fid = emerge$SUBJID, | ||
+ | iid = emerge$SUBJID, | ||
+ | patid = " | ||
+ | matid = " | ||
+ | sex = sex, | ||
+ | si = si, | ||
+ | sc = sc) | ||
+ | |||
+ | phenotypes[is.na(phenotypes)] <- " | ||
+ | |||
+ | write.table(phenotypes, | ||
+ | "/ | ||
+ | row.names=F, | ||
+ | quote = F, | ||
+ | sep=" | ||
+ | |||
+ | |||
+ | covariates | ||
+ | iid = emerge$SUBJID, | ||
+ | patid = " | ||
+ | matid = " | ||
+ | sex = sex, | ||
+ | birthyear = birthyear) | ||
+ | |||
+ | covariates[is.na(covariates)] <- " | ||
+ | |||
+ | write.table(covariates, | ||
+ | "/ | ||
+ | row.names=F, | ||
+ | quote = F, | ||
+ | sep=" | ||