git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
## meta analysis, sample size based | |
metaZn = function(zdisc,zrepl,ndisc,nrepl) | |
{ | |
## calculate meta analysis Zscore | |
## zdisc and zrepl are zscores in the discovery and replication sets respectively | |
## ndisc and nrepl are sample sizes in the discovery and replication sets | |
wdisc = sqrt(ndisc) | |
wrepl = sqrt(nrepl) | |
( zdisc * wdisc + zrepl * wrepl )/sqrt( wdisc^2 + wrepl^2 ) | |
} |
X = GXM | |
filename = paste0(data.dir,"tempo/gcta-run/gxm.grm") | |
ids = rnadata$sidno | |
write_GRMgz = function(X,filename,ids) | |
{ | |
#X[upper.tri(X,diag=TRUE)] | |
rmat = row(X) | |
cmat = col(X) | |
omat = cbind(cmat[upper.tri(cmat,diag=TRUE)],rmat[upper.tri(rmat,diag=TRUE)],ncol(rnamat),X[upper.tri(X,diag=TRUE)]) | |
write_tsv(data.frame(omat),path=filename,col_names = FALSE) |