/
gistic_data.R
32 lines (30 loc) · 877 Bytes
/
gistic_data.R
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
#' load TARGET GISTIC data as summarized experiment
#'
#' @import SummarizedExperiment
#' @importFrom readr read_tsv
#'
#' @examples
#' res = target_gistic_se()
#'
#' res
#'
#' head(colData(res))
#' assay(res,'cn')[1:5,1:5]
#'
#'
#' @export
target_gistic_se = function() {
.gistic_file = system.file(package='TargetOsteoAnalysis','extdata/all_data_by_genes.txt.bz2')
gistic = read_tsv(.gistic_file)
mat = as.matrix(gistic[,4:ncol(gistic)])
cdata = target_load_clinical()
cdata = as.data.frame(cdata)
cdata[[1]] = target_usi_to_samplename(cdata[[1]])
rownames(cdata) = make.unique(cdata[[1]])
cdata = cdata[colnames(mat),]
fdata = gistic[,1:3]
se = SummarizedExperiment::SummarizedExperiment(assays=list(cn = mat),
rowData = fdata,
colData = cdata)
se
}