detectStartsInFile: Detects several starts in one file

View source: R/detectStartsInFile.r

detectStartsInFileR Documentation

Detects several starts in one file

Description

Detects several starts in one file (according to a vector of theoretical stimulation times)

Usage

detectStartsInFile(
  ptrFile_i,
  ion,
  startPeaks,
  endPeaks = NULL,
  methods = c("higherThanNoise", "startPeakProportion", "higherDerivative"),
  nPoints = 31,
  multiplyNoiseBy = 1.5,
  statOfNoise = "bl",
  smooth = TRUE,
  proportionOfMax = 0.1,
  peakChoice = "maxIntensity",
  order = 2,
  detectionThreshold = 15,
  firstAmongHighThreshold = 50,
  manual = NULL
)

Arguments

ptrFile_i

data frame exported from ptrViewer

ion

name of the column corresponding to the ion to analyse

startPeaks

a vector containing the stimulation times (theoretical starts) for all files

endPeaks

if NULL, the end of the peak period is given by the next start in startPeaks

methods

Choose among c("higherThanNoise","startPeakProportion","higherDerivative")

nPoints

number of points required in the smoothing function

multiplyNoiseBy

required if method='higherThanNoise' is chosen

statOfNoise

required if method='higherThanNoise'. Statistic to be multiplied by multiplyByNoise ('max' or 'avg'). Can also be 'bl' if corresponding to the estimation of noise during the whole evaluation or 'blper' if

smooth

If TRUE, the data is previously smoothed with the parameter halfWindowsSize

proportionOfMax

Number between 0 and 1. If method startPeakProportion is chosen and length(starts)==1, the starting time will be the first time that the intensity reaches this proportion of the maximale intensity of the peak. If length(starts) > 1, the starting time will be the minimum value obtained with this method for all starts.

peakChoice

"maxIntensity", "first" or "firstAmongHigh"

order

order of the derivative

detectionThreshold

intensity value to be reached to be considered as a peak (default to NULL corresponds to 0)

firstAmongHighThreshold

percentage of the maximum value to be reached in order to be considered as a peak when peak choice is firstAmongHigh

manual

manual results obtained (as a vector of the same length as startPeaks)

Value

a list containing

  • dfres (dataframe with the obtained times)

  • gg (a graphic representing the obtained intensities and the obtained starting times, diagnosis)


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