forked from IARCbioinfo/Methylation_analysis_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create PC_regression_analysis_plots.R
- Loading branch information
1 parent
8d6f539
commit 258dabe
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
################ | ||
# Principal component regression analysis plots | ||
############### | ||
# select variables of interest | ||
head(pData(fun_filtered)) | ||
pData2 <- data.frame(pData(fun_filtered)) | ||
pData2$sentrix_id = as.factor(pData2$sentrix_id) | ||
|
||
lev = apply(pData2,2,function(x) table(x)) | ||
pData2 = pData2[,(sapply(lev,max,na.rm=T)>1)&(sapply(lev,nrow)>1) ] | ||
|
||
#svg("PCA.svg",h=6,w=6) | ||
pcrplot(minfi::getBeta(fun_filtered), cov= pData2, npc=20) | ||
#dev.off() | ||
|
||
# write session info | ||
writeLines(capture.output(sessionInfo()), "sessionInfo.txt") |