diff --git a/fun-groupplots.R b/fun-groupplots.R index 06e56f4..0edd161 100644 --- a/fun-groupplots.R +++ b/fun-groupplots.R @@ -19,7 +19,7 @@ ## ==================================================================================== ## ## gene_pheatmap <- function(data_long,valuename,sampleid,annotation_row=NULL) { - data_long$value = data_long[,valuename] + data_long <- data_long %>% mutate(value=unlist(data_long[,valuename])) exprdat = data_long%>%select(unique_id,sampleid,value)%>%spread(sampleid,value) exprdat = as.matrix(exprdat[,-1]) diff --git a/tests.R b/tests.R index 91bbfa9..abbc94d 100644 --- a/tests.R +++ b/tests.R @@ -28,6 +28,9 @@ glimpse(tmp3$results) tmp3 <- analyze_expression_data(testdata, analysis_method="linear_model", numgeneids = 2) glimpse(tmp3$data_long) glimpse(tmp3$results) +gene_pheatmap(data_long = tmp3$data_long, + sampleid = tmp3$sampledata$sampleid, + valuename = "log2cpm") # non-counts testdata <- read_csv("data/testdata_noncounts.csv") @@ -55,6 +58,11 @@ rna_scatterplot(data_long = tmp4$data_long, color_hi = "orange", sel_genes = NULL ) +gene_pheatmap(data_long = tmp4$data_long, + sampleid = tmp4$sampledata$sampleid, + valuename = "log2cpm") + + png("tmp.png") # can't render in rstudio at the moment heatmap_render( data_analyzed=tmp4,