DiffPosMax {similaRpeak} | R Documentation

## DiffPosMax class

### Description

An object which is a interface to calculate he difference of profiles maximal peaks positions.

The `DiffPosMax` object is needed to calculate the difference of profiles maximal peaks positions. A threshold and the two profiles are set during the `DiffPosMax` object creation. If different thresholds or profiles are needed, the `calculateMetric` function should be used, with the new profiles and thresholds passed as arguments to update those values inside the `DiffPosMax` object.

The threshold is the minimum peak value accepted to calculate the ratio.

The thresholdDiff is the maximum distance accepted between two maximum peaks positions in the same profile. When the thresholdDiff is not respected, the profile is considered having more than one peak.

The tolerance is the maximum variation accepted on the maximum peak value to consider a position as a peak position. The tolerance must be between 0 and 1. All peaks within the tolerated range will be considered in the calculation of the metric.

### Usage

    DiffPosMax

### Format

An object of class `R6ClassGenerator` of length 24.

### Value

The `DiffPosMax$new` function returns a `DiffPosMax` object which contains the information about the two profiles and the thresholds used to calculate the metric. It can be used, as many times needed, to calculate the specified metric.

### Constructor

Create a `DiffPosMax` object.

`DiffPosMax$new(profile1, profile2, threshold = 1, thresholdDiff = 100, tolerance = 0.01)`

The threshold is the minimum peak value accepted to calculate the ratio.

The thresholdDiff is the maximum distance accepted between two maximum peaks positions in the same profile. When the thresholdDiff is not respected, the profile is considered having more than one peak.

The tolerance is the maximum variation accepted on the maximum peak value to consider a position as a peak position. All peaks within the tolerated range will be considered in the calculation of the metric.The tolerance must

The `DiffPosMax` object inherites those functions:

- `getMetric` A function that returns the value of the calculated metric

- `getInfo` A function that returns a description of the metric with the metric value.

- `getType` A function that returns the unique name associated to this metric

- `calculateMetric` A function that modifies the values of the two profiles and the threshold. The new values (profile1, profile2, threshold, thresholdDiff, tolerance) are passed as arguments.

### Author(s)

Astrid Deschenes

### See Also

- `MetricFactory` for using a interface to calculate all available metrics separately or togheter.

[Package similaRpeak version 1.24.0 Index]