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
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:
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" |
($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} |
#!/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 |
# 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) |
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 |
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])) |
here is a gist |
# Some example data | |
# Data frame with an id column | |
data1 <- data.frame(ids = c("A", "B", "C"), value = 1:3) | |
# matrix with rownames for ids | |
data2 <- matrix(1:20, 4, 5) | |
rownames(data2) <- c("C", "D", "B", "E") | |
# Get data1 into the same order as data2 |
newmat <- as.data.frame(t(mat)) | |
newmat$ALN <- rownames(newmat) | |
combineddata <- merge(bmi, newmat, by="ALN") | |
# See if they are individually associated with BMI | |
model <- lm(bmi ~ cpg1) | |