Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tuner committed Jan 14, 2025
1 parent 3414e8a commit b8e4874
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 21 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Authors@R:
person("Kari", "Lavikka", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4163-4945"))
Description:
'Jellyfisher' creates Jellyfish plots using the JavaScript based
'Jellyfish' library. Jellyfish plots integrate both phylogenetic
and sample tree structures in a single visualization.
Jellyfisher creates interactive Jellyfish plots for tumor evolution
visualization. These plots integrate a hierarchical sample structure
and tumor phylogeny into a single visualization, allowing for the
display of both spatial and temporal dimensions of the tumor evolution.
License: MIT
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand All @@ -27,4 +28,4 @@ VignetteBuilder: knitr
biocViews:
Visualization,
Phylogenetics,
Software
Software
14 changes: 12 additions & 2 deletions R/clonevol_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
#' Extracts data frames that can be used to create a Jellyfish plot.
#'
#' @param y A ClonEvol object
#' @param model The model to extract from
#' @param model The model to extract. Defaults to 1
#'
#' @return A named list with three data frames: samples, phylogeny, and compositions
#'
#' @import dplyr
#' @import stringr
#'
#' @examples
#' if (requireNamespace("clonevol", quietly = TRUE)) {
#' # Run ClonEvol. Check the ClonEvol documentation for details.
#' y <- infer.clonal.models(...)
#'
#' # Plot the results
#' extract_tables_from_clonevol(y, model = 1) |>
#' jellyfisher()
#' }
#'
#' @export
#'
extract_tables_from_clonevol <- function(y, model = 1, explicit_parents = list()) {
extract_tables_from_clonevol <- function(y, model = 1) {
if (!requireNamespace("clonevol", quietly = TRUE)) {
stop("The clonevol package must be installed to use this functionality")
}
Expand Down
16 changes: 8 additions & 8 deletions R/jellyfisher.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Auto-generated by generate-R-code.mjs
# Do not edit this file manually

Expand Down Expand Up @@ -64,12 +63,14 @@
#'
#' @examples
#' # Plot the bundled example data
#' data(jellyfisher_example_tables)
#' jellyfisher(jellyfish_example_tables,
#' options = list(
#' sampleHeight = 70,
#' sampleTakenGuide = "none",
#' showLegend = FALSE
#' ))
#' options = list(
#' sampleHeight = 70,
#' sampleTakenGuide = "none",
#' showLegend = FALSE
#' )
#' )
#'
#' @import htmlwidgets
#' @export
Expand Down Expand Up @@ -194,7 +195,7 @@ jellyfisher <- function(tables,
x <- list(
tables = tables,
options = options,
controls = controls
controls = controls
)

# Create widget
Expand All @@ -213,4 +214,3 @@ jellyfisher <- function(tables,
)
)
}

9 changes: 9 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#'
#' @return A list of tables filtered by patient
#'
#' @examples
#' data(jellyfisher_example_tables)
#' jellyfisher_example_tables |>
#' select_patients("EOC809")
#'
#' @export
#'
select_patients <- function(tables, patient) {
Expand All @@ -24,6 +29,10 @@ select_patients <- function(tables, patient) {
#'
#' @param tables A list of tables (samples, phylogeny, compositions)
#'
#' @examples
#' data(jellyfisher_example_tables)
#' validate_tables(jellyfisher_example_tables)
#'
validate_tables <- function(tables) {
stopifnot(
is.data.frame(tables$samples),
Expand Down
15 changes: 13 additions & 2 deletions man/extract_tables_from_clonevol.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions man/jellyfisher.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/select_patients.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/validate_tables.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/generate-R-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ${roxygenOptions.join("\n")}
#'
#' @examples
#' # Plot the bundled example data
#' data(jellyfisher_example_tables)
#' jellyfisher(jellyfish_example_tables,
#' options = list(
#' sampleHeight = 70,
Expand Down

0 comments on commit b8e4874

Please sign in to comment.