Skip to content

Commit 05d81d2

Browse files
authored
Merge pull request #52 from jasenfinch/devel
v0.10.1
2 parents d81ca3f + 9c4b648 commit 05d81d2

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: metaboWorkflows
22
Title: Workflow Project Templates for Metabolomics Analyses
3-
Version: 0.10.0
3+
Version: 0.10.1
44
Authors@R: person("Jasen", "Finch", email = "jsf9@aber.ac.uk", role = c("aut", "cre"))
55
Description: Reproducible workflow project templates for metabolomics analyses using the `hrm` <https://jasenfinch.github.io/hrm/> R package ecosystem.
66
URL: https://jasenfinch.github.io/metaboWorkflows/

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# metaboWorkflows 0.10.1
2+
3+
* Clarified the specification of argument `type` in the documentation of `target()`.
4+
5+
* Added a suitable pre-treatment target expression for processing GC-MS profiling data.
6+
17
# metaboWorkflows 0.10.0
28

39
* Workflow templates now include a `_targets.yaml` file for targets configuraion settings.

R/target.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' S4 class to store target a definition
1+
#' S4 class to store a target definition
22
#' @description An S4 class for storing a workflow target definition.
33
#' @slot name the target name
44
#' @slot command the R code to run the target as a string
@@ -294,7 +294,9 @@ setMethod('code',signature = 'Target',
294294
#' @param comment optional comment that precedes the target code
295295
#' @return An S4 object of class Target.
296296
#' @details
297-
#' Target types can be one of any provided by the `targets` or `tarchetypes` packages.
297+
#' The specified target `type` can be one of any provided by the `targets` package such as `tar_target`.
298+
#' For target archetypes outside of `targets`, declare the package directly for argument
299+
#' `type`. For instance, `type = "tarchetypes::tar_file"`.
298300
#' @examples
299301
#' workflow_target <- target('a_target',
300302
#' 1 + 1,

R/targets.R

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,27 @@ targetsSpectralProcessing <- function(x){
323323
return(processing_workflow)
324324
}
325325

326+
preTreatmentRoutine <- function(x){
327+
328+
pre_treat_modes <- 'metaboMisc::preTreatModes(results_spectral_processing,
329+
parameters_pre_treatment)'
330+
331+
pre_treat_GCMS <- 'metabolyseR::metabolyse(
332+
profilePro::processedData(results_spectral_processing),
333+
profilePro::sampleInfo(results_spectral_processing),
334+
parameters_pre_treatment)'
335+
336+
switch(x,
337+
`FIE-HRMS fingerprinting` = pre_treat_modes,
338+
`NSI-HRMS fingerprinting` = pre_treat_modes,
339+
`RP-LC-HRMS profiling` = pre_treat_modes,
340+
`NP-LC-HRMS profiling` = pre_treat_modes,
341+
`GC-MS profiling` = pre_treat_GCMS
342+
)
343+
}
344+
326345
pre_treatment_commands <- list(
327346
parameters_pre_treatment = 'metaboMisc::detectPretreatmentParameters(results_spectral_processing)',
328-
results_pre_treatment = 'metaboMisc::preTreatModes(results_spectral_processing,
329-
parameters_pre_treatment)',
330347
export_pre_treatment = 'metaboMisc::exportData(results_pre_treatment,
331348
type = "pre-treated",
332349
outPath = "exports/pre-treated")',
@@ -359,7 +376,7 @@ targetsPretreatment <- function(x){
359376
),
360377
results_pre_treatment = target(
361378
'results_pre_treatment',
362-
!!parse_expr(pre_treatment_commands$results_pre_treatment),
379+
!!parse_expr(preTreatmentRoutine(x)),
363380
comment = 'Perform data pre-treatment'
364381
),
365382
export_pre_treatment_data = target(

man/Target-class.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/target.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)