Skip to content

Commit

Permalink
remove .topHatR
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibb committed Apr 11, 2014
1 parent 35a02d3 commit 413f9d1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ INTERNAL CHANGES
in 0.2.
* `.lowerConvexHullR`: removed. It was replaced by a C version of
`.estimateBaselineConvexHull` in 0.3.
* `.topHatR`: removed. It was never used and replaced by a C version of
`.estimateBaselineTopHat` in 1.6.


CHANGES IN MALDIquant VERSION 1.9 [2014-01-14]:
Expand Down
16 changes: 0 additions & 16 deletions R/estimateBaseline-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,3 @@
return(cbind(x, y))
}

## R only: obsolete because too slow
.topHatR <- function(x, y, halfWindowSize=100L) {

.stopIfNotIsValidHalfWindowSize(halfWindowSize=halfWindowSize, n=length(x))

windowSize <- 2L*halfWindowSize+1L

windows <- embed(c(rep(y[1L], halfWindowSize), y,
rep(tail(y, 1L), halfWindowSize)), windowSize)
e <- apply(windows, 1L, min)
windows <- embed(c(rep(e[1L], halfWindowSize), e,
rep(tail(e, 1L), halfWindowSize)), windowSize)
y <- apply(windows, 1L, max)
return(cbind(x, y))
}

3 changes: 0 additions & 3 deletions tests/testthat/test_estimateBaseline-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ test_that("estimateBaselineTopHat", {
m[, 2] <- c(rep(8, 3), 7:1, rep(6, 5), 5:1)
m1 <- m
m1[, 2] <- c(rep(9, 2), 8:1, rep(8, 3), 7:1)
## C implementation
expect_identical(MALDIquant:::.estimateBaselineTopHat(1:20, i, 1), m1)
expect_identical(MALDIquant:::.estimateBaselineTopHat(1:20, i, 2), m)
## obsolete (slow) R implementation
expect_equal(MALDIquant:::.topHatR(1:20, i, 2), m)

## user method
colnames(m) <- c("mass", "intensity")
Expand Down

0 comments on commit 413f9d1

Please sign in to comment.