Skip to content

Commit

Permalink
Add mutation type to TCGA modules of Cox analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
lishensuo committed Sep 10, 2024
1 parent 29d0b16 commit 464005f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion R/vis_pancan_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,14 @@ vis_unicox_tree <- function(Gene = "TP53", measure = "OS", data_type = "mRNA", u
dplyr::inner_join(tcga_surv, by = "sample") %>%
dplyr::inner_join(tcga_gtex[, c("tissue", "sample")], by = "sample")
sss <- split(ss, ss$tissue)
# discard cancer types with constant values (e.g. all TP53-wild samples)
sss = sss[sapply(sss, function(x){stats::sd(x$values)!=0})]
tissues <- names(sss)
.f <- function(cancer) {
sss_can <- sss[[cancer]]

# By default, cox analysis based on continuous molecule values. HR>0: Higher values, More risky.
# Set use_optimal_cutoff as TRUE: Divide into 2 groups (Low/High) according the optimal cutoff. Then,
## cox analysis based on discrete molecule groups. HR>0: 'High' Group are more risky.
if (use_optimal_cutoff) {
sss_can <- sss_can %>%
survminer::surv_cutpoint(
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyapp/modules/02_quick/modules-1-tcga-10-Cox.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ui.modules_1_tcga_10 = function(id){

main_ui = tagList(
mol_quick_select_UI(ns("id"), "tcga",
c("mRNA","transcript","methylation","miRNA","protein", "cnv")),
c("mRNA","transcript","methylation","miRNA","protein", "cnv", "mutation")),

h4("3. Select TCGA endpoint type"),
selectInput(ns("measure"), NULL,c("OS", "DSS", "DFI", "PFI")),
Expand Down
6 changes: 3 additions & 3 deletions inst/shinyapp/modules/03_tcga/modules-pancan-cross-gene-o2m.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ server.modules_pancan_cross_gene_o2m = function(input, output, session) {
Sys.sleep(0.5)

output$step2_2_text = renderPrint({
cat(paste0("Tip: (1) mRNA is ",
cat(paste0("Tips: \n(1) mRNA is ",
ifelse(check_omics$mRNA,"OK; ","missing; "),
"(2) Mutation is ",
"\n(2) Mutation is ",
ifelse(check_omics$mutation,"OK; ","missing; "),
"(2) CNV is ",
"\n(3) CNV is ",
ifelse(check_omics$cnv,"OK.","missing.")
))
})
Expand Down

0 comments on commit 464005f

Please sign in to comment.