Skip to content

Commit

Permalink
refactor: remove old explores
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliversinn committed Dec 31, 2023
1 parent 4bc3856 commit 9a9dac1
Show file tree
Hide file tree
Showing 4 changed files with 697 additions and 560 deletions.
157 changes: 0 additions & 157 deletions Dashboard/explorer.R

This file was deleted.

164 changes: 0 additions & 164 deletions Dashboard/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -1188,169 +1188,5 @@ function(input, output, session) {
})


# Explorer data ----
explorer_data_reactive <- reactive({
cases_info <- GenomicDataCommons::cases()

if (input$project_id == "TODOS") {
cases_info <- cases_info %>%
GenomicDataCommons::filter(
~ project.project_id %in% tcga_project_ids_list
)
} else {
cases_info <- cases_info %>%
GenomicDataCommons::filter(
~ project.project_id == input$project_id
)
}

if (input$disease_type != "TODOS") {
cases_info <- cases_info %>%
GenomicDataCommons::filter(
project.disease_type == input$disease_type
)
}

if (input$primary_site != "TODOS") {
cases_info <- cases_info %>%
GenomicDataCommons::filter(
project.primary_site == input$primary_site
)
}

cases_info <- cases_info %>%
GenomicDataCommons::facet(c(
"project.project_id",
"demographic.race",
"demographic.gender",
"demographic.ethnicity",
"demographic.vital_status",
"diagnoses.primary_diagnosis",
"diagnoses.site_of_resection_or_biopsy",
"primary_site"
)) %>%
aggregations()
})



## project_id ----
### barplot ----
output$project_id_barplot <- renderPlotly({
project_id_barplot(explorer_data_reactive()$project.project_id)
})

### datatable ----
output$project_id_dt <- renderDataTable({
project_id_dt(explorer_data_reactive()$project.project_id)
})

## primary_site ----
### barplot ----
output$primary_site_barplot <- renderPlotly({
aggregation_substr_barplot(
head(explorer_data_reactive()$primary_site, 30),
"Sitio primario"
)
})

### datatable ----
output$primary_site_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$primary_site,
"Sitio primario",
"casos_por_sitio_primario"
)
})

## primary_diagnosis ----
### barplot ----
output$primary_diagnosis_barplot <- renderPlotly({
aggregation_substr_barplot(
head(explorer_data_reactive()$diagnoses.primary_diagnosis, 30),
"Diagnóstico primario"
)
})

### datatable ----
output$primary_diagnosis_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$diagnoses.primary_diagnosis,
"Diagnóstico primario",
"casos_por_diagnostico_primario"
)
})

## site_of_resection_or_biopsy ----
### barplot ----
output$resection_site_barplot <- renderPlotly({
aggregation_substr_barplot(
head(explorer_data_reactive()$diagnoses.site_of_resection_or_biopsy, 30),
"Sitio de Resección o Biopsia"
)
})

### datatable ----
output$resection_site_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$diagnoses.site_of_resection_or_biopsy,
"Sitio de Resección o Biopsia",
"casos_por_sitio_de_reseccion_o_biopsia"
)
})

## race ----
### barplot ----
output$race_barplot <- renderPlotly({
aggregation_barplot(
explorer_data_reactive()$demographic.race,
"Raza"
)
})

### datatable ----
output$race_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$demographic.race,
"Raza",
"casos_por_raza"
)
})

## ethnicity ----
### barplot ----
output$ethnicity_barplot <- renderPlotly({
aggregation_barplot(
explorer_data_reactive()$demographic.ethnicity,
"Etnia"
)
})

### datatable ----
output$ethnicity_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$demographic.ethnicity,
"Etnia",
"casos_por_etnia"
)
})


### datatable ----
output$gender_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$demographic.gender,
"Género",
"casos_por_genero"
)
})

### datatable ----
output$vital_status_dt <- renderDataTable({
aggregation_dt(
explorer_data_reactive()$demographic.vital_status,
"Estado vital",
"casos_por_estado_vital"
)
})
}
Loading

0 comments on commit 9a9dac1

Please sign in to comment.