Skip to content
Permalink
Browse files
Revert "Repo restructure"
This reverts commit 4f186c9.
  • Loading branch information
whiter9 committed Oct 24, 2022
1 parent c1b03a5 commit 2e9293a6664ceed4f1c42e8964de0f3a67411577
Show file tree
Hide file tree
Showing 111 changed files with 37 additions and 825 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
74 app.R
@@ -333,19 +333,19 @@ DotPlot_mod <- function(


# full dataset for all other app features
seurat.all <- readRDS("data/raw/FinalMergedData-downsampled.rds")
seurat.all <- readRDS("FinalMergedData-downsampled.rds")
# Switch active identities to cell type labels for plotting
Idents(seurat.all) <- "CellType"

# Data for main panel 1 bar graph
celltype_data_with_codes <- readRDS("data/overall-distributions/FetchDataOutput-AllCells.rds") %>% relocate(CellType)
celltype_props <- readRDS("data/overall-distributions/overall_celltype_props_data.rds")
celltype_data_with_codes <- readRDS("FetchDataOutput-AllCells.rds") %>% relocate(CellType)
celltype_props <- readRDS("overall_celltype_props_data.rds")

# Average expression data for Gene Explorer Tab 2 line plots
res_combined_ann <- readRDS("data/genewise-avgexp-percentexp/average_expression_allcelltypes_timepoints_mtvswt_withpvals.rds")
res_combined_ann <- readRDS("average_expression_allcelltypes_timepoints_mtvswt_withpvals.rds")

# Marker gene statistics for CellType Explorer Tab 3
data <- read.csv("data/differential-expression/DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
data <- read.csv("DEgenes_MtvsWt_alltimepts_allcelltypes.csv")


# convert cell type codes to real names
@@ -391,48 +391,48 @@ cLinesList <- c(levels(as.factor(seurat.all$Line)),"All")

# cell-cell communication data
#cellchat <- readRDS("cellchat.rds")
cellchat_2m <- readRDS("data/cellchat/cellchat_2M.rds")
cellchat_2v <- readRDS("data/cellchat/cellchat_2V.rds")
cellchat_4m <- readRDS("data/cellchat/cellchat_4M.rds")
cellchat_4v <- readRDS("data/cellchat/cellchat_4V.rds")
cellchat_6m <- readRDS("data/cellchat/cellchat_6M.rds")
cellchat_6v <- readRDS("data/cellchat/cellchat_6V.rds")
cellchat_2m <- readRDS("cellchat_2M.rds")
cellchat_2v <- readRDS("cellchat_2V.rds")
cellchat_4m <- readRDS("cellchat_4M.rds")
cellchat_4v <- readRDS("cellchat_4V.rds")
cellchat_6m <- readRDS("cellchat_6M.rds")
cellchat_6v <- readRDS("cellchat_6V.rds")

# cell net pathway data
#net_df <- read.csv(file = 'net_pathway.csv')
#net_df$prob <- format(net_df$prob, scientific = TRUE)
#colnames(net_df) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_2m <- read.csv(file = 'data/cellchat/net_pathway_2m.csv')
net_pathway_2m <- read.csv(file = 'net_pathway_2m.csv')
net_pathway_2m$prob <- format(net_pathway_2m$prob, scientific = TRUE)
colnames(net_pathway_2m) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_2v <- read.csv(file = 'data/cellchat/net_pathway_2v.csv')
net_pathway_2v <- read.csv(file = 'net_pathway_2v.csv')
net_pathway_2v$prob <- format(net_pathway_2v$prob, scientific = TRUE)
colnames(net_pathway_2v) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_4m <- read.csv(file = 'data/cellchat/net_pathway_4m.csv')
net_pathway_4m <- read.csv(file = 'net_pathway_4m.csv')
net_pathway_4m$prob <- format(net_pathway_4m$prob, scientific = TRUE)
colnames(net_pathway_4m) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_4v <- read.csv(file = 'data/cellchat/net_pathway_4v.csv')
net_pathway_4v <- read.csv(file = 'net_pathway_4v.csv')
net_pathway_4v$prob <- format(net_pathway_4v$prob, scientific = TRUE)
colnames(net_pathway_4v) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_6m <- read.csv(file = 'data/cellchat/net_pathway_6m.csv')
net_pathway_6m <- read.csv(file = 'net_pathway_6m.csv')
net_pathway_6m$prob <- format(net_pathway_6m$prob, scientific = TRUE)
colnames(net_pathway_6m) <- c("X", "source", "target", "pathway", "prob", "pval")

net_pathway_6v <- read.csv(file = 'data/cellchat/net_pathway_6v.csv')
net_pathway_6v <- read.csv(file = 'net_pathway_6v.csv')
net_pathway_6v$prob <- format(net_pathway_6v$prob, scientific = TRUE)
colnames(net_pathway_6v) <- c("X", "source", "target", "pathway", "prob", "pval")

# cell pathway names
#choices <- cellchat@netP$pathways
pathway_op <- read.csv(file = 'data/cellchat/pathway_choices.csv')
pathway_op <- read.csv(file = 'pathway_choices.csv')

# signaling pathway annotation
CellChatDB <- read.csv(file = 'data/cellchat/CellChatDB.csv')
CellChatDB <- read.csv(file = 'CellChatDB.csv')

# comparative analysis of ccc conditions
ccc_comparsion_List <- c("tau-V337M organoids at two months",
@@ -1934,7 +1934,7 @@ server <- function(input, output, session) {
ct_select <- input$celltype
ct_code <- ctcode_map[[ct_select]]

ct_data_to_show <- readRDS(sprintf("data/cell-group-gene-enrichment/celltype_marker_genes_%s.rds",ct_code))
ct_data_to_show <- readRDS(sprintf("celltype_marker_genes_%s.rds",ct_code))
showdata <- tibble::rownames_to_column(ct_data_to_show, "Gene")
showdata <- showdata %>% dplyr::select(Gene,avg_log2FC,p_val)
showdata
@@ -1947,7 +1947,7 @@ server <- function(input, output, session) {


# File read-in must be here because data depends on a reactive input value
reducedTerms <- readRDS(sprintf("data/cell-group-gene-enrichment/REVIGO_reducedTerms_%s.rds",ct_code))
reducedTerms <- readRDS(sprintf("REVIGO_reducedTerms_%s.rds",ct_code))
# treemapPlot(reducedTerms,title=sprintf("Summary of enriched Gene Ontology terms in %s cells, all timepoints.",ct_code),
# fontsize.title=10)
treemapPlot(reducedTerms)
@@ -2554,8 +2554,8 @@ server <- function(input, output, session) {
req(input$condition_1, input$condition_2)
cond_1 <- setCCCNames(input$condition_1)
cond_2 <- setCCCNames(input$condition_2)
my_data_1 <- readRDS(sprintf("data/cellchat/cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('data/cellchat/cellchat_', cond_2, '.rds')
my_data_1 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('cellchat_', cond_2, '.rds')
my_data_2 <- readRDS(file_names)
#my_data_2 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_2, "[0-9]+"), str_extract_all(cond_2, "[aA-zZ]+")))
name_1 <- as.character(input$condition_1)
@@ -2572,8 +2572,8 @@ server <- function(input, output, session) {
req(input$condition_1, input$condition_2)
cond_1 <- setCCCNames(input$condition_1)
cond_2 <- setCCCNames(input$condition_2)
my_data_1 <- readRDS(sprintf("data/cellchat/cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('data/cellchat/cellchat_', cond_2, '.rds')
my_data_1 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('cellchat_', cond_2, '.rds')
my_data_2 <- readRDS(file_names)
#my_data_2 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_2, "[0-9]+"), str_extract_all(cond_2, "[aA-zZ]+")))
name_1 <- as.character(input$condition_1)
@@ -2608,10 +2608,10 @@ server <- function(input, output, session) {
req(input$condition_1, input$condition_2)
cond_1 <- setCCCNames(input$condition_1)
cond_2 <- setCCCNames(input$condition_2)
my_data_1 <- readRDS(sprintf("data/cellchat/cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
my_data_1 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
#my_data_2 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_2, "[0-9]+"), str_extract_all(cond_2, "[aA-zZ]+")))
if (cond_2 == "2M") {
my_data_2 <- readRDS("data/cellchat/cellchat_2M.rds")
my_data_2 <- readRDS("cellchat_2M.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2628,7 +2628,7 @@ server <- function(input, output, session) {
}
}
if (cond_2 == "2V") {
my_data_2 <- readRDS("data/cellchat/cellchat_2V.rds")
my_data_2 <- readRDS("cellchat_2V.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2645,7 +2645,7 @@ server <- function(input, output, session) {
}
}
if (cond_2 == "4M") {
my_data_2 <- readRDS("data/cellchat/cellchat_4M.rds")
my_data_2 <- readRDS("cellchat_4M.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2662,7 +2662,7 @@ server <- function(input, output, session) {
}
}
if (cond_2 == "4V") {
my_data_2 <- readRDS("data/cellchat/cellchat_4V.rds")
my_data_2 <- readRDS("cellchat_4V.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2679,7 +2679,7 @@ server <- function(input, output, session) {
}
}
if (cond_2 == "6M") {
my_data_2 <- readRDS("data/cellchat/cellchat_6M.rds")
my_data_2 <- readRDS("cellchat_6M.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2696,7 +2696,7 @@ server <- function(input, output, session) {
}
}
if (cond_2 == "6V") {
my_data_2 <- readRDS("data/cellchat/cellchat_6V.rds")
my_data_2 <- readRDS("cellchat_6V.rds")
name_1 <- as.character(input$condition_1)
name_2 <- as.character(input$condition_2)
object.list <- dplyr::lst(!!name_1 := my_data_1, !!name_2 := my_data_2)
@@ -2733,8 +2733,8 @@ server <- function(input, output, session) {
req(input$condition_1, input$condition_2)
cond_1 <- setCCCNames(input$condition_1)
cond_2 <- setCCCNames(input$condition_2)
my_data_1 <- readRDS(sprintf("data/cellchat/cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('data/cellchat/cellchat_', cond_2, '.rds')
my_data_1 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_1, "[0-9]+"), str_extract_all(cond_1, "[aA-zZ]+")))
file_names <- paste0('cellchat_', cond_2, '.rds')
my_data_2 <- readRDS(file_names)
#my_data_2 <- readRDS(sprintf("cellchat_%s%s.rds",str_extract_all(cond_2, "[0-9]+"), str_extract_all(cond_2, "[aA-zZ]+")))
name_1 <- as.character(input$condition_1)
@@ -2793,7 +2793,7 @@ server <- function(input, output, session) {

output$VolcanoPlots <- renderPlotly({
if(input$ct != "All") {
allcelltype_data <- read.csv("data/differential-expression/DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
allcelltype_data <- read.csv("DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
celltype_data <- allcelltype_data[allcelltype_data$celltype == input$ct,]
if(input$time == "All") {
df_all <- celltype_data %>%
@@ -2824,7 +2824,7 @@ server <- function(input, output, session) {

output$manhattanplot <- renderPlotly({
if(input$ct != "All") {
allcelltype_data <- read.csv("data/differential-expression/DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
allcelltype_data <- read.csv("DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
celltype_data <- allcelltype_data[allcelltype_data$celltype == input$ct,]
if(input$time == "All") {
df_all <- celltype_data %>%
@@ -2855,7 +2855,7 @@ server <- function(input, output, session) {

output$enrichmentplot <- renderPlot({
if(input$ct != "All") {
allcelltype_data <- read.csv("data/differential-expression/DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
allcelltype_data <- read.csv("DEgenes_MtvsWt_alltimepts_allcelltypes.csv")
celltype_data <- allcelltype_data[allcelltype_data$celltype == input$ct,]
if(input$time == "All") {
up = subset(celltype_data, avg_log2FC > 0)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2e9293a

Please sign in to comment.