Skip to content

Commit

Permalink
hide helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
christianholland committed Apr 3, 2020
1 parent 4b7fdb2 commit e541f60
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion R/helpers.R
Expand Up @@ -6,7 +6,9 @@
#' @param df A regulon table from dorothea package.
#'
#' @return Regulons in the \code{viper} format.
df2regulon <- function(df) {
#'
#' @keywords internal
.df2regulon <- function(df) {
regulon_list = split(df, df$tf)

viper_regulons = lapply(regulon_list, function(regulon) {
Expand Down
2 changes: 1 addition & 1 deletion R/viper_wrapper.R
Expand Up @@ -82,7 +82,7 @@ run_viper.Seurat <- function(input, regulons, options = list(), tidy = FALSE) {
run_viper.matrix <- function(input, regulons, options = list(), tidy=FALSE) {
viper_res <- do.call(viper::viper,
c(list(eset = input,
regulon = df2regulon(regulons)),
regulon = .df2regulon(regulons)),
options))

if (tidy) {
Expand Down
7 changes: 4 additions & 3 deletions man/df2regulon.Rd → man/dot-df2regulon.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-helpers.R
@@ -1,6 +1,6 @@
test_that("test df2regulon", {

res = df2regulon(dorothea_hs)
res = .df2regulon(dorothea_hs)

# test if a list is returned
expect_equal(class(res), "list")
Expand Down

0 comments on commit e541f60

Please sign in to comment.