Skip to contents

Targets for spectral processing of FIE-HRMS data using spectral binning.

Usage

tar_spectral_binning(
  name,
  mzML = NULL,
  sample_info = NULL,
  parameters = NULL,
  plots = c("chromatogram", "fingerprint", "TIC", "purity_dist", "centrality_dist"),
  verbose = TRUE,
  summary = TRUE,
  export_path = "exports/spectral_processing"
)

Arguments

name

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

mzML

A character vector of mzML data file paths. If NULL, target input will be expected from an existing target. See details.

sample_info

A tibble containing the sample information. See details for the specifications. If NULL, target input will be expected from an existing target. See details.

parameters

S4 object of class BinParameters. If NULL, binneR::detectParameters() will be used to detect the spectral binning parameters automatically..

plots

A character vector of plot types. Set to NULL to skip all plots.

verbose

Show spectral processing 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 processing mzML data files using spectral binning.

Details

Specifying arguments mzML and sample_info as NULL enables the use of one of the data file and sample information from one of the input target factories, tar_input_file_path(), tar_input_grover() or tar_input_piggyback(). See the example using tar_input_piggyback() below.

Examples

if (FALSE) {
## Perform spectral binning by specifying the file paths and sample information directly
targets::tar_dir({
    targets::tar_script({
        library(hrmtargets)
        file_paths <- metaboData::filePaths('FIE-HRMS','UrineTechnical',
                                            ask = FALSE)
        sample_info <- metaboData::runinfo('FIE-HRMS','UrineTechnical',
                                           ask = FALSE)
        
        list(
            tar_spectral_binning(example,
                                 mzML = file_paths,
                                 sample_info = sample_info)
        )
    })
    targets::tar_make()
    targets::tar_read(example_results_spectral_processing)
    targets::tar_read(example_plot_fingerprint)
})

## Perform spectral binning by using tar_input_piggyback() 
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)
        )
    })
    targets::tar_make()
    targets::tar_read(example_results_spectral_processing)
    targets::tar_read(example_plot_fingerprint)
})
}