Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MICS_Biomathematics
prettyplots
tableExtra
Commits
9eb7a89a
Commit
9eb7a89a
authored
May 08, 2021
by
Pradat Yoann
Browse files
v0.99.9 reorganize test data+add some tests
parent
22f99fae
Pipeline
#11373
failed with stages
in 2 minutes and 18 seconds
Changes
55
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.Rbuildignore
View file @
9eb7a89a
^renv$
^renv\.lock$
^LICENSE\.md$
^\.tool-versions$
^\.gitlab-ci\.yml$
^.*\.pdf$
^.*\.tar\.gz$
Makefile
data-raw
assets
tags
DESCRIPTION
View file @
9eb7a89a
Package: tableExtra
Title: Draws
a
n
a
wesome
t
able
Version: 0.99.
4
Title: Draws
A
n
A
wesome
T
able
Version: 0.99.
9
Authors@R:
person(given = "Yoann",
family = "Pradat",
...
...
@@ -15,6 +15,7 @@ RoxygenNote: 7.1.1
Suggests:
testthat,
dplyr,
forcats,
tibble
Depends:
R (>= 3.5.0)
...
...
NAMESPACE
View file @
9eb7a89a
# Generated by roxygen2: do not edit by hand
export(gtable_cbind)
export(gtable_legend)
export(gtable_rbind)
export(table_extra_grob)
export(ttheme_awesome)
...
...
R/gtables.R
View file @
9eb7a89a
...
...
@@ -23,10 +23,10 @@
#' @author Yoann Pradat
#' @keywords internal
gtable_table
<-
function
(
d
,
widths
,
heights
,
fg_fun
=
text_grob
,
fg_params
=
list
(),
bg_fun
=
NULL
,
bg_params
=
NULL
,
padding
=
unit
(
c
(
4
,
4
),
"mm"
),
name
=
"table"
,
vp
=
NULL
,
rep_mode
=
"row"
,
...
){
fg_fun
=
text_grob
,
fg_params
=
list
(),
bg_fun
=
NULL
,
bg_params
=
NULL
,
padding
=
unit
(
c
(
4
,
4
),
"mm"
),
name
=
"table"
,
vp
=
NULL
,
rep_mode
=
"row"
,
...
){
d
<-
as.matrix
(
d
)
...
...
@@ -85,7 +85,9 @@ gtable_table <- function(d, widths, heights,
#' @param title_x \code{unit} specifying the x position of the title
#' @param title_y \code{unit} specifying the x position of the title
#' @param title_label character vector
#' @param padding \code{unit.list} object specifying the padding between adjacent cells.
#' @param padding numeric vector specifying the padding between adjacent cells.
#' @param size_unit character vector defining the unit used for sizes. See \code{grid::unit} for all possible
#' specifications.
#' @param name optional name of the grob
#' @param vp optional viewport
#' @param ... additional parameters passed to \code{add_table_params}.
...
...
@@ -94,11 +96,14 @@ gtable_table <- function(d, widths, heights,
#' @import gtable
#'
#' @author Yoann Pradat
#' @
keywords internal
#' @
export
gtable_legend
<-
function
(
d
,
labels
,
widths
,
heights
,
fg_fun
,
fg_params
,
bg_fun
=
NULL
,
bg_params
=
NULL
,
title_x
=
NULL
,
title_y
=
NULL
,
title_label
=
"Title"
,
title_gp
=
gpar
(
fontsize
=
10
),
labels_pad
=
unit
(
-1
,
"mm"
),
labels_gp
=
gpar
(
fontsize
=
6
),
padding
=
unit
(
0.3
,
"mm"
),
name
=
"legend"
,
vp
=
NULL
,
orientation
=
"horizontal"
,
...
){
labels_pad
=
-1
,
labels_gp
=
gpar
(
fontsize
=
6
),
padding
=
0.3
,
size_unit
=
"mm"
,
name
=
"legend"
,
vp
=
NULL
,
orientation
=
"horizontal"
,
...
){
labels_pad
<-
unit
(
labels_pad
,
size_unit
)
padding
<-
unit
(
padding
,
size_unit
)
# legend body
g
<-
gtable_table
(
d
,
name
=
name
,
...
...
@@ -108,7 +113,7 @@ gtable_legend <- function(d, labels, widths, heights, fg_fun, fg_params, bg_fun=
bg_fun
=
bg_fun
,
fg_params
=
fg_params
,
bg_params
=
bg_params
,
padding
=
padding
,
...
)
padding
=
padding
,
vp
=
vp
,
...
)
# legend title
g_title
<-
textGrob
(
label
=
title_label
,
...
...
@@ -120,7 +125,7 @@ gtable_legend <- function(d, labels, widths, heights, fg_fun, fg_params, bg_fun=
# legend labels
if
(
orientation
==
"horizontal"
){
x
<-
unit
(
0
,
attr
(
padding
,
"
unit
"
)
)
x
<-
unit
(
0
,
size_
unit
)
for
(
i
in
1
:
length
(
labels
)){
g_label
<-
textGrob
(
label
=
labels
[
i
],
x
=
x
,
...
...
R/pcwag_counts-data.R
deleted
100644 → 0
View file @
22f99fae
#' Mutation counts attributed to each mutational signature in each tumour.
#'
#' Data from the mutational signature analysis of Alexandrov et al. on the PCAWG data.
#' The data is available as supplementary data to the paper "The repertoire of mutational signatures in human cancer"
#' on the Synapse data repository syn11738669
#'
#' \code{pcawg_counts} contains the mutation counts as attributed by the SigProfiler algorithm on the
#' Single-Base-Substitution (SBSs) mutation catalogs of 2780 WGS tumours from the PCAWG.
#'
#' @format A data frame with 2780 rows and 68 variables
#' \describe{
#' \item{Cancer.Types}{37 different cancer types}
#' \item{Sample.Names}{Unique tumour identifiers}
#' \item{Accuracy}{Cosine similarity between the tumour's mutational profile and the reconstructed mutational profile}
#' \item{SBS1}{Single-base-substitution signature 1. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS1.tt>}
#' \item{SBS10a}{Single-base-substitution signature 10a. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS10a.tt>}
#' \item{SBS10b}{Single-base-substitution signature 10b. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS10b.tt>}
#' \item{SBS11}{Single-base-substitution signature 11. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS11.tt>}
#' \item{SBS12}{Single-base-substitution signature 12. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS12.tt>}
#' \item{SBS13}{Single-base-substitution signature 13. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS13.tt>}
#' \item{SBS14}{Single-base-substitution signature 14. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS14.tt>}
#' \item{SBS15}{Single-base-substitution signature 15. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS15.tt>}
#' \item{SBS16}{Single-base-substitution signature 16. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS16.tt>}
#' \item{SBS17a}{Single-base-substitution signature 17a. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS17a.tt>}
#' \item{SBS17b}{Single-base-substitution signature 17b. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS17b.tt>}
#' \item{SBS18}{Single-base-substitution signature 18. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS18.tt>}
#' \item{SBS19}{Single-base-substitution signature 19. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS19.tt>}
#' \item{SBS20}{Single-base-substitution signature 20. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS20.tt>}
#' \item{SBS2}{Single-base-substitution signature 2. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS2.tt>}
#' \item{SBS21}{Single-base-substitution signature 21. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS21.tt>}
#' \item{SBS22}{Single-base-substitution signature 22. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS22.tt>}
#' \item{SBS23}{Single-base-substitution signature 23. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS23.tt>}
#' \item{SBS24}{Single-base-substitution signature 24. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS24.tt>}
#' \item{SBS25}{Single-base-substitution signature 25. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS25.tt>}
#' \item{SBS26}{Single-base-substitution signature 26. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS26.tt>}
#' \item{SBS27}{Single-base-substitution signature 27. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS27.tt>}
#' \item{SBS28}{Single-base-substitution signature 28. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS28.tt>}
#' \item{SBS29}{Single-base-substitution signature 29. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS29.tt>}
#' \item{SBS30}{Single-base-substitution signature 30. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS30.tt>}
#' \item{SBS3}{Single-base-substitution signature 3. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS3.tt>}
#' \item{SBS31}{Single-base-substitution signature 31. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS31.tt>}
#' \item{SBS32}{Single-base-substitution signature 32. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS32.tt>}
#' \item{SBS33}{Single-base-substitution signature 33. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS33.tt>}
#' \item{SBS34}{Single-base-substitution signature 34. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS34.tt>}
#' \item{SBS35}{Single-base-substitution signature 35. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS35.tt>}
#' \item{SBS36}{Single-base-substitution signature 36. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS36.tt>}
#' \item{SBS37}{Single-base-substitution signature 37. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS37.tt>}
#' \item{SBS38}{Single-base-substitution signature 38. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS38.tt>}
#' \item{SBS39}{Single-base-substitution signature 39. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS39.tt>}
#' \item{SBS40}{Single-base-substitution signature 40. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS40.tt>}
#' \item{SBS4}{Single-base-substitution signature 4. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS4.tt>}
#' \item{SBS41}{Single-base-substitution signature 41. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS41.tt>}
#' \item{SBS42}{Single-base-substitution signature 42. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS42.tt>}
#' \item{SBS43}{Single-base-substitution signature 43. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS43.tt>}
#' \item{SBS44}{Single-base-substitution signature 44. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS44.tt>}
#' \item{SBS45}{Single-base-substitution signature 45. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS45.tt>}
#' \item{SBS46}{Single-base-substitution signature 46. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS46.tt>}
#' \item{SBS47}{Single-base-substitution signature 47. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS47.tt>}
#' \item{SBS48}{Single-base-substitution signature 48. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS48.tt>}
#' \item{SBS49}{Single-base-substitution signature 49. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS49.tt>}
#' \item{SBS5}{Single-base-substitution signature 5. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS5.tt>}
#' \item{SBS50}{Single-base-substitution signature 50. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS50.tt>}
#' \item{SBS51}{Single-base-substitution signature 51. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS51.tt>}
#' \item{SBS52}{Single-base-substitution signature 52. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS52.tt>}
#' \item{SBS53}{Single-base-substitution signature 53. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS53.tt>}
#' \item{SBS54}{Single-base-substitution signature 54. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS54.tt>}
#' \item{SBS55}{Single-base-substitution signature 55. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS55.tt>}
#' \item{SBS56}{Single-base-substitution signature 56. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS56.tt>}
#' \item{SBS57}{Single-base-substitution signature 57. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS57.tt>}
#' \item{SBS58}{Single-base-substitution signature 58. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS58.tt>}
#' \item{SBS59}{Single-base-substitution signature 59. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS59.tt>}
#' \item{SBS6}{Single-base-substitution signature 6. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS6.tt>}
#' \item{SBS60}{Single-base-substitution signature 60. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS60.tt>}
#' \item{SBS7a}{Single-base-substitution signature 7a. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7a.tt>}
#' \item{SBS7b}{Single-base-substitution signature 7b. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7b.tt>}
#' \item{SBS7c}{Single-base-substitution signature 7c. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7c.tt>}
#' \item{SBS7d}{Single-base-substitution signature 7d. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7d.tt>}
#' \item{SBS8}{Single-base-substitution signature 8. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS8.tt>}
#' \item{SBS9}{Single-base-substitution signature 9. See <https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS9.tt>}
#' }
#'
#' @docType data
#' @usage data(pcawg_counts)
#' @keywords datasets
#'
#' @references
#' Alexandrov, L.B., Kim, J., Haradhvala, N.J. et al. The repertoire of mutational signatures in human cancer.
#' Nature 578, 94–101 (2020). \url{https://doi.org/10.1038/s41586-020-1943-3}
#'
#' @source Synapse collaborative compute space, <https://www.synapse.org/#!Synapse:syn11804065>
#'
#' @examples
#' data(pcawg_counts)
"pcawg_counts"
R/table_extra_grob.R
View file @
9eb7a89a
...
...
@@ -39,7 +39,7 @@ table_extra_grob <- function(dscale, dcolor=NULL,
widths
<-
rep
(
theme
$
core
$
size
,
ncol
(
dscale
))
heights
<-
rep
(
theme
$
core
$
size
,
nrow
(
dscale
))
g
<-
gtable_table
(
dscale
,
name
=
"c
ircl
e"
,
g
<-
gtable_table
(
dscale
,
name
=
"c
or
e"
,
widths
=
widths
,
heights
=
heights
,
fg_fun
=
theme
$
core
$
fg_fun
,
...
...
R/table_params.R
View file @
9eb7a89a
...
...
@@ -155,7 +155,7 @@ add_table_params <- function(d, params, fun, ...){
}
else
if
(
all.equal
(
fun
,
rect_grob
)
==
T
)
{
extra_params
<-
table_params_rect
(
d
,
...
)
}
else
{
stop
(
"
u
nsupported value of fun"
)
stop
(
"
U
nsupported value of fun"
)
}
return
(
c
(
params
,
extra_params
))
...
...
R/ttheme_awesome.R
View file @
9eb7a89a
...
...
@@ -10,7 +10,9 @@
#' @param color_breaks bin breaks for color palette for core foreground grobs
#' @param rep_mode 'col' or 'row'. Used when recycling fg_params or bg_params to make a matrix of params.
#' @param parse logical, default behaviour for parsing text as plotmath
#' @param padding length-2 unit vector specifying the horizontal and vertical padding of text within each cell
#' @param size_unit character vector defining the unit used for sizes. See \code{grid::unit} for all possible
#' specifications.
#' @param padding length-2 vector specifying the horizontal and vertical padding of text within each cell
#' @param ... extra parameters added to the theme list
#'
#' @importFrom utils modifyList
...
...
@@ -21,35 +23,34 @@
ttheme_awesome
<-
function
(
base_size
=
8
,
base_colour
=
"black"
,
base_family
=
""
,
core_size
=
unit
(
10
,
"mm"
)
,
core_size
=
10
,
scale_breaks
=
10
,
scale_ratio
=
0.25
,
color_palette
=
"black"
,
color_breaks
=
NULL
,
rep_mode
=
"col"
,
parse
=
FALSE
,
padding
=
unit
(
c
(
0.3
,
0.3
),
"mm"
),
...
){
size_unit
=
"mm"
,
padding
=
c
(
0.3
,
0.3
),
...
){
# The code `do.call(mapply, c(fg_params, list(FUN = fg_fun, SIMPLIFY=FALSE)))`
# cannot accomodate variables of the class `unit`.
# Current fix: split the value and the unit.
core_size_value
<-
as.numeric
(
core_size
)
core_size_unit
<-
attr
(
core_size
,
"unit"
)
core
<-
list
(
fg_fun
=
circle_grob
,
fg_params
=
list
(
col
=
"white"
,
lwd
=
0
),
bg_fun
=
rect_grob
,
bg_params
=
list
(
fill
=
c
(
"#f2f2f2"
,
"#e5e5e5"
),
width
=
core_size
_value
,
height
=
core_size
_value
,
default.units
=
core_
size_unit
,
width
=
core_size
,
height
=
core_size
,
default.units
=
size_unit
,
lwd
=
0
,
col
=
"white"
),
rep_mode
=
rep_mode
,
size
=
core_size
,
size
=
unit
(
core_size
,
size_unit
),
scale_breaks
=
scale_breaks
,
scale_ratio
=
scale_ratio
,
color_palette
=
color_palette
,
color_breaks
=
color_breaks
,
padding
=
padding
)
padding
=
unit
(
padding
,
size_unit
)
)
colhead
<-
list
(
fg_fun
=
text_grob
,
fg_params
=
list
(
parse
=
parse
,
col
=
base_colour
,
...
...
@@ -61,10 +62,10 @@ ttheme_awesome <- function(base_size=8,
rot
=
90
),
bg_fun
=
rect_grob
,
bg_params
=
list
(
fill
=
c
(
"white"
),
width
=
core_size
_value
,
default.units
=
core_
size_unit
,
width
=
core_size
,
default.units
=
size_unit
,
lwd
=
0
,
col
=
"white"
),
padding
=
padding
)
padding
=
unit
(
padding
,
size_unit
)
)
colmore
<-
list
(
fg_fun
=
text_grob
,
fg_params
=
list
(
parse
=
parse
,
col
=
base_colour
,
...
...
@@ -76,10 +77,10 @@ ttheme_awesome <- function(base_size=8,
rot
=
90
),
bg_fun
=
rect_grob
,
bg_params
=
list
(
fill
=
c
(
"white"
),
width
=
core_size
_value
,
default.units
=
core_
size_unit
,
width
=
core_size
,
default.units
=
size_unit
,
lwd
=
0
,
col
=
"white"
),
padding
=
padding
)
padding
=
unit
(
padding
,
size_unit
)
)
rowhead
<-
list
(
fg_fun
=
text_grob
,
fg_params
=
list
(
parse
=
parse
,
col
=
base_colour
,
...
...
@@ -90,10 +91,10 @@ ttheme_awesome <- function(base_size=8,
x
=
0.95
),
bg_fun
=
rect_grob
,
bg_params
=
list
(
fill
=
c
(
"white"
),
height
=
core_size
_value
,
default.units
=
core_
size_unit
,
height
=
core_size
,
default.units
=
size_unit
,
lwd
=
0
,
col
=
"white"
),
padding
=
padding
)
padding
=
unit
(
padding
,
size_unit
)
)
rowmore
<-
list
(
fg_fun
=
text_grob
,
fg_params
=
list
(
parse
=
parse
,
col
=
base_colour
,
...
...
@@ -104,10 +105,10 @@ ttheme_awesome <- function(base_size=8,
x
=
0
),
bg_fun
=
rect_grob
,
bg_params
=
list
(
fill
=
c
(
"white"
),
height
=
core_size
_value
,
default.units
=
core_
size_unit
,
height
=
core_size
,
default.units
=
size_unit
,
lwd
=
0
,
col
=
"white"
),
padding
=
padding
)
padding
=
unit
(
padding
,
size_unit
)
)
default
<-
list
(
core
=
core
,
colhead
=
colhead
,
...
...
data-raw/cosmic_v3_aetiologies.csv
deleted
100644 → 0
View file @
22f99fae
"Aetiology","Signature"
"Spontaneous deamination of 5-methylcytosine (clock-like signature)","SBS1"
"Activity of APOBEC family of cytidine deaminases","SBS2"
"Defective homologous recombination DNA damage repair","SBS3"
"Tobacco smoking","SBS4"
"Unknown (clock-like signature)","SBS5"
"Defective DNA mismatch repair","SBS6"
"Ultraviolet light exposure","SBS7a"
"Ultraviolet light exposure","SBS7b"
"Ultraviolet light exposure","SBS7c"
"Ultraviolet light exposure","SBS7d"
"Unknown","SBS8"
"Polimerase eta somatic hypermutation activity","SBS9"
"Polymerase epsilon exonuclease domain mutations","SBS10a"
"Polymerase epsilon exonuclease domain mutations","SBS10b"
"Temozolomide treatment","SBS11"
"Unknown","SBS12"
"Activity of APOBEC family of cytidine deaminases","SBS13"
"Concurrent polymerase epsilon mutation and defective DNA mismatch repair","SBS14"
"Defective DNA mismatch repair","SBS15"
"Unknown","SBS16"
"Unknown","SBS17a"
"Unknown","SBS17b"
"Damage by reactive oxygen species","SBS18"
"Unknown","SBS19"
"Concurrent POLD1 mutations and defective DNA mismatch repair","SBS20"
"Defective DNA mismatch repair","SBS21"
"Aristolochic acid exposure","SBS22"
"Unknown","SBS23"
"Aflatoxin exposure","SBS24"
"Chemotherapy treatment","SBS25"
"Defective DNA mismatch repair","SBS26"
"Possible sequencing artefact","SBS27"
"Unknown","SBS28"
"Tobacco chewing","SBS29"
"Defective DNA base excision repair due to NTHL1 mutations","SBS30"
"Platinum chemotherapy treatment","SBS31"
"Azathioprine treatment","SBS32"
"Unknown","SBS33"
"Unknown","SBS34"
"Platinum chemotherapy treatment","SBS35"
"Defective DNA base excision repair due to MUTYH mutations","SBS36"
"Unknown","SBS37"
"Indirect effect of ultraviolet light","SBS38"
"Unknown","SBS39"
"Unknown","SBS40"
"Unknown","SBS41"
"Haloalkane exposure","SBS42"
"Possible sequencing artefact","SBS43"
"Defective DNA mismatch repair","SBS44"
"Possible sequencing artefact","SBS45"
"Possible sequencing artefact","SBS46"
"Possible sequencing artefact","SBS47"
"Possible sequencing artefact","SBS48"
"Possible sequencing artefact","SBS49"
"Possible sequencing artefact","SBS50"
"Possible sequencing artefact","SBS51"
"Possible sequencing artefact","SBS52"
"Possible sequencing artefact","SBS53"
"Possible sequencing artefact","SBS54"
"Possible sequencing artefact","SBS55"
"Possible sequencing artefact","SBS56"
"Possible sequencing artefact","SBS57"
"Possible sequencing artefact","SBS58"
"Possible sequencing artefact","SBS59"
"Possible sequencing artefact","SBS60"
"Activity of activation-induced cytidine deaminase (AID)","SBS84"
"Indirect effects of activation-induced cytidine deaminase (AID)","SBS85"
"Unknown chemotherapy treatment","SBS86"
"Thiopurine chemotherapy treatment","SBS87"
"Colibactin exposure (E.coli bacteria carrying pks pathogenicity island)","SBS88"
"Unknown","SBS89"
"Duocarmycin exposure","SBS90"
man/gtable_legend.Rd
View file @
9eb7a89a
...
...
@@ -17,9 +17,10 @@ gtable_legend(
title_y = NULL,
title_label = "Title",
title_gp = gpar(fontsize = 10),
labels_pad =
unit(-1, "mm")
,
labels_pad =
-1
,
labels_gp = gpar(fontsize = 6),
padding = unit(0.3, "mm"),
padding = 0.3,
size_unit = "mm",
name = "legend",
vp = NULL,
orientation = "horizontal",
...
...
@@ -47,7 +48,10 @@ gtable_legend(
\item{title_label}{character vector}
\item{padding}{\code{unit.list} object specifying the padding between adjacent cells.}
\item{padding}{numeric vector specifying the padding between adjacent cells.}
\item{size_unit}{character vector defining the unit used for sizes. See \code{grid::unit} for all possible
specifications.}
\item{name}{optional name of the grob}
...
...
@@ -64,4 +68,3 @@ Build a grob with a legend inside.
\author{
Yoann Pradat
}
\keyword{internal}
man/pcawg_counts.Rd
deleted
100644 → 0
View file @
22f99fae
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pcwag_counts-data.R
\docType{data}
\name{pcawg_counts}
\alias{pcawg_counts}
\title{Mutation counts attributed to each mutational signature in each tumour.}
\format{
A data frame with 2780 rows and 68 variables
\describe{
\item{Cancer.Types}{37 different cancer types}
\item{Sample.Names}{Unique tumour identifiers}
\item{Accuracy}{Cosine similarity between the tumour's mutational profile and the reconstructed mutational profile}
\item{SBS1}{Single-base-substitution signature 1. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS1.tt}}
\item{SBS10a}{Single-base-substitution signature 10a. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS10a.tt}}
\item{SBS10b}{Single-base-substitution signature 10b. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS10b.tt}}
\item{SBS11}{Single-base-substitution signature 11. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS11.tt}}
\item{SBS12}{Single-base-substitution signature 12. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS12.tt}}
\item{SBS13}{Single-base-substitution signature 13. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS13.tt}}
\item{SBS14}{Single-base-substitution signature 14. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS14.tt}}
\item{SBS15}{Single-base-substitution signature 15. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS15.tt}}
\item{SBS16}{Single-base-substitution signature 16. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS16.tt}}
\item{SBS17a}{Single-base-substitution signature 17a. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS17a.tt}}
\item{SBS17b}{Single-base-substitution signature 17b. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS17b.tt}}
\item{SBS18}{Single-base-substitution signature 18. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS18.tt}}
\item{SBS19}{Single-base-substitution signature 19. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS19.tt}}
\item{SBS20}{Single-base-substitution signature 20. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS20.tt}}
\item{SBS2}{Single-base-substitution signature 2. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS2.tt}}
\item{SBS21}{Single-base-substitution signature 21. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS21.tt}}
\item{SBS22}{Single-base-substitution signature 22. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS22.tt}}
\item{SBS23}{Single-base-substitution signature 23. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS23.tt}}
\item{SBS24}{Single-base-substitution signature 24. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS24.tt}}
\item{SBS25}{Single-base-substitution signature 25. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS25.tt}}
\item{SBS26}{Single-base-substitution signature 26. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS26.tt}}
\item{SBS27}{Single-base-substitution signature 27. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS27.tt}}
\item{SBS28}{Single-base-substitution signature 28. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS28.tt}}
\item{SBS29}{Single-base-substitution signature 29. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS29.tt}}
\item{SBS30}{Single-base-substitution signature 30. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS30.tt}}
\item{SBS3}{Single-base-substitution signature 3. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS3.tt}}
\item{SBS31}{Single-base-substitution signature 31. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS31.tt}}
\item{SBS32}{Single-base-substitution signature 32. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS32.tt}}
\item{SBS33}{Single-base-substitution signature 33. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS33.tt}}
\item{SBS34}{Single-base-substitution signature 34. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS34.tt}}
\item{SBS35}{Single-base-substitution signature 35. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS35.tt}}
\item{SBS36}{Single-base-substitution signature 36. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS36.tt}}
\item{SBS37}{Single-base-substitution signature 37. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS37.tt}}
\item{SBS38}{Single-base-substitution signature 38. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS38.tt}}
\item{SBS39}{Single-base-substitution signature 39. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS39.tt}}
\item{SBS40}{Single-base-substitution signature 40. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS40.tt}}
\item{SBS4}{Single-base-substitution signature 4. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS4.tt}}
\item{SBS41}{Single-base-substitution signature 41. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS41.tt}}
\item{SBS42}{Single-base-substitution signature 42. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS42.tt}}
\item{SBS43}{Single-base-substitution signature 43. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS43.tt}}
\item{SBS44}{Single-base-substitution signature 44. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS44.tt}}
\item{SBS45}{Single-base-substitution signature 45. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS45.tt}}
\item{SBS46}{Single-base-substitution signature 46. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS46.tt}}
\item{SBS47}{Single-base-substitution signature 47. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS47.tt}}
\item{SBS48}{Single-base-substitution signature 48. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS48.tt}}
\item{SBS49}{Single-base-substitution signature 49. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS49.tt}}
\item{SBS5}{Single-base-substitution signature 5. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS5.tt}}
\item{SBS50}{Single-base-substitution signature 50. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS50.tt}}
\item{SBS51}{Single-base-substitution signature 51. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS51.tt}}
\item{SBS52}{Single-base-substitution signature 52. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS52.tt}}
\item{SBS53}{Single-base-substitution signature 53. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS53.tt}}
\item{SBS54}{Single-base-substitution signature 54. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS54.tt}}
\item{SBS55}{Single-base-substitution signature 55. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS55.tt}}
\item{SBS56}{Single-base-substitution signature 56. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS56.tt}}
\item{SBS57}{Single-base-substitution signature 57. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS57.tt}}
\item{SBS58}{Single-base-substitution signature 58. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS58.tt}}
\item{SBS59}{Single-base-substitution signature 59. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS59.tt}}
\item{SBS6}{Single-base-substitution signature 6. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS6.tt}}
\item{SBS60}{Single-base-substitution signature 60. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS60.tt}}
\item{SBS7a}{Single-base-substitution signature 7a. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7a.tt}}
\item{SBS7b}{Single-base-substitution signature 7b. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7b.tt}}
\item{SBS7c}{Single-base-substitution signature 7c. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7c.tt}}
\item{SBS7d}{Single-base-substitution signature 7d. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS7d.tt}}
\item{SBS8}{Single-base-substitution signature 8. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS8.tt}}
\item{SBS9}{Single-base-substitution signature 9. See \url{https://cancer.sanger.ac.uk/cosmic/signatures/SBS/SBS9.tt}}
}
}
\source{
Synapse collaborative compute space, \url{https://www.synapse.org/#!Synapse:syn11804065}
}
\usage{
data(pcawg_counts)
}
\description{
Data from the mutational signature analysis of Alexandrov et al. on the PCAWG data.
The data is available as supplementary data to the paper "The repertoire of mutational signatures in human cancer"
on the Synapse data repository syn11738669
}
\details{
\code{pcawg_counts} contains the mutation counts as attributed by the SigProfiler algorithm on the
Single-Base-Substitution (SBSs) mutation catalogs of 2780 WGS tumours from the PCAWG.
}
\examples{
data(pcawg_counts)
}
\references{
Alexandrov, L.B., Kim, J., Haradhvala, N.J. et al. The repertoire of mutational signatures in human cancer.
Nature 578, 94–101 (2020). \url{https://doi.org/10.1038/s41586-020-1943-3}
}
\keyword{datasets}
man/ttheme_awesome.Rd
View file @
9eb7a89a
...
...
@@ -8,14 +8,15 @@ ttheme_awesome(
base_size = 8,
base_colour = "black",
base_family = "",
core_size =
unit(10, "mm")
,
core_size =
10
,
scale_breaks = 10,
scale_ratio = 0.25,
color_palette = "black",
color_breaks = NULL,
rep_mode = "col",
parse = FALSE,
padding = unit(c(0.3, 0.3), "mm"),
size_unit = "mm",
padding = c(0.3, 0.3),
...
)
}
...
...
@@ -40,7 +41,10 @@ ttheme_awesome(
\item{parse}{logical, default behaviour for parsing text as plotmath}
\item{padding}{length-2 unit vector specifying the horizontal and vertical padding of text within each cell}
\item{size_unit}{character vector defining the unit used for sizes. See \code{grid::unit} for all possible
specifications.}
\item{padding}{length-2 vector specifying the horizontal and vertical padding of text within each cell}
\item{...}{extra parameters added to the theme list}
}
...
...
renv.lock
View file @
9eb7a89a
...
...
@@ -74,10 +74,10 @@
},
"dplyr": {
"Package": "dplyr",
"Version": "1.0.
2
",
"Version": "1.0.
5
",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "d0
509913b27ea898189ee664b6030dc2
"
"Hash": "d0
d76c11ec807eb3f000eba4e3eb0f68
"
},
"ellipsis": {
"Package": "ellipsis",
...
...
@@ -130,10 +130,10 @@
},
"lifecycle": {
"Package": "lifecycle",
"Version": "
0.2
.0",
"Version": "
1.0
.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "3
61811f31f71f8a617a9a68bf63f1f42
"
"Hash": "3
471fb65971f1a7b2d4ae7848cf2db8d
"
},
"magrittr": {
"Package": "magrittr",
...
...
@@ -221,10 +221,10 @@
},
"rlang": {
"Package": "rlang",
"Version": "0.4.
8
",
"Version": "0.4.
10
",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "
843a6af51414bce7f8a8e372f11d6cd0
"
"Hash": "
599df23c40a4fce9c7b4764f28c37857
"
},
"rprojroot": {
"Package": "rprojroot",
...
...
@@ -270,10 +270,10 @@
},
"vctrs": {
"Package": "vctrs",
"Version": "0.3.
5
",
"Version": "0.3.
6
",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "
d25c5bea636cf892edbfd64fc3d20c20
"
"Hash": "
5cf1957f93076c19fdc81d01409d240b
"
},
"waldo": {
"Package": "waldo",
...
...
tableExtra_0.99.4.pdf
deleted
100644 → 0
View file @
22f99fae
File deleted
tableExtra_0.99.4.tar.gz
deleted
100644 → 0
View file @
22f99fae
File deleted
tests/testthat/helper.R
View file @
9eb7a89a
...
...
@@ -3,9 +3,11 @@ suppressMessages(library(tibble))
load
(
"testdata/DBS.rda"
)
load
(
"testdata/DEXP.rda"
)
load
(
"testdata/pcawg_counts.rda"
)
load
(
"testdata/sbs_aetiologies.rda"
)