ptrvIntensityByTime: ptrvIntensityByTime

View source: R/ptrvIntensityByTime.r

ptrvIntensityByTimeR Documentation

ptrvIntensityByTime

Description

Calculates the intensity by time for PTRViewer files. The calculation can be done by breathing cycle or on raw data.Breathing cycles are calculated on a reference ion (referenceBreath) with peak picking algorithms

Usage

ptrvIntensityByTime(
  dataset,
  timeCol = "RelTime",
  colToRemove = c("AbsTime", "Cycle"),
  correction = "none",
  referenceBreath = NULL,
  timePeriod = NULL,
  ions = NULL,
  funAggregate = "mean",
  total = FALSE,
  breathRatio = FALSE,
  minExpi = NULL,
  maxInspi = NULL,
  smoothMethodBreath = "MovingAverage",
  minimalDuration = 2,
  forMinExpiDivideMaxIntBy = 4,
  forMaxInspiDivideMaxIntBy = 5,
  halfWindowSize = 5,
  method = "MAD",
  SNR = 0,
  timeStart = 0
)

Arguments

dataset

whose names are timeCol, Ion1,... ,Ionp.

timeCol

name of the column of dataset containing the time

colToRemove

vector containing the names of the columns of datasets to be removed in the analysis (column that are neither the time nor ions names)

correction

"none" or "cycle". See Details.

referenceBreath

name of the ion taken as reference for breathing

timePeriod

vector containing starting and stopping point to get the statistics

ions

vector contatining all ions to be used in the analysis (by default all ions are used)

funAggregate

"mean", "maximal" or "sum"

total

if TRUE, the total intensity is calculated and added as a supplementary column

breathRatio

if TRUE, the ratio between the intensity of ion and the breath is calculated

minExpi

minimal value for an expiry intensity to be detected as an expiry (blue dotted line in the plot).

maxInspi

maximal intensity of the original curve required to be considered as a breathing peak (purple dotted line in the plot)

minimalDuration

minimalDuration of a breathing cycle (2 by default - as a accelerated breathing frequency corresponds to 20 cycles and more by minut and a low frequency is 12 and less -)

forMinExpiDivideMaxIntBy

default to 5. When minExpi is null, it is evaluated as the ratio of the maximal intensity and forMinIntensityDivideMaxIntBy

forMaxInspiDivideMaxIntBy

default to 5. When minExpi is null, it is evaluated as the ratio of the maximal intensity and forMinIntensityDivideMaxIntBy

halfWindowSize

parameter used to determine the smooth for the peak-picking used in break detection

method

method used for peak picking ("MAD" by default)

SNR

Signal noise ratio parameter used in peak picking

timeStart

timeStart is a value to be removed of the relTime column

removeNoise

if TRUE, the averaged intensity obtained during the timeBlank period is removed from the signal

smoothMethod

NULL, "SavitzkyGolay" or "MovingAverage"

Details

if 'cycle' is selected in correction option, the breathing cycles are calculated

Value

a list containing the obtained result (res), ggplot object containing different plots (gg) and, if correction='cycle' the cycle results are also added (detectCycle)


ChemoSens/PTRMSR documentation built on June 15, 2025, 10:40 a.m.