R/data_funcs.R

Defines functions ovarianDESIDoria2016 bladderMALDIRompp2010

Documented in bladderMALDIRompp2010 ovarianDESIDoria2016

#' Load the example MALDI-MSI data.
#'
#' Loads a single mouse urinary bladder MALDI mass spectrometry imaging dataset
#' acquired in positive ionization mode using Thermo qExactive Orbitrap. The
#' dataset is available at
#' "https://raw.github.com/paoloinglese/SPUTNIKexamples/master/data/bladder_maldi_prepr_MALDIquant.RData"
#' The dataset is loaded in the R environment under the variable name \code{maldiData}.
#'
#' @param verbose Logical (default = TRUE). Show additional output text.
#'
#' @return desiData MS intensity matrix. Rows represent pixels, columns represent
#' matched peaks.
#'
#' @references Rompp, A., Guenther, S., Schober, Y., Schulz, O., Takats, Z., Kummer, W.,
#' & Spengler, B. (2010). Histology by mass spectrometry: label-free tissue
#' characterization obtained from high-accuracy bioanalytical imaging. Angewandte
#' chemie international edition, 49(22), 3834-3838.
#'
#' @importFrom utils download.file
#' @export
#' @aliases bladderMALDIRompp2010
#'
bladderMALDIRompp2010 <- function(verbose = TRUE) {
  maldiData <- NULL

  if (verbose) {
    cat("Downloading the data from the repository...\n")
  }

  addr <- "https://raw.github.com/paoloinglese/SPUTNIKexamples/master/data/maldiData.rda"
  z <- paste0(tempfile(), ".rda")
  tryCatch(download.file(addr, z, mode = "wb"),
    error = function(e) {
      stop(e)
    }
  )

  if (verbose) {
    cat("Loading the data in the R environment...\n")
  }

  load(z)
  ## Delete the temporary file
  file.remove(z)
  # Return the intensity matrix
  return(maldiData)
}

#' Load the example DESI-MSI data.
#'
#' Loads a single human ovarian cancer DESI mass spectrometry imaging dataset
#' acquired in negative ionization mode using Waters XEVO-GS2 qToF. The
#' dataset is available at
#' "https://raw.github.com/paoloinglese/SPUTNIKexamples/master/data/ovarian_xevo_prepr_MALDIquant.RData"
#' The dataset is loaded in the R environment under the variable name \code{maldiData}.
#'
#' @param verbose Logical (default = TRUE). Show additional output text.
#'
#' @return maldiData MS intensity matrix. Rows represent pixels, columns represent
#' matched peaks.
#'
#' @references Doria, M. L., McKenzie, J. S., Mroz, A., Phelps, D. L., Speller,
#' A., Rosini, F., ... & Ghaem-Maghami, S. (2016). Epithelial ovarian carcinoma
#' diagnosis by desorption electrospray ionization mass spectrometry imaging.
#' Scientific reports, 6, 39219.
#'
#' @importFrom utils download.file
#' @export
#' @aliases ovarianDESIDoria2016
#'
ovarianDESIDoria2016 <- function(verbose = TRUE) {
  desiData <- NULL

  if (verbose) {
    cat("Downloading the data from the repository...\n")
  }

  addr <- "https://raw.github.com/paoloinglese/SPUTNIKexamples/master/data/desiData.rda"
  z <- paste0(tempfile(), ".RData")
  tryCatch(download.file(addr, z, mode = "wb"),
    error = function(e) {
      stop(e)
    }
  )

  if (verbose) {
    cat("Loading the data in the R environment...\n")
  }

  load(z)
  ## Delete the temporary file
  file.remove(z)
  # Return the intensity matrix
  return(desiData)
}

Try the SPUTNIK package in your browser

Any scripts or data that you put into this service are public.

SPUTNIK documentation built on Nov. 24, 2022, 5:06 p.m.