diff --git a/R/utils.R b/R/utils.R index 87960d1..3397a37 100644 --- a/R/utils.R +++ b/R/utils.R @@ -23,8 +23,8 @@ check_arg <- function(arg, allow_class = c("character"), allow_len = NULL) { #' Read in data if an object looks like path to it. #' -#' @param obj -#' @return obj the object itself in case its not a character +#' @param obj Object to read if not already object +#' @return obj Object itself in case its not a character read_if_char <- function(obj) { if (is(obj, "character")) { obj <- read.csv(obj, stringsAsFactors = FALSE) diff --git a/man/check_arg.Rd b/man/check_arg.Rd new file mode 100644 index 0000000..83da77a --- /dev/null +++ b/man/check_arg.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{check_arg} +\alias{check_arg} +\title{Check input arguments} +\usage{ +check_arg(arg, allow_class = c("character"), allow_len = NULL) +} +\arguments{ +\item{arg}{The argument to check} + +\item{allow_class}{Vector of allowed classes} + +\item{allow_len}{Vector of allowed lengths} +} +\description{ +Accepts an object and rules for checking, stops if rules not met. +} diff --git a/man/conv_py_bools.Rd b/man/conv_py_bools.Rd new file mode 100644 index 0000000..da33af5 --- /dev/null +++ b/man/conv_py_bools.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{conv_py_bools} +\alias{conv_py_bools} +\title{Change cases of True/False syntax from Python to TRUE/FALSE R syntax} +\usage{ +conv_py_bools(obj) +} +\arguments{ +\item{obj}{Object that will be converted} +} +\value{ +obj The converted object +} +\description{ +Change cases of True/False syntax from Python to TRUE/FALSE R syntax +} diff --git a/man/create_rl_map_cellphonedb.Rd b/man/create_rl_map_cellphonedb.Rd index 9156776..7075a55 100644 --- a/man/create_rl_map_cellphonedb.Rd +++ b/man/create_rl_map_cellphonedb.Rd @@ -12,7 +12,6 @@ create_rl_map_cellphonedb( database_name = "CellPhoneDB", gene_conv = NULL, gene_conv_host = "https://www.ensembl.org", - alternate_convert = FALSE, alternate_convert_table = NULL ) } @@ -31,9 +30,7 @@ create_rl_map_cellphonedb( \item{gene_conv_host}{host for conversion; default ensembl, could also use mirrors if desired} -\item{alternate_convert}{boolean if you would like to use a non-ensembl method of conversion (must supply table; not recommended, use only if ensembl is down)} - -\item{alternate_convert_table}{supplied table for non-ensembl method of conversion} +\item{alternate_convert_table}{supplied table for non-ensembl method of conversion (not recommended, use only if ensembl is down))} } \value{ Data frame where each row describes a possible receptor-ligand interaction diff --git a/man/read_if_char.Rd b/man/read_if_char.Rd new file mode 100644 index 0000000..7efac3d --- /dev/null +++ b/man/read_if_char.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{read_if_char} +\alias{read_if_char} +\title{Read in data if an object looks like path to it.} +\usage{ +read_if_char(obj) +} +\arguments{ +\item{obj}{Object to read if not already object} +} +\value{ +obj Object itself in case its not a character +} +\description{ +Read in data if an object looks like path to it. +} diff --git a/tests/testthat/test-import_fxns.R b/tests/testthat/test-import_fxns.R index 6789e51..4319266 100644 --- a/tests/testthat/test-import_fxns.R +++ b/tests/testthat/test-import_fxns.R @@ -79,37 +79,36 @@ test_that("building a domino object under set parameters", { }) test_that("create_rl_map_cellphonedb fails on wrong input arg type.", { - load(test_path("testdata", "sysdata.rda")) expect_error(create_rl_map_cellphonedb( - genes = list(), proteins = proteins_test, - interactions = interactions_test, complexes = complexes_test + genes = list(), proteins = proteins_tiny, + interactions = interactions_tiny, complexes = complexes_tiny )) expect_error(create_rl_map_cellphonedb( - genes = genes_test, proteins = list(), - interactions = interactions_test, complexes = complexes_test + genes = genes_tiny, proteins = list(), + interactions = interactions_tiny, complexes = complexes_tiny )) expect_error(create_rl_map_cellphonedb( - genes = genes_test, proteins = proteins_test, - interactions = list(), complexes = complexes_test + genes = genes_tiny, proteins = proteins_tiny, + interactions = list(), complexes = complexes_tiny )) expect_error(create_rl_map_cellphonedb( - genes = genes_test, proteins = proteins_test, - interactions = interactions_test, complexes = list() + genes = genes_tiny, proteins = proteins_tiny, + interactions = interactions_tiny, complexes = list() )) expect_error(create_rl_map_cellphonedb( - genes = genes_test, proteins = proteins_test, - interactions = interactions_test, complexes = complexes_test, + genes = genes_tiny, proteins = proteins_tiny, + interactions = interactions_tiny, complexes = complexes_tiny, database_name = list() )) expect_error(create_rl_map_cellphonedb( - genes = genes_test, proteins = proteins_test, - interactions = interactions_test, complexes = complexes_test, + genes = genes_tiny, proteins = proteins_tiny, + interactions = interactions_tiny, complexes = complexes_tiny, database_name = c("length", ">1") )) })