Commit a30530c5 authored by Pradat Yoann's avatar Pradat Yoann

correct median color pcawg test example

parent 4bec439f
......@@ -6,4 +6,4 @@ repertoire of mutational signatures in human cancer**. *Nature* 2020.
[doi](https://www.nature.com/articles/s41586-020-1943-3).
An example of the current state of development with this picture.
<embed src="/tests/testthat/pdfs_plots/extra_table_grob_cols_more_rows_more_with_color.pdf" type="application/pdf">
![pcawg](assets/table_extra_grob_pcawg.png)
suppressMessages(library(SummarizedExperiment))
suppressMessages(library(dplyr))
suppressMessages(library(tibble))
load("testdata/DBS.rda")
load("testdata/DEXP.rda")
......
......@@ -137,7 +137,9 @@ test_that("extra table grob on pcawg works", {
dcolor <- pcawg_counts %>%
group_by(Cancer.Types) %>%
summarize_at(vars(-Sample.Names, -Accuracy), ~median(.x*1e6/3.2e9))
summarize_at(vars(-Sample.Names, -Accuracy), ~median(.[.!=0]*1e6/3.2e9)) %>%
replace(is.na(.),0)
dcolor <- column_to_rownames(.data=dcolor, var="Cancer.Types")
dcolor <- t(as.matrix(dcolor))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment