Skip to content

Commit

Permalink
(up) upload app with real data
Browse files Browse the repository at this point in the history
  • Loading branch information
geocarvalho committed Oct 21, 2024
1 parent 128b6ba commit 2fa8433
Show file tree
Hide file tree
Showing 47 changed files with 2,574 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# samples_archive
Archive with samples data available and doctor information
Data archive with samples data available and doctor information

https://uclanelsonlab.github.io/samples_archive/
Binary file added ccrd/.DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions ccrd/.Rproj.user/F8997808/pcs/files-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"sortOrder": [
{
"columnIndex": 2,
"ascending": true
}
],
"path": "~/Documents/nelson-lab/R-projects/ccrd/data"
}
3 changes: 3 additions & 0 deletions ccrd/.Rproj.user/F8997808/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"activeTab": 0
}
14 changes: 14 additions & 0 deletions ccrd/.Rproj.user/F8997808/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"left": {
"splitterpos": 367,
"topwindowstate": "NORMAL",
"panelheight": 904,
"windowheight": 942
},
"right": {
"splitterpos": 487,
"topwindowstate": "NORMAL",
"panelheight": 904,
"windowheight": 942
}
}
5 changes: 5 additions & 0 deletions ccrd/.Rproj.user/F8997808/pcs/workbench-pane.pper
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"TabSet1": 0,
"TabSet2": 0,
"TabZoom": {}
}
5 changes: 5 additions & 0 deletions ccrd/.Rproj.user/F8997808/rmd-outputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@





1 change: 1 addition & 0 deletions ccrd/.Rproj.user/F8997808/saved_source_markers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"active_set":"","sets":[]}
26 changes: 26 additions & 0 deletions ccrd/.Rproj.user/F8997808/sources/per/t/AA777CF8
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "AA777CF8",
"path": "~/Documents/nelson-lab/R-projects/ccrd/app.R",
"project_path": "app.R",
"type": "r_source",
"hash": "73520305",
"contents": "",
"dirty": false,
"created": 1728335367796.0,
"source_on_save": false,
"relative_order": 1,
"properties": {
"source_window_id": "",
"Source": "Source",
"cursorPosition": "46,34",
"scrollLine": "32"
},
"folds": "",
"lastKnownWriteTime": 1728430296,
"encoding": "UTF-8",
"collab_server": "",
"source_window": "",
"last_content_update": 1728430296871,
"read_only": false,
"read_only_alternatives": []
}
113 changes: 113 additions & 0 deletions ccrd/.Rproj.user/F8997808/sources/per/t/AA777CF8-contents
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#

library(shiny)
library(readxl);

path <- 'data/2024-06-11_UDN-Gateway_families.xlsx';
excel_sheets(path = path);
data <- read_excel(path = path, sheet = '2024-06-11_UDN-Gateway_families');
data <- data[data$Status %in% c('Solved - KP', 'Solved - ND', 'Solved - PE', 'Unsolved - CG', 'Unsolved - CS'),];
colnames(data)[2] <- 'Cases';
colnames(data)[14] <- 'gene.of.interest';
data <- data[!is.na(data$gene.of.interest),];
data$referred.by <- paste(data$`Referring physician`, data$`Referring institution`, sep = '|');

# data.participants <- data.frame(UDN.id = rep(NA,3), relationship = c('Proband', 'Father', 'Mother'), affected = c('Yes', 'No', 'No'), available = c('Yes', 'Yes', 'Yes'));
path <- 'data/main.xlsx';
excel_sheets(path = path)
data.participants <- read_excel(path = path, sheet = 'participant');
data.participants <- merge(x = data, y = data.participants, by.x = 'Cases', by.y = 'family_id*');
colnames(data.participants)[29] <- 'Participants';
colnames(data.participants)[39] <- 'Relationship';
colnames(data.participants)[47] <- 'Affected?';
colnames(data.participants)[4] <- 'Available?';
data.participants[!is.na(data.participants[,4]),4] <- 'No';
data.participants[is.na(data.participants[,4]),4] <- 'Yes';

path <- 'data/main.xlsx';
excel_sheets(path = path)
data.analyte <- read_excel(path = path, sheet = 'analyte');
data.analyte <- merge(x = data.participants, y = data.analyte, by.x = 'Participants', by.y = 'participant_id*');

# Define UI for application that draws a histogram
ui <- fluidPage(

# Application title
titlePanel("California Center for Rare Diseases"),

# Sidebar with a slider input for number of bins
# sidebarLayout(
# sidebarPanel = sidebarPanel(
textInput(inputId = 'gene', label = 'Gene name: ', value = 'RBBP5', width = '400px', placeholder = 'RBBP5'),
# actionButton(inputId = 'search', label = 'Search', icon = NULL, width = '400px', disabled = FALSE),
# ),
# mainPanel = mainPanel(
tableOutput(outputId = 'cases'),
tableOutput(outputId = 'participants'),
tableOutput(outputId = 'biospecimens'),
'E: Whole Exome Sequencing; G: Whole Genome Sequencing; R: RNA-Seq'
# )
# )
);

# Define server logic required to draw a histogram
server <- function(input, output) {
output$cases <- renderTable(expr = {
if(!is.null(x = input$gene)){
return(data[data$gene.of.interest == input$gene,c('Cases', 'Status', 'referred.by')]);
}
return(data,c('Cases', 'Status', 'referred.by'));
});
output$participants <- renderTable(expr = {
if(!is.null(x = input$gene)){
return(data.participants[data.participants$gene.of.interest == input$gene,c('Participants', 'Relationship', 'Affected?', 'Available?')]);
}
return(data.participants[,c('Participants', 'Relationship', 'Affected?', 'Available?')])
});
output$biospecimens <- renderTable(expr = {
.data.analyte <- data.analyte[data.analyte$gene.of.interest == input$gene,];
Biospecimens <- unique(sort(data.analyte$`primary_biosample*`));
collected.P <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
collected.F <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
collected.M <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
available.P <- rep('?', 4);
available.F <- rep('?', 4);
available.M <- rep('?', 4);
sequencing.P <- c('R', 'X', 'G', 'R');
sequencing.F <- c('X', 'X', 'G', 'X');
sequencing.M <- c('X', 'X', 'G', 'X');
contact <- c('CCRD', 'CCRD', 'CCRD', 'CDMD');
data.biospecimens <- data.frame(
Biospecimens, rep('',4), collected.P, collected.F, collected.M, rep('',4), available.P,
available.F, available.M, rep('',4), sequencing.P, sequencing.F, sequencing.M, contact);
colnames(data.biospecimens) <- c(
'Biospecimens', 'Collected?', 'P', 'F', 'M', 'Available?', 'P', 'F', 'M', 'Sequenced?', 'P',
'F', 'M', 'Contact');
return(data.biospecimens);
});
}

# Run the application
shinyApp(ui = ui, server = server)
6 changes: 6 additions & 0 deletions ccrd/.Rproj.user/F8997808/sources/prop/35D8C3F2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "38,23",
"scrollLine": "28"
}
6 changes: 6 additions & 0 deletions ccrd/.Rproj.user/F8997808/sources/prop/BBFAB3DA
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"source_window_id": "",
"Source": "Source",
"cursorPosition": "46,34",
"scrollLine": "32"
}
2 changes: 2 additions & 0 deletions ccrd/.Rproj.user/F8997808/sources/prop/INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
~%2FDocuments%2Fnelson-lab%2FR-projects%2Fccrd%2Fapp.R="BBFAB3DA"
~%2FDocuments%2Fnelson-lab%2FR-projects%2Fccrd%2Fapp2%2Fapp.R="35D8C3F2"
Empty file.
1 change: 1 addition & 0 deletions ccrd/.Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Users/rcoronadelafuente/Documents/nelson-lab/R-projects/ccrd/app2/app.R="4749D6BA"
113 changes: 113 additions & 0 deletions ccrd/app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#

library(shiny)
library(readxl);

path <- 'data/2024-06-11_UDN-Gateway_families_filter.xlsx';
excel_sheets(path = path);
data <- read_excel(path = path, sheet = '2024-06-11_UDN-Gateway_families');
data <- data[data$Status %in% c('Solved - KP', 'Solved - ND', 'Solved - PE', 'Unsolved - CG', 'Unsolved - CS'),];
colnames(data)[colnames(data) %in% c("primaryRelative.udnId")] <- 'Cases';
colnames(data)[colnames(data) %in% c("List of Genes\r\n(red = NOT in Gateway)")] <- 'gene.of.interest';
data <- data[!is.na(data$gene.of.interest),];
data$referred.by <- paste(data$'Referring physician', data$'Referring institution', sep = '|');

# data.participants <- data.frame(UDN.id = rep(NA,3), relationship = c('Proband', 'Father', 'Mother'), affected = c('Yes', 'No', 'No'), available = c('Yes', 'Yes', 'Yes'));
path <- 'data/main.xlsx';
excel_sheets(path = path)
data.participants <- read_excel(path = path, sheet = 'participant');
data.participants <- merge(x = data, y = data.participants, by.x = 'Cases', by.y = 'family_id*');
colnames(data.participants)[colnames(data.participants) %in% c("participant_id*")] <- 'Participants';
colnames(data.participants)[colnames(data.participants) %in% c("proband_relationship*")] <- 'Relationship';
colnames(data.participants)[colnames(data.participants) %in% c("affected_status*")] <- 'Affected?';
colnames(data.participants)[colnames(data.participants) %in% c("Deceased")] <- 'Available?';
data.participants[!is.na(data.participants$"Available?"),"Available?"] <- 'No';
data.participants[is.na(data.participants$"Available?"),"Available?"] <- 'Yes';

path <- 'data/main.xlsx';
excel_sheets(path = path)
data.analyte <- read_excel(path = path, sheet = 'analyte');
data.analyte <- merge(x = data.participants, y = data.analyte, by.x = 'Participants', by.y = 'participant_id*');

# Define UI for application that draws a histogram
ui <- fluidPage(

# Application title
titlePanel("California Center for Rare Diseases"),

# Sidebar with a slider input for number of bins
# sidebarLayout(
# sidebarPanel = sidebarPanel(
textInput(inputId = 'gene', label = 'Gene name: ', value = 'RBBP5', width = '400px', placeholder = 'RBBP5'),
# actionButton(inputId = 'search', label = 'Search', icon = NULL, width = '400px', disabled = FALSE),
# ),
# mainPanel = mainPanel(
tableOutput(outputId = 'cases'),
tableOutput(outputId = 'participants'),
tableOutput(outputId = 'biospecimens'),
'E: Whole Exome Sequencing; G: Whole Genome Sequencing; R: RNA-Seq'
# )
# )
);

# Define server logic required to draw a histogram
server <- function(input, output) {
output$cases <- renderTable(expr = {
if(!is.null(x = input$gene)){
return(data[data$gene.of.interest == input$gene,c('Cases', 'Status', 'referred.by')]);
}
return(data,c('Cases', 'Status', 'referred.by'));
});
output$participants <- renderTable(expr = {
if(!is.null(x = input$gene)){
return(data.participants[data.participants$gene.of.interest == input$gene,c('Participants', 'Relationship', 'Affected?', 'Available?')]);
}
return(data.participants[,c('Participants', 'Relationship', 'Affected?', 'Available?')])
});
output$biospecimens <- renderTable(expr = {
.data.analyte <- data.analyte[data.analyte$gene.of.interest == input$gene,];
Biospecimens <- unique(sort(data.analyte$`primary_biosample*`));
collected.P <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Self' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
collected.F <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Father' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
collected.M <- c(
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[1], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[2], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[3], na.rm = TRUE) > 0, yes = 'Yes', no = 'No'),
ifelse(test = sum(.data.analyte$Relationship == 'Mother' & .data.analyte$`primary_biosample*` == Biospecimens[4], na.rm = TRUE) > 0, yes = 'Yes', no = 'No')
);
available.P <- rep('?', 4);
available.F <- rep('?', 4);
available.M <- rep('?', 4);
sequencing.P <- c('R', 'X', 'G', 'R');
sequencing.F <- c('X', 'X', 'G', 'X');
sequencing.M <- c('X', 'X', 'G', 'X');
contact <- c('CCRD', 'CCRD', 'CCRD', 'CDMD');
data.biospecimens <- data.frame(
Biospecimens, rep('',4), collected.P, collected.F, collected.M, rep('',4), available.P,
available.F, available.M, rep('',4), sequencing.P, sequencing.F, sequencing.M, contact);
colnames(data.biospecimens) <- c(
'Biospecimens', 'Collected?', 'P', 'F', 'M', 'Available?', 'P', 'F', 'M', 'Sequenced?', 'P',
'F', 'M', 'Contact');
return(data.biospecimens);
});
}

# Run the application
shinyApp(ui = ui, server = server)
Binary file not shown.
Binary file added ccrd/data/main.xlsx
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/app.json

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"files":[{"filename":"/DESCRIPTION","start":0,"end":923},{"filename":"/INDEX","start":923,"end":2110},{"filename":"/LICENSE","start":2110,"end":2154},{"filename":"/Meta/Rd.rds","start":2154,"end":3079},{"filename":"/Meta/features.rds","start":3079,"end":3201},{"filename":"/Meta/hsearch.rds","start":3201,"end":4123},{"filename":"/Meta/links.rds","start":4123,"end":4640},{"filename":"/Meta/nsInfo.rds","start":4640,"end":5098},{"filename":"/Meta/package.rds","start":5098,"end":6123},{"filename":"/Meta/vignette.rds","start":6123,"end":6349},{"filename":"/NAMESPACE","start":6349,"end":7533},{"filename":"/NEWS.md","start":7533,"end":9065},{"filename":"/R/cellranger","start":9065,"end":10123},{"filename":"/R/cellranger.rdb","start":10123,"end":28126},{"filename":"/R/cellranger.rdx","start":28126,"end":29170},{"filename":"/doc/cell-references.Rmd","start":29170,"end":31395},{"filename":"/doc/cell-references.html","start":31395,"end":40020},{"filename":"/doc/index.html","start":40020,"end":41423},{"filename":"/help/AnIndex","start":41423,"end":42612},{"filename":"/help/aliases.rds","start":42612,"end":43016},{"filename":"/help/cellranger.rdb","start":43016,"end":87243},{"filename":"/help/cellranger.rdx","start":87243,"end":87811},{"filename":"/help/paths.rds","start":87811,"end":88137},{"filename":"/html/00Index.html","start":88137,"end":94981},{"filename":"/html/R.css","start":94981,"end":96825}],"remote_package_size":96825}
Binary file not shown.
Loading

0 comments on commit 2fa8433

Please sign in to comment.