Skip to contents

Targets for molecular formula assignment.

Usage

tar_mf_assignment(
  name,
  feature_data = NULL,
  parameters = assignments::assignmentParameters("FIE"),
  verbose = TRUE,
  summary = TRUE,
  export_path = "exports/molecular_formula_assignments"
)

Arguments

name

Symbol. The name for the collection of targets. This serves as a prefix for target names.

feature_data

A tibble containing a feature intensity matrix for which to assign molecular formulas. If NULL, target input will be expected from an existing target. See details.

parameters

S4 object of class AssignmentParameters.

verbose

Show assignment console output.

summary

Boolean. Include additional summary targets.

export_path

Destination path of export files. Set to NULL to skip exports.

Value

A list of target objects for molecular formula assignment.

Details

Specifying argument feature_data as NULL enables the use of input from the tar_pre_treatment() target factory, See the second example below.

Examples

if (FALSE) {
## Perform molecular formula assignment by specifying the feature data directly
targets::tar_dir({
    targets::tar_script({
        library(hrmtargets)
        
        list(
            tar_mf_assignment(assignments::feature_data)
        )
    })
    targets::tar_make()
    targets::tar_read(example_summary_assignments)
})

## Perform molecular formula assignment by using `tar_input_piggyback()`,
## `tar_input_spectral_binning()` and `tar_pre_treatment()` 
targets::tar_dir({
    targets::tar_script({
        library(hrmtargets)
        name <- rlang::expr(example)
        
        list(
            tar_input_piggyback(!!name,
                                'FIE-HRMS_BdistachyonTechnical',
                                repo = 'jasenfinch/metaboData'),
            tar_spectral_binning(!!name),
            tar_pre_treatment(!!name),
            tar_mf_assignment(!!name)
        )
    })
    targets::tar_make()
    targets::tar_read(example_results_spectral_processing)
    targets::tar_read(example_summary_assignments)
})
}