-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathload_stachelek_focal_scnas.R
34 lines (28 loc) · 1.2 KB
/
load_stachelek_focal_scnas.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
33
34
##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##'
##' @title
##' @param stachelek_scna_by_gene
##' @return
##' @author whtns
##' @export
load_stachelek_focal_scnas <- function(stachelek_scna_by_gene) {
stachelek_scnas = stachelek_scna_by_gene %>%
dplyr::ungroup() %>%
dplyr::mutate(study = "Stachelek et al.") %>%
dplyr::filter(symbol %in% c("BCOR", "MYCN")) %>%
dplyr::select(all_of(c("id" = "sample_id", "gene_id", "seqnames" = "chromosome", "seg_mean" = "seg.mean", "copy_number" = "seg.mean", "study"))) %>%
dplyr::mutate(seqnames = stringr::str_remove(seqnames, "chr")) %>%
dplyr::mutate(seg_mean = log2(copy_number)) %>%
dplyr::mutate(gene_id = as.character(gene_id)) %>%
dplyr::filter((seqnames %in% c("X") & copy_number < 1.0) | (seqnames == "2" & copy_number > 7)) %>%
identity()
vc_focal_scnas <-
stachelek_scnas %>%
dplyr::filter(str_detect(id, "^[0-9]{2}-[A-Z]*"))
reynolds_focal_scnas <-
stachelek_scnas %>%
dplyr::filter(str_detect(id, "^[0-9]{3}-[A-Z]*"))
list(vc = vc_focal_scnas, reynolds = reynolds_focal_scnas)
}