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
| ncommands=22 | |
| nodesize=6 | |
| nodeuse=$(($nodesize )) | |
| totjobs=$(( ($ncommands + $nodeuse - 1 ) / $nodeuse )) | |
| for i in $(seq 1 1 $totjobs) | |
| do | |
| jstart=$((($i-1)*$nodesize +1)) | |
| jstop=$(($i*$nodesize)) |
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
| /home/laramie/CLEANED_DATA/EXTERNAL_DATA/MIRECC6_Duke/duke_gwas_WH/12_15_15/DUKE_WH_model3_w_A2_danerFORMAT | |
| grep -v NA MIRE_eur_analysis1_mf > MIRE_eur_analysis1_mf_nona | |
| adam <- read.table('MIRE_eur_analysis1_mf_nona', nr=10000000,stringsAsFactors=F,header=T) | |
| lara <- read.table('/home/laramie/CLEANED_DATA/EXTERNAL_DATA/MIRECC6_Duke/duke_gwas_WH/12_15_15/DUKE_WH_model3_w_A2_danerFORMAT', nr=8300000,stringsAsFactors=F,header=T) | |
| lara$p <- 2*pnorm(abs(log(lara$OR)/lara$SE),lower.tail=F) | |
| rescor <- merge(adam,lara,by="SNP") |
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
| args <- commandArgs(trailingOnly = TRUE) | |
| family_files <- args[1] | |
| dat <- read.table(family_files) | |
| for (i in dat$V1) | |
| { |
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
| ################################### | |
| ### Load R libraries | |
| #Contains survival analysis function | |
| library(survival) | |
| #Functions to build ROC curves from Cox models | |
| library(risksetROC) | |
| ################################### |
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
| #K=pop prevalence | |
| #P=proportion of cases in study | |
| #hsq=Heritability estimate (on observed scale) | |
| #bigT = liability threshold | |
| #tau = density of gaussian | |
| K=0.0659 | |
| P=0.0659 | |
| h2=0.0365 | |
| zv <- dnorm(qnorm(K)) |
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
| LC_ALL=C sort -k1b,1 file1.txt > file1.txt.sorted | |
| LC_ALL=C sort -k1b,1 file2.txt > file2.txt.sorted | |
| LC_ALL=C join file1.txt.sorted file2.txt.sorted > joined.txt |
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
| pdf('h2_mf_perstudy.pdf',7,7) | |
| par(mar=c(5, 4, 4, 2) + 0.5) | |
| plot(dat$case,dat$SE,cex.axis=1.45,cex.lab=1.5,xlab="N Cases", ylab="Standard Error of SNP Based Heritability",main="",cex=1.5,pch=19) | |
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
| ls ../bgn | sed 's/.bed//g' | sed 's/.bim//g' | sed 's/.fam//g' | sort -u | awk '{print "../bgn/"$1".bed","../bgn/"$1".bim","../bgn/"$1".fam"}' > mergelist.txt | |
| ../plink --merge-list mergelist.txt --maf 0.00000001 --geno 0.02 --make-bed --out pgbd_nomono_goodgeno | |
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
| famfile <- read.table('/home/cnieverg/MEG2/qc/pts_meg2_mix_am.fam',header=F,stringsAsFactors=F) | |
| names(famfile) <- c("FID","IID","F","M","Gender","Pheno") | |
| mds <- read.table('/home/cnieverg/MEG2/qc/pca/pts_meg2_mix_am-qc-eu1_pca.menv.mds_cov',header=T,stringsAsFactors=F) | |
| dat <- merge(famfile,mds,by=c("FID","IID")) | |
| #Number of analyzed subjects of European ancestry | |
| dim(dat)[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
| setwd('C:/Users/adam/Desktop/roycepower') | |
| library(plyr) | |
| dat0 <- read.csv('me_power.csv', header=T) | |
| dat <- dat0 | |
| #Fill in the blanks | |
| for (i in 1:dim(dat)[1]) | |
| { |