Skip to content

Commit

Permalink
fix examples for createCrossSection and addHMRF
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed May 21, 2024
1 parent 490b714 commit 128d8b9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
13 changes: 11 additions & 2 deletions R/cross_section.R
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,18 @@ create_mesh_grid_lines <- function(
#' network object. The users need to provide the definition of the cross
#' section plane (see method).
#' @examples
#' g <- GiottoData::loadGiottoMini("visium")
#' g <- GiottoData::loadGiottoMini("starmap")
#'
#' createCrossSection(gobject = g, spatial_network_name = "spatial_network")
#' g <- createCrossSection(
#' gobject = g,
#' method = "equation",
#' equation=c(0,1,0,600),
#' extend_ratio = 0.6,
#' name = "new_cs",
#' return_gobject = TRUE
#' )
#'
#' crossSectionPlot(g, name = "new_cs")
#' @export
createCrossSection <- function(gobject,
spat_unit = NULL,
Expand Down
25 changes: 21 additions & 4 deletions R/python_hmrf.R
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,28 @@ writeHMRFresults <- function(gobject,
#' g <- GiottoData::loadGiottoMini("visium")
#' spat_genes <- binSpect(g)
#'
#' output_folder <- tempdir()
#' doHMRF(g, spatial_genes = spat_genes[seq_len(10)]$feats,
#' output_folder = output_folder)
#' output_folder <- file.path(tempdir(), 'HMRF')
#' if(!file.exists(output_folder)) dir.create(output_folder, recursive = TRUE)
#'
#' out <- doHMRF(
#' g, spatial_genes = spat_genes[seq_len(20)]$feats,
#' expression_values = "scaled",
#' spatial_network_name = "Delaunay_network",
#' k = 6, betas = c(0, 10, 5),
#' output_folder = output_folder
#' )
#'
#' g <- addHMRF(
#' gobject = g,
#' HMRFoutput = out,
#' k = 6,
#' betas_to_add = 20,
#' hmrf_name = "HMRF"
#' )
#'
#' addHMRF(gobject = g, HMRFoutput = doHMRF)
#' spatPlot(
#' gobject = g, cell_color = 'HMRF_k6_b.20',
#' )
#' @export
addHMRF <- function(gobject,
spat_unit = NULL,
Expand Down
25 changes: 21 additions & 4 deletions man/addHMRF.Rd

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

13 changes: 11 additions & 2 deletions man/createCrossSection.Rd

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

0 comments on commit 128d8b9

Please sign in to comment.