-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec1c89b
commit 16d5de9
Showing
3 changed files
with
44 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: immApex | ||
Title: Tools for Adaptive Immune Receptor Sequence-Based Keras3 Modeling | ||
Version: 1.0.3 | ||
Date: 2024-11-4 | ||
Version: 1.0.4 | ||
Date: 2024-11-5 | ||
Authors@R: c( | ||
person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "[email protected]")) | ||
Description: A set of tools to build tensorflow/keras3-based models in R from amino acid and nucleotide sequences focusing on adaptive immune receptors. The package includes pre-processing of sequences, unifying gene nomenclature usage, encoding sequences, and combining models. This package will serve as the basis of future immune receptor sequence functions/packages/models compatible with the scRepertoire ecosystem. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,40 @@ | ||
# test script for variationalSequences.R - testcases are NOT comprehensive! | ||
|
||
test_that("variationalSequences works", { | ||
|
||
set.seed(42) | ||
test_that("Test for valid input sequence length", { | ||
expect_error(variationalSequences(input.sequences = character(0)), | ||
"input.sequences must have at least one sequence.") | ||
}) | ||
|
||
test_that("Test for valid encoder function", { | ||
sequences <- c("CASGY", "CASDY", "CASTY") | ||
expect_error(variationalSequences(input.sequences = sequences, | ||
encoder.function = "invalidEncoder"), | ||
"Invalid encoder provided.") | ||
}) | ||
|
||
test_that("Test for valid optimizer", { | ||
sequences <- c("CASGY", "CASDY", "CASTY") | ||
expect_error(variationalSequences(input.sequences = sequences, | ||
optimizer = "invalidOptimizer"), | ||
"Please select a compatible optimizer function in the Keras R implementation.") | ||
}) | ||
|
||
test_that("Test for correct output type", { | ||
sequences <- getdata("generateSequences", "generateSequences_T1")[1:100] | ||
result <- variationalSequences(input.sequences = sequences, | ||
sequence.dictionary = amino.acids[1:20]) | ||
expect_true(is.vector(result)) | ||
}) | ||
|
||
test_that("Test for correct sequence generation", { | ||
sequences <- getdata("generateSequences", "generateSequences_T1")[1:100] | ||
number_of_sequences <- 5 | ||
result <- variationalSequences(input.sequences = sequences, | ||
number.of.sequences = number_of_sequences) | ||
expect_equal(length(result), number_of_sequences) | ||
}) | ||
|
||
#TODO Test for Reproducibility | ||
|
||
if(reticulate::py_module_available("keras")) { | ||
set.seed(42) | ||
test_that("Test for valid input sequence length", { | ||
expect_error(variationalSequences(input.sequences = character(0)), | ||
"input.sequences must have at least one sequence.") | ||
}) | ||
|
||
test_that("Test for valid encoder function", { | ||
sequences <- c("CASGY", "CASDY", "CASTY") | ||
expect_error(variationalSequences(input.sequences = sequences, | ||
encoder.function = "invalidEncoder"), | ||
"Invalid encoder provided.") | ||
}) | ||
|
||
test_that("Test for valid optimizer", { | ||
sequences <- c("CASGY", "CASDY", "CASTY") | ||
expect_error(variationalSequences(input.sequences = sequences, | ||
optimizer = "invalidOptimizer"), | ||
"Please select a compatible optimizer function in the Keras R implementation.") | ||
}) | ||
|
||
test_that("Test for correct output type", { | ||
sequences <- getdata("generateSequences", "generateSequences_T1")[1:100] | ||
result <- variationalSequences(input.sequences = sequences, | ||
sequence.dictionary = amino.acids[1:20]) | ||
expect_true(is.vector(result)) | ||
}) | ||
|
||
test_that("Test for correct sequence generation", { | ||
sequences <- getdata("generateSequences", "generateSequences_T1")[1:100] | ||
number_of_sequences <- 5 | ||
result <- variationalSequences(input.sequences = sequences, | ||
number.of.sequences = number_of_sequences) | ||
expect_equal(length(result), number_of_sequences) | ||
}) | ||
} | ||
}) |