Skip to content

Commit

Permalink
feat: add function to construct objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
joschif committed Mar 8, 2024
1 parent 4c52309 commit 99866bb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ GRNData <- setClass(
)


#' Create GRNData object from a Seurat and a GRN object
#' @rdname create_GRNData
#' @export
create_GRNData <- function(seurat_object, grn_object){
object <- new(
Class = 'GRNData',
grn = grn_object,
data = seurat_object
)

return(object)
}


#' Get network
#' @rdname GetNetwork
#' @method GetNetwork GRNData
Expand Down
5 changes: 5 additions & 0 deletions tests/test_manual.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ test_srt <- initiate_grn(
exclude_exons = T
)

test_srt <- create_GRNData(
test_srt@data,
test_srt@grn
)

test_srt <- find_motifs(
test_srt,
motif_tfs = motif2tf,
Expand Down

0 comments on commit 99866bb

Please sign in to comment.