R/RcppExports.R

Defines functions ReduceDataPointsC MergeMassAxis CalcMassAxisBinSize CimzMLStore CimzMLParse CparseBrukerXML

Documented in CalcMassAxisBinSize CparseBrukerXML MergeMassAxis

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' ParseBrukerXML.
#'
#' Reads a Bruker's xml file exported using fleximaging.
#' A list is returned where each element in the list is named according the ROI name.
#' Each element in the list consists in a data.frame with the pixels XY coordinates inside each ROI.
#'
#' @param xml_path the full path where XML file is stored.
#'
#' @return ROI pixel coordinates arranged in a named list.
#' 
CparseBrukerXML <- function(xml_path) {
    .Call('_rMSI_CparseBrukerXML', PACKAGE = 'rMSI', xml_path)
}

CimzMLParse <- function(xml_path) {
    .Call('_rMSI_CimzMLParse', PACKAGE = 'rMSI', xml_path)
}

CimzMLStore <- function(fname, imgInfo) {
    .Call('_rMSI_CimzMLStore', PACKAGE = 'rMSI', fname, imgInfo)
}

#' CalcMassAxisBinSize.
#' 
#' Calc the bin size of a mass axis at each mass channels using simple peak-picking information.
#' 
#' @param mass the mass axis.
#' @param intensity the intensity of a given spectrum.
#' 
#' @return the bin size of each m/z channel.
#' @export
#' 
CalcMassAxisBinSize <- function(mass, intensity) {
    .Call('_rMSI_CalcMassAxisBinSize', PACKAGE = 'rMSI', mass, intensity)
}

#' MergeMassAxis.
#' 
#' Merges two mass axis in a single one using an apropiate bin size.
#' The resulting mass axis will display a bin size equal to the minimum of two supplied vectors. 
#' The bin size must be supplied along each input mass axis.
#' The first mass axis (mz1) can be a zero-length vector.
#' 
#' @param mz1 the first mass axis to merge.
#' @param bins1 the bins size for the first mass axis.
#' @param mz2 the second mass axis to merge.
#' @param intensity2 the spectral intensities corresponding to the second mass axis.
#' 
#' @return a list containing the common mass axis that represents mz1 and mz1 accurately and a boolean indicating if and error was raised.
#' @export
#' 
MergeMassAxis <- function(mz1, bins1, mz2, bins2) {
    .Call('_rMSI_MergeMassAxis', PACKAGE = 'rMSI', mz1, bins1, mz2, bins2)
}

ReduceDataPointsC <- function(mass, intensity, massMin, massMax, npoints) {
    .Call('_rMSI_ReduceDataPointsC', PACKAGE = 'rMSI', mass, intensity, massMin, massMax, npoints)
}
prafols/rMSI documentation built on Dec. 12, 2021, 7:29 p.m.