Skip to content

Commit

Permalink
Merge pull request #344 from lishensuo/master
Browse files Browse the repository at this point in the history
Modify some UI details
  • Loading branch information
lishensuo authored Jul 25, 2024
2 parents 94fd1e9 + aa25d81 commit 36b0518
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 35 deletions.
8 changes: 4 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ See the [UCSCXenaShiny v2 Book](https://lishensuo.github.io/UCSCXenaShiny_Book/i
- `.opt_pancan` : Default setting for alternative TPC datasets.
- `mol_quick_analysis()`: Quick molecule analysis and report generation based on TCGA dataset.
- `query_tcga_group()`: Group TPC samples by build-in or custom phenotype and support filtering or merging operations.
- `vis_dim_dist()`: Visualize the distribution difference of TCGA samples after dimension reduction analysis.
- `vis_identifier_dim_dist()`: Visualize the distribution difference of samples after Molecule Identifier dimension reduction analysis.
- `vis_dim_dist()`: Visualize the distribution difference of TCGA samples after dimensionality reduction analysis.
- `vis_identifier_dim_dist()`: Visualize the distribution difference of samples after Molecule Identifier dimensionality reduction analysis.
- `vis_toil_Mut()`: Visualize molecular profile difference between mutation and wild status of queried gene.
- `vis_toil_Mut_cancer()`: Visualize molecular profile difference between mutation and wild status of queried gene in Single Cancer Type

Expand All @@ -50,13 +50,13 @@ See the [UCSCXenaShiny v2 Book](https://lishensuo.github.io/UCSCXenaShiny_Book/i

- General Dataset Analysis

- Added one general dimension reduction analysis module.
- Added one general dimensionality reduction analysis module.

- Quick TPC Analysis

- Added one module for association analysis between molecule and pathway;
- Added one module for association analysis between molecule and mutation;
- Added one module for dimension reduction analysis.
- Added one module for dimensionality reduction analysis.

- Personalized Analysis

Expand Down
6 changes: 5 additions & 1 deletion R/query_general.R
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,11 @@ mol_quick_analysis <- function(molecule, data_type, out_dir = ".", out_report =
print("##### Step1: Query the moleluce value... #####")
mol_data <- query_pancan_value(molecule, data_type = data_type, database = "toil")
if (is.list(mol_data)) mol_data <- mol_data[[1]]


if (all(is.na(mol_data))) {
message("All NAs returned, return NULL instead.")
return(NULL)
}

print(paste0("=== ", "Clinical phenotype"))
mol_data_df <- suppressMessages(data.frame(
Expand Down
4 changes: 2 additions & 2 deletions R/vis_dim_dist.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Visualize the distribution difference of samples after dimension reduction analysis
#' Visualize the distribution difference of samples after dimensionality reduction analysis
#'
#' @param ids molecular identifiers (>=3)
#' @param data_type molecular types, refer to query_pancan_value() function
#' @param group_info two-column grouping information with names 'Sample','Group'
#' @param DR_method the dimension reduction method
#' @param DR_method the dimensionality reduction method
#' @param palette the color setting of RColorBrewer
#' @param add_margin the marginal plot (NULL, "density", "boxplot")
#' @param opt_pancan specify one dataset for some molercular profiles
Expand Down
4 changes: 2 additions & 2 deletions R/vis_identifier_dim_dist.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Visualize the distribution difference of samples after Molecule Identifier dimension reduction analysis
#' Visualize the distribution difference of samples after Molecule Identifier dimensionality reduction analysis
#'
#' NOTE: the dataset must be dense matrix in UCSC Xena data hubs.
#'
Expand All @@ -10,7 +10,7 @@
#' - The second column refers to groups indicated in axis X.
#' @param samples default is `NULL`, can be common sample names for two datasets.
#' @param return.data whether to reture the raw meta/matrix data (list) instead of plot
#' @param DR_method the dimension reduction method
#' @param DR_method the dimensionality reduction method
#' @param add_margin the marginal plot (NULL, "density", "boxplot")
#' @param palette the color setting of RColorBrewer
#'
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyapp/helper/cross_pw.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@



<img src="https://ucscxenashiny-1301043367.cos.ap-shanghai.myqcloud.com/Shiny-figures//helper_cross_pw.png" alt="helper_cross_pw" width="700"/>
<img src="https://ucscxenashiny-1301043367.cos.ap-shanghai.myqcloud.com/Shiny-figures/helper_cross_pw.png" alt="helper_cross_pw" width="700"/>



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ server.modules_ga_dim_distribution <- function(
show_table <- selected_database_add_url_and_phenotype()
selectInput(
inputId = ns("ga_data2_id"),
label = "Select dataset for DR(Dimension Reduction):",
label = "Select dataset for DR(Dimensionality reduction):",
choices = c("NONE", unique(show_table$XenaDatasets)),
selected = "NONE",
multiple = FALSE
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyapp/modules/02_quick/modules-1-tcga-11-Dim.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ui.modules_1_tcga_11 = function(id){
box(main_ui,
width = 5,
solidHeader = TRUE,
title = "Quick TCGA Analysis: Dimension reduction analysis",
title = "Quick TCGA Analysis: Dimensionality reduction analysis",
status = "warning",
background = "gray",
collapsible = FALSE,
Expand Down
4 changes: 3 additions & 1 deletion inst/shinyapp/modules/06_tpc_func/modules-z-download-feat.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ download_feat_Server = function(input, output, session, database = "toil",#id_op
x_data$cancer = clinical_phe[,2,drop=T][match(x_data$Sample, clinical_phe$Sample)]
x_data = x_data[,c("id","level1","level2","Sample","value","cancer")] %>%
dplyr::arrange(cancer,Sample)
shinyjs::enable("query_data")
# shinyjs::enable("query_data")
x_data
})

Expand All @@ -276,6 +276,8 @@ download_feat_Server = function(input, output, session, database = "toil",#id_op
output$x_axis_data_table = renderUI({
if(table.ui){
output$x_tmp_table = renderDataTable({
shinyjs::enable("query_data")

shiny::validate(
need(try(nrow(download_data())>0),
"No sample data available. Please inspect operations in Preset step."),
Expand Down
27 changes: 19 additions & 8 deletions inst/shinyapp/modules/08_other_page/home-pancan-search.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ server.home_search_box <- function(input, output, session) {
Show.P.value = input$pdist_show_p_value,
Show.P.label = input$pdist_show_p_label
)

shiny::validate(
need(try(inherits(p,'gg')),
"Error: Please select a valid molecule.")
)
p + cowplot::theme_cowplot() + ggpubr::rotate_x_text(45)
})
}
Expand Down Expand Up @@ -233,23 +236,31 @@ server.home_search_box <- function(input, output, session) {
observeEvent(input$report_1, {
w$show()
output$tip1 = renderText({
paste0("Tip: You now can run step2 or step3. (",
format(Sys.time(), "%H:%M:%S"), ")")
if(report_1_OK()) {
paste0("Tip: You now can run step2 or step3. (",
format(Sys.time(), "%H:%M:%S"), ")")
} else {
"Error: Please exit and select a valid molecule."
}
})
})


report_1_OK <- reactiveVal(TRUE)
observeEvent(input$report_1, {
time_stamp = format(Sys.time(), "%Y-%m-%d_%H-%M-%S")
res_dat = mol_quick_analysis(molecule = input$Pancan_search,
data_type = input$Pancan_search_type,
out_dir = tempdir(), out_report = FALSE)

if(is.null(res_dat)) {
report_1_OK(FALSE)
}
shiny::validate(
need(try(!is.null(res_dat)),
"Error: Please exit and select a valid molecule.")
)



output$report_2 = downloadHandler(

output$report_2 = downloadHandler(
filename = paste0(time_stamp,"_report.html"),
content = function(file) {
tempReport <- file.path(tempdir(), paste0(time_stamp,"_report.Rmd"))
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyapp/server/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ observeEvent(req(input$navbar=="TCGA: Survival analysis"),{
callModule(server.modules_1_tcga_10, "modules_1_tcga_10")
}, once = TRUE)

observeEvent(req(input$navbar=="TCGA: Dimension reduction"),{
observeEvent(req(input$navbar=="TCGA: Dimensionality reduction"),{
callModule(server.modules_1_tcga_11, "modules_1_tcga_11")
}, once = TRUE)

Expand Down
4 changes: 2 additions & 2 deletions inst/shinyapp/shiny-doc/intro_personal_pips.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<center>
<h1>Personalized TPC pipelines</h1>
<h1>TPC pipelines</h1>
</center>


Expand Down Expand Up @@ -30,4 +30,4 @@



> <font size="5">Tips: The menu of `Custom TPC modules` enable specific and quick  TPC molecular analysis, such as tumor and tomor comparison, molecule and molecule correlation.</font>
> <font size="5">Tips: The menu of `TPC modules` enable specific and quick  TPC molecular analysis, such as tumor and tomor comparison, molecule and molecule correlation.</font>
4 changes: 2 additions & 2 deletions inst/shinyapp/shiny-doc/intro_quick_mods.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<center>
<h1>Custom TPC modules</h1>
<h1>TPC modules</h1>
</center>


Expand Down Expand Up @@ -60,5 +60,5 @@



> <font size="5">Tips: The menu of `Personalized TPC Pipelins` supports more general and personalized TPC molecular analysis, including alternative datasets, precise data preparation and versatile modes.</font>
> <font size="5">Tips: The menu of `TPC Pipelins` supports more general and personalized TPC molecular analysis, including alternative datasets, precise data preparation and versatile modes.</font>
4 changes: 2 additions & 2 deletions inst/shinyapp/ui/link2advanced.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ ui.link2advanced <- function() {
title = "Advanced analysis",
icon = icon("question-circle"),

tabPanel(a("Custom T·P·C Modules",
tabPanel(a("T·P·C Modules",
href="http://localhost:1498/",
target="_blank")),
# tabPanel(a("Personalized T·P·C Pipelines",
# tabPanel(a("T·P·C Pipelines",
# href="https://lishensuo.github.io/UCSCXenaShiny_Book/",
# target="_blank")),
# tabPanel(a("PharmacoGenomics",
Expand Down
4 changes: 2 additions & 2 deletions inst/shinyapp/ui/pancan-analysis-quick.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ ui.page_pancan_quick <- function() {
)
),

tabPanel("TCGA: Dimension reduction",
tabPanel("TCGA: Dimensionality reduction",
tabsetPanel(
tabPanel(
"Dimension reduction",
"Dimensionality reduction",
ui.modules_1_tcga_11("modules_1_tcga_11")
)
)
Expand Down
6 changes: 3 additions & 3 deletions man/vis_dim_dist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis_identifier_dim_dist.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 36b0518

Please sign in to comment.