From 6cb4bd16c04ce01462d0899261fc46abbd50861f Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Wed, 1 May 2024 13:29:36 -0500 Subject: [PATCH] working through check() --- .Rbuildignore | 1 + DESCRIPTION | 4 ++++ NAMESPACE | 2 ++ R/getIR.R | 1 + R/one.hot.encoder.R | 1 + R/property.encoder.R | 6 +++--- tests/testthat.R | 4 ++-- 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 4be4cfa..7264d31 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^codecov\.yml$ ^\.github$ +^www$ diff --git a/DESCRIPTION b/DESCRIPTION index eaebe3a..b8ebd1f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,12 +14,16 @@ biocViews: Software, ImmunoOncology, SingleCell, Classification, Annotation, Seq Depends: R (>= 4.0) Imports: keras, + methods, SingleCellExperiment, + stats, stringi, stringr Suggests: BiocStyle, knitr, + scRepertoire, + spelling, testthat VignetteBuilder: knitr Language: en-US diff --git a/NAMESPACE b/NAMESPACE index a39b0f4..d69b86e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,5 +9,7 @@ export(property.encoder) export(tokenize.sequences) importFrom(SingleCellExperiment,colData) importFrom(keras,array_reshape) +importFrom(methods,slot) +importFrom(stats,setNames) importFrom(stringi,stri_rand_strings) importFrom(stringr,str_split) diff --git a/R/getIR.R b/R/getIR.R index dd58bb1..3e57dc0 100644 --- a/R/getIR.R +++ b/R/getIR.R @@ -60,6 +60,7 @@ getIR <- function(input.data, } #' @importFrom SingleCellExperiment colData +#' @importFrom methods slot .grabMeta <- function(sc) { if (inherits(x=sc, what ="Seurat")) { meta <- data.frame(sc[[]], slot(sc, "active.ident")) diff --git a/R/one.hot.encoder.R b/R/one.hot.encoder.R index 68355c9..5fd9872 100644 --- a/R/one.hot.encoder.R +++ b/R/one.hot.encoder.R @@ -21,6 +21,7 @@ #' This will be overrode if using a motif approach (split.length > 1). #' #' @importFrom keras array_reshape +#' @importFrom stats setNames #' #' @export #' @return One hot encoded amino acid sequences in a matrix or 3D array diff --git a/R/property.encoder.R b/R/property.encoder.R index 2333326..2d01dda 100644 --- a/R/property.encoder.R +++ b/R/property.encoder.R @@ -11,9 +11,9 @@ #' min.length = 8, #' max.length = 16) #' -#' sequence.matrix <- one.hot.encoder(new.sequences, -#' method.to.use = "VHSE", -#' convert.to.matrix = TRUE) +#' sequence.matrix <- property.encoder(new.sequences, +#' method.to.use = "VHSE", +#' convert.to.matrix = TRUE) #' #' @param input.sequences The amino acid sequences to use #' @param max.length Additional length to pad, NULL will pad sequences diff --git a/tests/testthat.R b/tests/testthat.R index c5a1ba1..7b39b16 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -7,6 +7,6 @@ # * https://testthat.r-lib.org/reference/test_package.html#special-files library(testthat) -library(Trex) +library(Apex) -test_check("Trex") +test_check("Apex")