The TwoSampleMR
package is sitting here:
https://scmv-ieugit.epi.bris.ac.uk/gh13047/mr_base
The following people currently have access as 'Masters' on this repository:
- Gib Hemani
- Tom Gaunt
manifest <- read.table("manifest.file") | |
# make sure IDs in manifest are matched to IDs in cpg matrix | |
tbetas_fom_subset <- t(tbetas[cpgs,]) | |
tbetas_fom_subset[, 1] <- residuals(lm(tbetas_fom_subset[, 1] ~ manifest[,1:5])) | |
tbetas_fom_subset[, 2] <- residuals(lm(tbetas_fom_subset[, 2] ~ manifest[,1:5])) | |
tbetas_fom_subset[, 3] <- residuals(lm(tbetas_fom_subset[, 3] ~ manifest[,1:5])) |
library(ggplot2) | |
library(devtools) | |
library(reshape2) | |
#install_github("brentp/celltypes450") | |
library(celltypes450) | |
library(meffil) | |
options(mc.cores=16) | |
# Using GSE55491 | |
# Estimate cell counts using meffil |
# Suppose you have some files that look like this: | |
# bmi_chr01.profile | |
# bmi_chr02.profile | |
# bmi_chr03.profile | |
# etc | |
# Read in each profile score | |
l <- list() | |
j <- 1 | |
for(i in 1:22) |
#!/bin/bash | |
module add apps/plink-1.90b3v | |
cd /panfs/panasas01/shared/alspac/deprecated/gib/data_for_suzi | |
cp /panfs/panasas01/shared/alspac/deprecated/alspac_combined_1kg_20140424/combined/alspac_1kg_p1v3_maf0.01_info0.8.bed als.bed | |
cp /panfs/panasas01/shared/alspac/deprecated/alspac_combined_1kg_20140424/combined/alspac_1kg_p1v3_maf0.01_info0.8.bim als.bim | |
cp /panfs/panasas01/shared/alspac/deprecated/alspac_combined_1kg_20140424/combined/alspac_1kg_p1v3_maf0.01_info0.8.fam als.fam |
($1 == 1) && ($4 >= 48287981) && ($4 <= 52287979) {print $2} | |
($1 == 2) && ($4 >= 86088343) && ($4 <= 101041482) {print $2} | |
($1 == 2) && ($4 >= 134666269) && ($4 <= 138166268) {print $2} | |
($1 == 2) && ($4 >= 183174495) && ($4 <= 190174494) {print $2} | |
($1 == 3) && ($4 >= 47524997) && ($4 <= 50024996) {print $2} | |
($1 == 3) && ($4 >= 83417311) && ($4 <= 86917310) {print $2} | |
($1 == 3) && ($4 >= 88917311) && ($4 <= 96017310) {print $2} | |
($1 == 5) && ($4 >= 44464244) && ($4 <= 50464243) {print $2} | |
($1 == 5) && ($4 >= 97972101) && ($4 <= 100472101) {print $2} | |
($1 == 5) && ($4 >= 128972102) && ($4 <= 131972101) {print $2} |
arguments <- commandArgs(T) | |
k <- as.numeric(arguments[1]) | |
threshold <- as.numeric(arguments[2]) | |
nfold <- as.numeric(arguments[3]) | |
aries.release.dir <- "/panfs/panasas01/shared/alspac/deprecated/aries/releasev2_apr2014/" | |
time.point <- "cord" ## "FOM","antenatal","cord","F7","15up" |
The TwoSampleMR
package is sitting here:
https://scmv-ieugit.epi.bris.ac.uk/gh13047/mr_base
The following people currently have access as 'Masters' on this repository:
--- | |
title: A frailty effect is sufficient to explain the apparent association of a smoking heaviness variant on smoking initiation in a cross sectional population | |
date: "`r Sys.Date()`" | |
output: pdf_document | |
bibliography: smoking_age.bib | |
--- | |
```{r, echo=FALSE} | |
opts_chunk$set(warning=FALSE, message=FALSE, echo=FALSE) | |
``` |
m <- 100 | |
n <- 100 | |
eff <- rnorm(m) | |
x <- matrix(rbinom(m*n,2,0.5), n, m) | |
yhat <- x %*% eff | |
library(reshape2) | |
library(ggplot2) | |
library(alspac) | |
b <- findVars("bmi") | |
b <- subset(b, cat2=="Clinic" & cat3 == "Child") | |
bmi <- extractVars(b) | |
c <- cor(bmi[,-c(1:3)], use="pair") |