matchFormula | R Documentation |
The matchFormula
method matches chemical formulas from different inputs
(parameter query
and target
). Before comparison all formulas are
normalized using MetaboCoreUtils::standardizeFormula()
. Inputs can be
either a character
or data.frame
containing a column with formulas.
In case of data.frame
s parameter formulaColname
needs to be used to
specify the name of the column containing the chemical formulas.
matchFormula(query, target, ...)
## S4 method for signature 'character,character'
matchFormula(query, target, BPPARAM = SerialParam())
## S4 method for signature 'data.frameOrSimilar,data.frameOrSimilar'
matchFormula(
query,
target,
formulaColname = c("formula", "formula"),
BPPARAM = SerialParam()
)
## S4 method for signature 'character,data.frameOrSimilar'
matchFormula(
query,
target,
formulaColname = "formula",
BPPARAM = SerialParam()
)
## S4 method for signature 'data.frameOrSimilar,character'
matchFormula(
query,
target,
formulaColname = "formula",
BPPARAM = SerialParam()
)
query |
|
target |
|
... |
currently ignored |
BPPARAM |
parallel processing setup. See |
formulaColname |
|
Matched object representing the result.
Michael Witting
## input formula
query <- c("H12C6O6", "C11H12O2", "HN3")
target <- c("HCl", "C2H4O", "C6H12O6")
query_df <- data.frame(
formula = c("H12C6O6", "C11H12O2", "HN3"),
name = c("A", "B", "C")
)
target_df <- data.frame(
formula = c("HCl", "C2H4O", "C6H12O6"),
name = c("D", "E", "F")
)
## character vs character
matches <- matchFormula(query, target)
matchedData(matches)
## data.frame vs data.frame
matches <- matchFormula(query_df, target_df)
matchedData(matches)
## data.frame vs character
matches <- matchFormula(query_df, target)
matchedData(matches)
## character vs data.frame
matches <- matchFormula(query, target_df)
matchedData(matches)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.