Skip to content

Instantly share code, notes, and snippets.

@ohofmann
Created May 22, 2012 20:41
Show Gist options
  • Save ohofmann/2771491 to your computer and use it in GitHub Desktop.
Save ohofmann/2771491 to your computer and use it in GitHub Desktop.
# 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()
pdf('sampleRelations_cluster_0.1_withRedos.pdf')
plotSampleRelation(lumiData, method='cluster', cv.Th=0.1)
dev.off()
# From the vignette. t-test of intensity value differences for probes
# on the X chromosome
mdX <- cmdscale(dist(t(exprs(lumiData)[fData(lumiData)$CHR=='X', ])), 2)
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment