Skip to contents

Targets for consensus structural classification

Usage

tar_construction(
  name,
  x = NULL,
  library_path = "data/structural_classifications",
  db = "kegg",
  organism = character(),
  threshold = 50,
  classyfireR_cache = "data/structural_classifications/classyfireR_cache.db",
  summary = TRUE,
  export_path = "exports/structural_classifications"
)

Arguments

name

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

x

An S4 object of class Assignment. If NULL, target input will be expected from an existing target. See details.

library_path

the target file path for the classification library in which to store consensus classification data

db

the databases to search. This can either be kegg and/or pubchem.

organism

the KEGG organism ID. This is Ignored if argument db is set to pubchem

threshold

the percentage majority threshold for consensus classification

classyfireR_cache

the file path for a classyfireR cache. See the documentation of classyfireR::get_classification for more details.

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 consensus structural classifications.

Details

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

Examples

if (FALSE) {
## Perform consensus structural classification by specifying assignments directly
targets::tar_dir({
    targets::tar_script({
        library(hrmtargets)
        
        mf_assignments <- assignments::assignMFs(
            assignments::feature_data,
            parameters = assignments::assignmentParameters('FIE-HRMS')
        )
        
        list(
            tar_construction(assignments::feature_data)
        )
    })
    targets::tar_make()
    targets::tar_read(example_summary_construction)
})

## Perform consensus structural classification by using inputs from other target factories.
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),
            tar_construction(!!name)
        )
    })
    targets::tar_make()
    targets::tar_read(example_summary_construction)
})
}