Skip to content

Commit

Permalink
fix 898 where custom features are not in rownames
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromiguelm committed Sep 4, 2024
1 parent 9ceb4fa commit 667c878
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion components/board.compare/R/compare_plot_fcfc.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,25 @@ compare_plot_fcfc_server <- function(id,
FC <- plot_data()
mat <- getMatrices()


## subsample for speed
ncol_FC <- ncol(FC)
nrow_FC <- nrow(FC)
sample_size <- floor(30000 / ncol_FC)
sample_size <- ifelse(sample_size > nrow_FC, nrow_FC, sample_size)

genes <- sample(rownames(FC), sample_size)
genes <- c(hilight, genes)

ai <- 2
browser()

if (any(hilight %in% genes)) {
genes <- c(hilight, genes)
}

genes <- unique(genes)


## Get data ready
data_1 <- mat$F1
data_2 <- mat$F2
Expand All @@ -90,6 +99,7 @@ compare_plot_fcfc_server <- function(id,
for (j in ncol_d2:1) {
for (i in seq_len(ncol_d1)) {
## Get the data for the current plot

F <- cbind(
data_1[genes, i, drop = FALSE],
data_2[genes, j, drop = FALSE]
Expand Down Expand Up @@ -175,6 +185,9 @@ compare_plot_fcfc_server <- function(id,
fcfcplot.RENDER <- function() {
shiny::validate(shiny::need(getMatrices(), "Please select contrasts and run 'Compute'"))
higenes <- hilightgenes()

ai <- 1
browser()
p <- interactive_fcfc(
plot_data = plot_data, marker_size = 6, cex.axis = 12,
hilight = higenes
Expand Down

0 comments on commit 667c878

Please sign in to comment.