Skip to content

Instantly share code, notes, and snippets.

@ohofmann
Created May 22, 2012 20:42
Show Gist options
  • Select an option

  • Save ohofmann/2771492 to your computer and use it in GitHub Desktop.

Select an option

Save ohofmann/2771492 to your computer and use it in GitHub Desktop.
Try to de-convolute the array relationships by looking at the SNP
# probes
snpProbes <- grep('rs', fData(lumiData)$TargetID)
betas <- estimateBeta(lumiData)
betasSNP <- exprs(betas)[snpProbes, ]
labels <- paste(pData(lumiData)$Subject,
pData(lumiData)$sampleID,
pData(lumiData)$Tissue,
sep='_')
colnames(betasSNP) <- labels
# Select a subet of sample for pair plot
subject <- c('1', '2')
subjectSamples <- pData(lumiData)$Subject %in% subject
# Plot pair plot with the dots in scatter plot colored based on the color channels
png('subject_1_2_SNP.png', width=1200, height=1200)
pairs(betas[snpProbes, subjectSamples],
main='Pair plot of M-value before normalization')
dev.off()
# Plot overall sample identities
pheatmap(cor(betasSNP),
cellheight=16,
cellwidth=16,
file='heatmap.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment