Skip to content

Commit

Permalink
Correct cell type for non-detected genes
Browse files Browse the repository at this point in the history
Mistake in previous commit, forgot to replace `cc` with a list of cell types to correctly fill the "fake" heatmap data. Ensure that the column Modality exists when dataset==Neurons, and the column Tissue exists when dataset==All cells (previous version had Modality in All cells too)
  • Loading branch information
AlexWeinreb committed Jun 5, 2024
1 parent 1940000 commit 1fe5ad4
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -641,32 +641,46 @@ server <- function(input, output) {

}

# final plotting order
ordered_ss_known <- c(
rev(ordered_ss_known),
input_known_but_no_expression
)



#~~ Prepare dataset for plotting ----
heatmapdata <- heatmapdata[heatmapdata$gene_name %in% ordered_ss_known, ]


if(length(input_known_but_no_expression) > 0){

cell_types <- heatmapdata$cell.type[heatmapdata$gene_name == "nduo-6"]

fake_heatmap_data <- expand.grid(
gene_name=input_known_but_no_expression,
cell.type= cc,
cell.type= cell_types,
scaled.expr=0,
prop=0,
Modality="NA"
prop=0
)

if(ds != "Neurons only"){
if(ds == "Neurons only"){

fake_heatmap_data$Modality <- "NA"

} else{

tissues <- heatmapdata$tissue[heatmapdata$gene_name == "nduo-6"]
fake_heatmap_data$tissue <- tissues
}

heatmapdata <- rbind(heatmapdata, fake_heatmap_data)
}

heatmapdata <- heatmapdata[heatmapdata$gene_name %in% ordered_ss_known, ]


heatmapdata$gene_name <- factor(heatmapdata$gene_name,
levels = c(
rev(ordered_ss_known),
input_known_but_no_expression
))
levels = ordered_ss_known)



Expand Down

0 comments on commit 1fe5ad4

Please sign in to comment.