Skip to content

Instantly share code, notes, and snippets.

View ohofmann's full-sized avatar

Oliver Hofmann ohofmann

  • University of Melbourne
  • Melbourne, Australia
View GitHub Profile
arrayQualityMetrics(expressionset=msc.data,
outdir='report_raw',
force=TRUE,
do.logtransform=TRUE)
# Normalize and create second report
msc.eset <- call.exprs(msc.data, "rma");
arrayQualityMetrics(expressionset=msc.eset,
outdir='report_rma',
force=TRUE,
pdf('X_withDuplicates_labels.pdf', width=14, height=14)
plot(mdX,
pch=15,
col=c(rgb(255, 0, 0, 100, maxColorValue=255),
rgb(0, 0, 255, 100, maxColorValue=255))[pData(lumiData)$Sex],
cex=1.2)
text(mdX[, 1], mdX[, 2], labels=pData(lumiData)$SampleLabel, cex=.75)
dev.off()
# Plot correlation score in pairs() panel
panel.cor <- function(x, y, digits=2, prefix="", cex.cor)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r = (cor(x, y, use="pairwise"))
txt <- format(c(r, 0.123456789), digits=digits)[1]
txt <- paste(prefix, txt, sep="")
if(missing(cex.cor)) cex <- 0.6/strwidth(txt)
text(0.5, 0.5, txt, cex=cex )
setwd('/Users/oho/Desktop/Methylation/')
load('probes.450k.rda')
data <- probes.450k
probes <- data$Probe_ID
length(probes)
bedMatrix <- matrix(nrow=length(probes), ncol=6)
for (i in 1:length(probes)) {
@ohofmann
ohofmann / gist:1878284
Created February 21, 2012 19:20
Lumi normalization
library(lumi)
library(arrayQualityMetrics)
setwd('~/Dropbox/Shared/Mike_LungCancer/')
data <- lumiR.batch(c('Batch1_EA10095_20101202_FinalReportNonNormNoBack.txt',
'Batch2_EA10095_20110729_FinalReportNonNormNoBack_clean.txt'),
sampleInfoFile='SampleDesc.txt')
png('density.png', width=1200, height=800)
density(data)
library(lumi)
library(arrayQualityMetrics)
setwd('D:/Storage/My Dropbox/Shared/Mike_LungCancer/')
#setwd('~/Dropbox/Shared/Mike_LungCancer/')
data <- lumiR.batch(c('Batch1_EA10095_20101202_FinalReportNonNormNoBack.txt',
'Batch2_EA10095_20110729_FinalReportNonNormNoBack_clean.txt'),
sampleInfoFile='SampleDesc.txt')
png('density.png', width=1200, height=800)
library(oligo)
library(genefilter)
library(RColorBrewer)
library(sva)
library(SpeCond)
basepath <- '/n/HSPH/projects/am_trap'
#
# Get array data
library(simpleaffy)
library(mouse430a2.db)
library(arrayQualityMetrics)
library(RColorBrewer)
library(pheatmap)
#library(pathprint)
#library(ggplot2)
#library(ggdendro)
#library("AnnotationDbi")
library(ReadqPCR)
library(NormqPCR)
library(pheatmap)
library(RColorBrewer)
library(ggplot2)
######################################################################
# Setup
######################################################################
# Pairwise correlations
# Start with basic quality controls from lumi, highlight
# samples by tissue information, also extract gender information
colors <- brewer.pal(3, 'Set1')
tissues <- pData(lumiData)$Tissue
gender <- pData(lumiData)$Sex
# Basic sample relations
pdf('sampleRelations_mds_0.1_withRedos.pdf')
plotSampleRelation(lumiData, method='mds', cv.Th=0.1, col=colors[tissues])
dev.off()