-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript8_createFinalWorkspace.r
More file actions
94 lines (68 loc) · 2.98 KB
/
script8_createFinalWorkspace.r
File metadata and controls
94 lines (68 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#####======================================================================#####
### Create final workspace
#####======================================================================#####
##Author: Mattias Aine (mattias.aine@med.lu.se)
##Affiliation: Lund University / Oncoloy and Pathology
################################################################################
##Set home directory
##set/create own home directory below:
##work
HOME<-"~/hdd1/tcgaBrca"
MANIFEST<-"~/Documents/tcgaBrca/manifest"
##home
HOME<-"I:/data/tcgaBrca"
MANIFEST<-"F:/gitProjects/tcgaBrca/manifest"
##tumor type
TUMOR_TYPE<-"brca"
list.files(MANIFEST,full.names=T)
#[1] "/home/med-mai/Documents/tcgaBrca/manifest/atac"
#[2] "/home/med-mai/Documents/tcgaBrca/manifest/brca"
#[5] "/home/med-mai/Documents/tcgaBrca/manifest/pancan"
##create data directories
#dir.create(paste0(HOME,"/","me/norm"),recursive=TRUE)
################################################################################
##load required packages
if(!requireNamespace("RColorBrewer", quietly = TRUE)) {
install.packages("RColorBrewer") }
library("RColorBrewer")
if(!requireNamespace("pheatmap", quietly = TRUE)) {
install.packages("pheatmap") }
library("pheatmap")
if(!requireNamespace("dplyr", quietly = TRUE)) {
install.packages("dplyr") }
library("dplyr")
if (!requireNamespace("GenomicRanges", quietly = TRUE)) {
BiocManager::install("GenomicRanges") }
library("GenomicRanges")
################################################################################
##Get core tumor set from methylation data
load(file=paste0(HOME,"/","workspace_blacklistFiltered_atacCnGexMeWes_withSampleAnnotations.RData"))
ls()
# [1] "betaOrig" "dataAtac" "dataCn" "dataMut" "dataSeg"
# [6] "gexCounts" "gexFpkm" "gexUq" "HOME" "MANIFEST"
# [11] "sampleAnno" "TUMOR_TYPE"
#object - "betaAdj" - purity adjusted betas
load(list.files(paste0(HOME,"/me/"),pattern="data450k_.+_minfiNormalized_ringnerAdjusted_purityAdjusted_tumorBetaValues.RData",full.names=TRUE) )
#object - "betaNorm" - inferred normal methylation
load(list.files(paste0(HOME,"/me/"),pattern="data450k_.+_minfiNormalized_ringnerAdjusted_purityAdjusted_normalBetaValues.RData",full.names=TRUE) )
#object - "annoObj" - custom CpG annotations
tmp<-list.files(paste0(HOME,"/annotateFeatures/"),pattern="object_noChromFilter_.+_expandedAnnotations.RData",full.names=TRUE)
tmp<-tmp[ length(tmp) ]
load( tmp ) ; rm(tmp)
################################################################################
### Gather final object
ls()
# [1] "annoObj" "betaAdj" "betaNorm" "betaOrig" "dataAtac"
# [6] "dataCn" "dataMut" "dataSeg" "gexCounts" "gexFpkm"
# [11] "gexUq" "HOME" "MANIFEST" "sampleAnno" "TUMOR_TYPE"
save(annoObj,betaAdj,betaNorm,betaOrig,
dataAtac,
dataCn,dataSeg,
dataMut,
gexCounts,gexFpkm,gexUq,
sampleAnno,
HOME,MANIFEST,TUMOR_TYPE,
file=paste0(HOME,"/","finalWorkspace_atacCnGexMeWes_withAnnotations.RData")
)
q("no")
###END