Target definitions for workflow input.
Usage
targetsWorkflow(x)
# S4 method for Workflow
targetsWorkflow(x)
targetsInput(x)
# S4 method for FilePathInput
targetsInput(x)
# S4 method for GroverInput
targetsInput(x)
# S4 method for Workflow
targetsInput(x)
targetsSpectralProcessing(x)
targetsPretreatment(x)
targetsMFassignment(x)
targetsModelling(x)
targetsCorrelations(x)
targetsReport(x, project_directory)
Arguments
- x
the workflow type or an S4 object of class
Workflow
,FilePathInput
orGroverInput
- project_directory
the path of the project directory
Examples
## Full workflow example
file_paths <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
sample_information <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')
workflow_input <- inputFilePath(file_paths,sample_information)
workflow_definition <- defineWorkflow(workflow_input,
'FIE-HRMS fingerprinting',
'Example project')
targetsWorkflow(workflow_definition)
#> $input
#> $input$file_paths_list
#> ## Retrieve data file paths
#> tarchetypes::tar_file(
#> file_paths_list,
#> "data/file_paths.txt"
#> )
#>
#> $input$mzML
#> ## Track individual data files
#> hrmtargets::tar_export(
#> mzML,
#> readLines(file_paths_list)
#> )
#>
#> $input$sample_information_file
#> ## Sample information file path
#> tarchetypes::tar_file(
#> sample_information_file,
#> "data/runinfo.csv"
#> )
#>
#> $input$sample_information
#> ## Parse sample information
#> tar_target(
#> sample_information,
#> readr::read_csv(sample_information_file)
#> )
#>
#>
#> $spectral_processing
#> $spectral_processing$parameters_spectral_processing
#> ## Detect spectral binning parameters
#> tar_target(
#> parameters_spectral_processing,
#> binneR::detectParameters(mzML)
#> )
#>
#> $spectral_processing$results_spectral_processing
#> ## Perform spectral binning
#> tar_target(
#> results_spectral_processing,
#> binneR::binneRlyse(mzML, sample_information, parameters_spectral_processing)
#> )
#>
#> $spectral_processing$plot_chromatogram
#> ## Plot average infusion chromatogram
#> tar_target(
#> plot_chromatogram,
#> binneR::plotChromatogram(results_spectral_processing)
#> )
#>
#> $spectral_processing$plot_fingerprint
#> ## Plot average spectrum fingerprint
#> tar_target(
#> plot_fingerprint,
#> binneR::plotFingerprint(results_spectral_processing)
#> )
#>
#> $spectral_processing$plot_TIC
#> ## Plot sample total ion counts by randomised block
#> tar_target(
#> plot_TIC,
#> binneR::plotTIC(results_spectral_processing)
#> )
#>
#> $spectral_processing$plot_purity_dist
#> ## Plot bin purity distribution
#> tar_target(
#> plot_purity_dist,
#> binneR::plotPurity(results_spectral_processing)
#> )
#>
#> $spectral_processing$plot_centrality_dist
#> ## Plot bin centrality distribution
#> tar_target(
#> plot_centrality_dist,
#> binneR::plotCentrality(results_spectral_processing)
#> )
#>
#> $spectral_processing$summary_processed_features
#> ## Summary of spectrally binned features
#> tar_target(
#> summary_processed_features,
#> metaboMisc::featureSummary(results_spectral_processing)
#> )
#>
#> $spectral_processing$export_processed_data
#> ## Export spectrally binned data
#> hrmtargets::tar_export(
#> export_processed_data,
#> metaboMisc::export(results_spectral_processing, outPath = "exports/spectral_processing")
#> )
#>
#>
#> $pre_treatment
#> $pre_treatment$parameters_pre_treatment
#> ## Detect pre-treatment routine parameters
#> tar_target(
#> parameters_pre_treatment,
#> metaboMisc::detectPretreatmentParameters(results_spectral_processing)
#> )
#>
#> $pre_treatment$results_pre_treatment
#> ## Perform data pre-treatment
#> tar_target(
#> results_pre_treatment,
#> metaboMisc::preTreatModes(results_spectral_processing, parameters_pre_treatment)
#> )
#>
#> $pre_treatment$export_pre_treatment_data
#> ## Export pre-treated data
#> tarchetypes::tar_file(
#> export_pre_treatment,
#> metaboMisc::exportData(results_pre_treatment,
#> type = "pre-treated",
#> outPath = "exports/pre-treated"
#> )
#> )
#>
#> $pre_treatment$export_pre_treatment_sample_info
#> ## Export sample information of pre-treated data
#> tarchetypes::tar_file(
#> export_pre_treatment_sample_info,
#> metaboMisc::exportSampleInfo(results_pre_treatment,
#> type = "pre-treated",
#> outPath = "exports/pre-treated"
#> )
#> )
#>
#> $pre_treatment$plot_PCA
#> ## Plot Principle Component Analysis
#> tar_target(
#> plot_PCA,
#> metabolyseR::plotPCA(results_pre_treatment, type = "pre-treated")
#> )
#>
#> $pre_treatment$plot_LDA
#> ## Plot Priniciple Component Analysis - Linear Discriminant Analysis
#> tar_target(
#> plot_LDA,
#> metabolyseR::plotLDA(results_pre_treatment, type = "pre-treated")
#> )
#>
#> $pre_treatment$plot_unsupervised_RF
#> ## Plot multidimensional scaling plot of unsupervised random forest
#> tar_target(
#> plot_unsupervised_RF,
#> metabolyseR::plotUnsupervisedRF(results_pre_treatment,
#> type = "pre-treated",
#> title = "Unsupervised random forest"
#> )
#> )
#>
#> $pre_treatment$plot_supervised_RF
#> ## Plot multidimensional scaling plot of supervised random forest
#> tar_target(
#> plot_supervised_RF,
#> metabolyseR::plotSupervisedRF(results_pre_treatment,
#> type = "pre-treated",
#> title = "Supervised random forest"
#> )
#> )
#>
#>
#> $molecular_formula_assignment
#> $molecular_formula_assignment$parameters_molecular_formula_assignment
#> ## Generate molecular formula assignment parameters
#> tar_target(
#> parameters_molecular_formula_assignment,
#> assignments::assignmentParameters("FIE-HRMS")
#> )
#>
#> $molecular_formula_assignment$results_molecular_formula_assignment
#> ## Perform molecular formula assignment
#> tar_target(
#> results_molecular_formula_assignment,
#> results_pre_treatment %>% metabolyseR::dat(type = "pre-treated") %>%
#> assignments::assignMFs(parameters_molecular_formula_assignment)
#> )
#>
#> $molecular_formula_assignment$assigned_data
#> ## Retieve pre-treated data with molecular formula assignments added to the feature names
#> tar_target(
#> assigned_data,
#> metaboMisc::addAssignments(results_pre_treatment, results_molecular_formula_assignment)
#> )
#>
#> $molecular_formula_assignment$summary_assignments
#> ## Summarise the assigned molecular formulas
#> tar_target(
#> summary_assignments,
#> assignments::summariseAssignments(results_molecular_formula_assignment)
#> )
#>
#> $molecular_formula_assignment$export_assignments
#> ## Export molecular formula assignments
#> hrmtargets::tar_export(
#> export_assignments,
#> metaboMisc::export(results_molecular_formula_assignment, outPath = "exports/molecular_formula_assignments")
#> )
#>
#>
#> $modelling
#> $modelling$parameters_modelling
#> ## Detect appropriate modelling parameters
#> tar_target(
#> parameters_modelling,
#> metaboMisc::detectModellingParameters(assigned_data, cls = "class")
#> )
#>
#> $modelling$results_modelling
#> ## Perform modelling
#> tar_target(
#> results_modelling,
#> metabolyseR::reAnalyse(assigned_data, parameters_modelling)
#> )
#>
#> $modelling$summary_modelling_metrics
#> ## Retrieve modelling metrics
#> tar_target(
#> summary_model_metrics,
#> metabolyseR::metrics(results_modelling)
#> )
#>
#> $modelling$summary_explanatory_features
#> ## Retireve modelling explanatory features
#> tar_target(
#> summary_explanatory_features,
#> metabolyseR::explanatoryFeatures(results_modelling)
#> )
#>
#> $modelling$plot_explanatory_heatmap
#> ## Plot a heat map of explanatory features
#> tar_target(
#> plot_explanatory_heatmap,
#> metabolyseR::plotExplanatoryHeatmap(results_modelling)
#> )
#>
#> $modelling$export_modelling
#> ## Export results_modelling results
#> hrmtargets::tar_export(
#> export_modelling,
#> metaboMisc::exportModelling(results_modelling, outPath = "exports/results_modelling")
#> )
#>
#>
#> $correlations
#> $correlations$parameters_correlations
#> ## Generate parameters for correlation analysis
#> tar_target(
#> parameters_correlations,
#> metabolyseR::analysisParameters("correlations")
#> )
#>
#> $correlations$results_correlations
#> ## Perform correlation analysis
#> tar_target(
#> results_correlations,
#> metabolyseR::reAnalyse(assigned_data, parameters_correlations)
#> )
#>
#> $correlations$summary_correlations
#> ## Retrieve correlation analysis results
#> tar_target(
#> summary_correlations,
#> metabolyseR::analysisResults(results_correlations, "correlations")
#> )
#>
#> $correlations$export_correlations
#> ## Export correlation analysis results
#> hrmtargets::tar_export(
#> export_correlations,
#> metaboMisc::exportCorrelations(results_correlations, outPath = "exports/correlations")
#> )
#>
#>
#> $report
#> $report$report
#> tarchetypes::tar_render(
#> report,
#> "report/Example_project_report.Rmd",
#> output_dir = "exports"
#> )
#>
#>
## Examples for individual modules
targetsSpectralProcessing('FIE-HRMS fingerprinting')
#> $parameters_spectral_processing
#> ## Detect spectral binning parameters
#> tar_target(
#> parameters_spectral_processing,
#> binneR::detectParameters(mzML)
#> )
#>
#> $results_spectral_processing
#> ## Perform spectral binning
#> tar_target(
#> results_spectral_processing,
#> binneR::binneRlyse(mzML, sample_information, parameters_spectral_processing)
#> )
#>
#> $plot_chromatogram
#> ## Plot average infusion chromatogram
#> tar_target(
#> plot_chromatogram,
#> binneR::plotChromatogram(results_spectral_processing)
#> )
#>
#> $plot_fingerprint
#> ## Plot average spectrum fingerprint
#> tar_target(
#> plot_fingerprint,
#> binneR::plotFingerprint(results_spectral_processing)
#> )
#>
#> $plot_TIC
#> ## Plot sample total ion counts by randomised block
#> tar_target(
#> plot_TIC,
#> binneR::plotTIC(results_spectral_processing)
#> )
#>
#> $plot_purity_dist
#> ## Plot bin purity distribution
#> tar_target(
#> plot_purity_dist,
#> binneR::plotPurity(results_spectral_processing)
#> )
#>
#> $plot_centrality_dist
#> ## Plot bin centrality distribution
#> tar_target(
#> plot_centrality_dist,
#> binneR::plotCentrality(results_spectral_processing)
#> )
#>
#> $summary_processed_features
#> ## Summary of spectrally binned features
#> tar_target(
#> summary_processed_features,
#> metaboMisc::featureSummary(results_spectral_processing)
#> )
#>
#> $export_processed_data
#> ## Export spectrally binned data
#> hrmtargets::tar_export(
#> export_processed_data,
#> metaboMisc::export(results_spectral_processing, outPath = "exports/spectral_processing")
#> )
#>
targetsInput(workflow_input)
#> $file_paths_list
#> ## Retrieve data file paths
#> tarchetypes::tar_file(
#> file_paths_list,
#> "data/file_paths.txt"
#> )
#>
#> $mzML
#> ## Track individual data files
#> hrmtargets::tar_export(
#> mzML,
#> readLines(file_paths_list)
#> )
#>
#> $sample_information_file
#> ## Sample information file path
#> tarchetypes::tar_file(
#> sample_information_file,
#> "data/runinfo.csv"
#> )
#>
#> $sample_information
#> ## Parse sample information
#> tar_target(
#> sample_information,
#> readr::read_csv(sample_information_file)
#> )
#>
targetsPretreatment('FIE-HRMS fingerprinting')
#> $parameters_pre_treatment
#> ## Detect pre-treatment routine parameters
#> tar_target(
#> parameters_pre_treatment,
#> metaboMisc::detectPretreatmentParameters(results_spectral_processing)
#> )
#>
#> $results_pre_treatment
#> ## Perform data pre-treatment
#> tar_target(
#> results_pre_treatment,
#> metaboMisc::preTreatModes(results_spectral_processing, parameters_pre_treatment)
#> )
#>
#> $export_pre_treatment_data
#> ## Export pre-treated data
#> tarchetypes::tar_file(
#> export_pre_treatment,
#> metaboMisc::exportData(results_pre_treatment,
#> type = "pre-treated",
#> outPath = "exports/pre-treated"
#> )
#> )
#>
#> $export_pre_treatment_sample_info
#> ## Export sample information of pre-treated data
#> tarchetypes::tar_file(
#> export_pre_treatment_sample_info,
#> metaboMisc::exportSampleInfo(results_pre_treatment,
#> type = "pre-treated",
#> outPath = "exports/pre-treated"
#> )
#> )
#>
#> $plot_PCA
#> ## Plot Principle Component Analysis
#> tar_target(
#> plot_PCA,
#> metabolyseR::plotPCA(results_pre_treatment, type = "pre-treated")
#> )
#>
#> $plot_LDA
#> ## Plot Priniciple Component Analysis - Linear Discriminant Analysis
#> tar_target(
#> plot_LDA,
#> metabolyseR::plotLDA(results_pre_treatment, type = "pre-treated")
#> )
#>
#> $plot_unsupervised_RF
#> ## Plot multidimensional scaling plot of unsupervised random forest
#> tar_target(
#> plot_unsupervised_RF,
#> metabolyseR::plotUnsupervisedRF(results_pre_treatment,
#> type = "pre-treated",
#> title = "Unsupervised random forest"
#> )
#> )
#>
#> $plot_supervised_RF
#> ## Plot multidimensional scaling plot of supervised random forest
#> tar_target(
#> plot_supervised_RF,
#> metabolyseR::plotSupervisedRF(results_pre_treatment,
#> type = "pre-treated",
#> title = "Supervised random forest"
#> )
#> )
#>
targetsMFassignment('FIE-HRMS fingerprinting')
#> $parameters_molecular_formula_assignment
#> ## Generate molecular formula assignment parameters
#> tar_target(
#> parameters_molecular_formula_assignment,
#> assignments::assignmentParameters("FIE-HRMS")
#> )
#>
#> $results_molecular_formula_assignment
#> ## Perform molecular formula assignment
#> tar_target(
#> results_molecular_formula_assignment,
#> results_pre_treatment %>% metabolyseR::dat(type = "pre-treated") %>%
#> assignments::assignMFs(parameters_molecular_formula_assignment)
#> )
#>
#> $assigned_data
#> ## Retieve pre-treated data with molecular formula assignments added to the feature names
#> tar_target(
#> assigned_data,
#> metaboMisc::addAssignments(results_pre_treatment, results_molecular_formula_assignment)
#> )
#>
#> $summary_assignments
#> ## Summarise the assigned molecular formulas
#> tar_target(
#> summary_assignments,
#> assignments::summariseAssignments(results_molecular_formula_assignment)
#> )
#>
#> $export_assignments
#> ## Export molecular formula assignments
#> hrmtargets::tar_export(
#> export_assignments,
#> metaboMisc::export(results_molecular_formula_assignment, outPath = "exports/molecular_formula_assignments")
#> )
#>
targetsModelling('FIE-HRMS fingerprinting')
#> $parameters_modelling
#> ## Detect appropriate modelling parameters
#> tar_target(
#> parameters_modelling,
#> metaboMisc::detectModellingParameters(assigned_data, cls = "class")
#> )
#>
#> $results_modelling
#> ## Perform modelling
#> tar_target(
#> results_modelling,
#> metabolyseR::reAnalyse(assigned_data, parameters_modelling)
#> )
#>
#> $summary_modelling_metrics
#> ## Retrieve modelling metrics
#> tar_target(
#> summary_model_metrics,
#> metabolyseR::metrics(results_modelling)
#> )
#>
#> $summary_explanatory_features
#> ## Retireve modelling explanatory features
#> tar_target(
#> summary_explanatory_features,
#> metabolyseR::explanatoryFeatures(results_modelling)
#> )
#>
#> $plot_explanatory_heatmap
#> ## Plot a heat map of explanatory features
#> tar_target(
#> plot_explanatory_heatmap,
#> metabolyseR::plotExplanatoryHeatmap(results_modelling)
#> )
#>
#> $export_modelling
#> ## Export results_modelling results
#> hrmtargets::tar_export(
#> export_modelling,
#> metaboMisc::exportModelling(results_modelling, outPath = "exports/results_modelling")
#> )
#>
targetsCorrelations('FIE-HRMS fingerprinting')
#> $parameters_correlations
#> ## Generate parameters for correlation analysis
#> tar_target(
#> parameters_correlations,
#> metabolyseR::analysisParameters("correlations")
#> )
#>
#> $results_correlations
#> ## Perform correlation analysis
#> tar_target(
#> results_correlations,
#> metabolyseR::reAnalyse(assigned_data, parameters_correlations)
#> )
#>
#> $summary_correlations
#> ## Retrieve correlation analysis results
#> tar_target(
#> summary_correlations,
#> metabolyseR::analysisResults(results_correlations, "correlations")
#> )
#>
#> $export_correlations
#> ## Export correlation analysis results
#> hrmtargets::tar_export(
#> export_correlations,
#> metaboMisc::exportCorrelations(results_correlations, outPath = "exports/correlations")
#> )
#>