Skip to content

Commit

Permalink
fix gene_pheatmap not working for some data
Browse files Browse the repository at this point in the history
  • Loading branch information
jminnier committed Oct 14, 2020
1 parent 6353cc6 commit e82ead2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fun-groupplots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
8 changes: 8 additions & 0 deletions tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e82ead2

Please sign in to comment.