Skip to content

Commit

Permalink
fix: plot correlation csv
Browse files Browse the repository at this point in the history
  • Loading branch information
ESCRI11 committed Mar 18, 2024
1 parent 562c614 commit 3e6bcec
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/board.dataview/R/dataview_plot_correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,23 @@ dataview_plot_correlation_server <- function(id,
plotly_modal_default()
}

plot_data_csv <- function() {
pd <- plot_data()
df <- pd[[1]]
df$genes <- factor(df$genes, levels = df$genes)
df$gene_title <- stringr::str_extract(df$annot, "(?<=gene_title: <b>)[^<]+")
df$gene_name <- stringr::str_extract(df$annot, "(?<=gene_name: <b>)[^<]+")
df$color <- NULL
df$annot <- NULL
return(df)
}

PlotModuleServer(
"pltsrv",
plotlib = "plotly",
func = plotly.RENDER,
func2 = modal_plotly.RENDER,
csvFunc = plot_data, ## *** downloadable data as CSV
csvFunc = plot_data_csv, ## *** downloadable data as CSV
res = c(80, 170), ## resolution of plots
pdf.width = 6, pdf.height = 6,
add.watermark = watermark
Expand Down

0 comments on commit 3e6bcec

Please sign in to comment.