diff --git a/R/objects.R b/R/objects.R index 2a9ad62..c64a609 100644 --- a/R/objects.R +++ b/R/objects.R @@ -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 diff --git a/tests/test_manual.R b/tests/test_manual.R index cb25e71..0f263b0 100644 --- a/tests/test_manual.R +++ b/tests/test_manual.R @@ -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,