This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./plink --bfile GWAStutorial --out penn --make-bed | |
| ./plink --bfile penn --out qc_penn --maf 0.05 --hwe 0.0000001 --make-bed | |
| awk -F "," 'NR>1 {print $1" 1 "$3" "$4}' GWAStutorial_clinical.csv> PENN.cov | |
| awk -F "," 'NR>1 {print $1" 1 "$2+1}' GWAStutorial_clinical.csv> CAD.pheno | |
| awk -F "," 'NR>1 && $5!~/NA/ {print $1" 1 "$5}' GWAStutorial_clinical.csv> TG.pheno | |
| awk -F "," 'NR>1 && $6!~/NA/ {print $1" 1 "$6}' GWAStutorial_clinical.csv> HDL.pheno | |
| awk -F "," 'NR>1 && $7!~/NA/ {print $1" 1 "$7}' GWAStutorial_clinical.csv> LDL.pheno | |
| ./plink --bfile qc_penn --out qc_CAD --pheno CAD.pheno --assoc --ci 0.95 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rstan) | |
| library(MASS) | |
| stanmodel <- " | |
| data { | |
| int N; | |
| real x[N]; | |
| vector[2] y[N]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stanmodel <- " | |
| data { | |
| int N; | |
| matrix[N,2] X; | |
| } | |
| parameters { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mass) | |
| library(mvtnorm) | |
| set.seed(31415) | |
| MU <- c(10, 30) | |
| SIGMA <- c(20, 40) | |
| RHO <- -0.7 | |
| CVM <- rbind(c(SIGMA[1]^2, SIGMA[1]*SIGMA[2]*RHO), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stancodeLASSO=" | |
| data { | |
| int N; | |
| int M; | |
| vector[N] Y; | |
| matrix[N, M] X; | |
| } | |
| parameters { | |
| real<lower=0> S; | |
| vector[M] B; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(psych) | |
| library(glmnet) | |
| set.seed(1) | |
| x1 <- rnorm(30); x2 <- rnorm(30); x3 <- rnorm(30); e <- rnorm(30) | |
| X <- matrix(c(x1, x2, x3), byrow = F, ncol = 3) #explanatory variables | |
| y <- 3 + 0.01*x1 + 0.01*x2 + 5*x3 + rnorm(30) #y is a linear combination of x1x2x3 | |
| fit <-glmnet(x = X, y = y, alpha = 1) #fit use glmnet (alpha=1 : LASSO) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[Session handling]] | |
| <check session> | |
| $ tmux ls | |
| <attach> | |
| $ tmux a -t 2 | |
| <detach> | |
| PREFIX d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| m <- c(1:9, 3, 3) | |
| structure(sapply(m, sqrt), dim=m)) | |
| structure(vapply(m, sqrt, numeric(1)), dim=m)) | |
| m[] <- sapply(m, sqrt) | |
| m[] <- vapply(m, sqrt, numeric(1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nohlsearch | |
| set cursorline | |
| set mouse=a | |
| set noswapfile | |
| set nobackup | |
| set noundofile | |
| set showmatch | |
| set matchtime=1 | |
| set ttimeoutlen=10 | |
| set number |