similarFeatures: Feature similarity checker.

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Compares two features to determine if they are similar.

Usage

1
2
3
4
5
6
similarFeatures(
  feature1,
  feature2,
  rtThreshold = RT_THRESHOLD,
  mzThreshold = MZ_THRESHOLD
)

Arguments

feature1

The first feature to compare, as a Feature object or a vector from a feature matrix.

feature2

The second feature to compare, as a Feature object or a vector from a feature matrix.

rtThreshold

The RT threshold to use, as a number.

mzThreshold

The m/z threshold to use, as a number.

Details

We consider features to be similar if their retention times and mass-to- charge values are within some fixed threshold of each other, which can be determined and provided by the user. Having a greater degree of similarity means that it is more likely that a close cluster of features can effectively be considered as just a single feature.

The provided features can be ropenms Feature objects or vectors (e.g. from a feature matrix).

Value

TRUE if the two features are similar; FALSE otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
featureA <- ropenms$Feature()
featureA$setRT(5)
featureA$setMZ(300)
featureB <- ropenms$Feature()
featureB$setRT(6)
featureB$setMZ(300.005)
similarFeatures(featureA, featureB)  # Returns TRUE

## End(Not run)

ychen-uoft/msFeatureCmp documentation built on Dec. 23, 2021, 7:17 p.m.