Skip to content

Commit

Permalink
Add pwalign to Suggests, fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
csoneson committed May 18, 2024
1 parent 6aa6c5f commit 4d4b584
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Suggests:
BiocStyle,
knitr,
Biostrings,
pwalign,
plotly
SystemRequirements: GNU make
biocViews: GeneticVariability, GenomicVariation, Preprocessing
Expand Down
4 changes: 2 additions & 2 deletions inst/scripts/generateValuesForUnitTestsTrans.R
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ processReadsTrans <- function(Ldef) {
if (!all(Ldef$constantForward == "") && Ldef$constantMaxDistForward > (-1)) {
constForward <- Biostrings::subseq(fq1, start = Ldef$skipForward + Ldef$umiLengthForward + 1,
width = Ldef$constantLengthForward)
dists <- as.matrix(Biostrings::stringDist(
dists <- as.matrix(pwalign::stringDist(
c(DNAStringSet(structure(Ldef$constantForward,
names = paste0("C", length(Ldef$constantForward)))),
DNAStringSet(constForward)
Expand All @@ -307,7 +307,7 @@ processReadsTrans <- function(Ldef) {
if (!all(Ldef$constantReverse == "") && Ldef$constantMaxDistReverse > (-1)) {
constReverse <- Biostrings::subseq(fq2, start = Ldef$skipReverse + Ldef$umiLengthReverse + 1,
width = Ldef$constantLengthReverse)
dists <- as.matrix(Biostrings::stringDist(
dists <- as.matrix(pwalign::stringDist(
c(DNAStringSet(structure(Ldef$constantReverse,
names = paste0("C", length(Ldef$constantReverse)))),
DNAStringSet(constReverse)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test_calcNearestStringDist.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ test_that("calcNearestStringDist works as expected", {
width = 8),
size = 200))

d0 <- Biostrings::stringDist(x = strs1, method = "hamming")
e0 <- Biostrings::stringDist(x = strs2, method = "levenshtein")
d0 <- pwalign::stringDist(x = strs1, method = "hamming")
e0 <- pwalign::stringDist(x = strs2, method = "levenshtein")

dm <- as.matrix(d0)
em <- as.matrix(e0)
Expand Down

0 comments on commit 4d4b584

Please sign in to comment.