Skip to content

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
piplus2 committed Apr 14, 2024
1 parent a647086 commit 767ea23
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 29 deletions.
19 changes: 9 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
Package: SPUTNIK
Type: Package
Title: Spatially automatic denoising for Ims toolkit
Title: Spatially Automatic Denoising for Imaging Mass Spectrometry Toolkit
Version: 1.4.2
Author: Paolo Inglese [aut, cre], Goncalo Correia [aut, ctb]
Maintainer: Paolo Inglese <[email protected]>
Authors@R: c(person("Paolo", "Inglese", email = "[email protected]", role = c("aut", "cre")),
person("Goncalo", "Correia", role = c("aut", "ctb")))
Description: A set of tools for the peak filtering of mass spectrometry
imaging data (MSI or IMS) based on spatial distribution of signal. Given a
region-of-interest (ROI), representing the spatial region where the informative
Authors@R: c(person("Paolo", "Inglese", email = "[email protected]",
role = c("aut", "cre")), person("Goncalo", "Correia", role = c("aut", "ctb")))
Description: Set of tools for peak filtering of mass spectrometry
imaging data based on spatial distribution of signal. Given a
region-of-interest, representing the spatial region where the informative
signal is expected to be localized, a series of filters determine which peak
signals are characterized by an implausible spatial distribution. The filters
reduce the dataset dimensionality and increase its information vs noise ratio,
reduce the dataset dimension and increase its information vs noise ratio,
improving the quality of the unsupervised analysis results, reducing data
dimensionality and simplifying the chemical interpretation.
"SPUTNIK: an R package for filtering of spatially related peaks in mass
spectrometry imaging data" <doi:10.1093/bioinformatics/bty622>
dimension and simplifying the chemical interpretation.
The methods are described in Inglese P. et al (2019) <doi:10.1093/bioinformatics/bty622>.
Depends: R (>= 3.4.0)
License: GPL (>= 3)
Encoding: UTF-8
Expand Down
4 changes: 3 additions & 1 deletion R/continuous_refimg.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#' has negative correlation with the selected image in \code{alignTo}.
#' @param verbose logical (default = TRUE). Additional output text.
#'
#' @return A continuous valued reference image (see \link{msImage}).
#'
#' @details Function to extract the continuous reference image from a
#' \code{\link{msi.dataset-class}} object.
#' The continuous reference image represents the spatial location of the sample.
Expand All @@ -46,7 +48,7 @@
#'
#' @example R/examples/graph_funcs.R
#'
#' @seealso msiDataset
#' @seealso msiDataset, msImage
#' @export
#'
refImageContinuous <- function(msiData,
Expand Down
13 changes: 8 additions & 5 deletions R/examples/msImage_plot.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## Load package
library("SPUTNIK")

## Create ms.image-class object
msIm <- msImage(values = matrix(rnorm(200), 40, 50), name = "test", scale = TRUE)
\donttest{
library("SPUTNIK")

## Plot the image
## plot(msIm)
## Create ms.image-class object
msIm <- msImage(values = matrix(rnorm(200), 40, 50), name = "test", scale = TRUE)

## Plot the image
plot(msIm)
}
1 change: 1 addition & 0 deletions R/filter_csr.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#' @param ... additional parameters compatible with the \code{statspat.core} functions.
#' See \link[spatstat.explore]{cdf.test} for "KS" and \link[spatstat.explore]{clarkevans.test}.
#' for "ClarkEvans"
#' @return List of the p-values and adjusted p-values for the CSR test.
#'
#' @author Paolo Inglese \email{[email protected]}
#'
Expand Down
2 changes: 1 addition & 1 deletion R/filter_global.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' @param cores integer (default = 1). Number of cores for parallel computing.
#' @param verbose logical (default = \code{TRUE}). Additional output text.
#'
#' @return \code{peak.filter} object. See link{applyPeaksFilter}.
#' @return \code{peak.filter} object. See \link{applyPeaksFilter}.
#'
#' @details A filter based on the similarity between the peak signals and a reference
#' signal. The reference signal, passed as an \code{\link{ms.image-class}} object.
Expand Down
2 changes: 2 additions & 0 deletions R/filter_split.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
#' \item the merged peaks image should be more structured than the single
#' peak images, accordingly to the selected \code{sparseness}.
#' }
#'
#' @return \code{peak.filter} object. See \link{applyPeaksFilter}.
#'
#' @author Paolo Inglese \email{[email protected]}
#'
Expand Down
8 changes: 5 additions & 3 deletions R/msi.dataset_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ if (is.null(getGeneric('PCAImage'))) {
#' @param object \link{msi.dataset-class} object.
#' @param alignToSample boolean (default = TRUE). If TRUE, the principal component
#' scores are aligned to the pixel mean intensity.
#' @param seed set the random seed (default = \code{NULL}).
#'
#' @return RGB raster representing the first 3 principal components
#' (see \link{msImage}).
#'
#' @importFrom grDevices rgb
#' @import irlba
Expand All @@ -72,8 +74,8 @@ if (is.null(getGeneric('PCAImage'))) {
setMethod(
f = "PCAImage",
signature = signature(object = "msi.dataset"),
definition = function(object, alignToSample = TRUE) {
set.seed(123)
definition = function(object, alignToSample = TRUE, seed = NULL) {
set.seed(seed)
pca <- prcomp_irlba(object@matrix, center = TRUE, scale. = TRUE, n = 3,)
if (alignToSample) {
if (cor(apply(object@matrix, 1, mean), pca$x[, 1]) < 0) {
Expand All @@ -83,7 +85,7 @@ setMethod(
colors <- apply(pca$x, 2, function(x) (x - min(x)) / (max(x) - min(x)))
colors <- rgb(colors[, 1], colors[, 2], colors[, 3])
colors <- matrix(colors, object@nrow, object@ncol)
return (msImage(values = colors, name = 'PCA', scale = FALSE))
return(msImage(values = colors, name = 'PCA', scale = FALSE))
}
)

Expand Down
2 changes: 2 additions & 0 deletions R/sparseness_funcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#'
#' @param im 2-D numeric matrix representing the image pixel intensities.
#'
#' @return calculated scatter ratio.
#'
#' @references Otsu, N. (1979). A threshold selection method from gray-level
#' histograms. IEEE transactions on systems, man, and cybernetics, 9(1), 62-66.
#'
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ bibentry(
volume = "36",
number = "1",
pages = "178-180",
doi = "https://doi.org/10.1093/bioinformatics/bty622"
url = "https://doi.org/10.1093/bioinformatics/bty622"
)
3 changes: 3 additions & 0 deletions man/CSRPeaksFilter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/PCAImage-msi.dataset-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/globalPeaksFilter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions man/plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/refImageContinuous.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/scatter.ratio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/splitPeaksFilter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 767ea23

Please sign in to comment.