diff --git a/DESCRIPTION b/DESCRIPTION index 3611e48..ffc9e51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: metaboMisc Title: Miscellaneous Functions for Metabolomics Analyses -Version: 0.6.1 +Version: 0.6.2 Authors@R: person("Jasen", "Finch", email = "jsf9@aber.ac.uk", role = c("aut", "cre")) Description: Miscellaneous helper functions for metabolomics analyses that do not yet have a permanent home. URL: https://jasenfinch.github.io/metaboMisc/ diff --git a/NEWS.md b/NEWS.md index ea95cac..992677d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# metaboMisc 0.6.2 + +* Fixed miss injection and batch correction detection for GC-MS data sets processed using xcms. + +* Fixed the feature summary for GC-MS data sets processed using xcms. + # metaboMisc 0.6.1 * Fix the missing `name` column in tables returned from `convertSampleInfo()`. diff --git a/R/detect.R b/R/detect.R index fbf5ec1..4cd74c3 100644 --- a/R/detect.R +++ b/R/detect.R @@ -59,7 +59,7 @@ setMethod('detectMissInjections',signature = 'MetaboProfile', mi <- x %>% processedData() - if (!is.list(mi)){ + if (is.data.frame(mi)){ mi <- list(mi) } @@ -68,10 +68,10 @@ setMethod('detectMissInjections',signature = 'MetaboProfile', if (mi %>% names() %>% - is.na() %>% + {is.null(.) | is.na(.)} %>% any()) { names(mi) <- replace(names(mi), - is.na(names(mi)), + is.null(names(mi)) | is.na(names(mi)), 'NA') } @@ -166,7 +166,7 @@ setMethod('detectBatchDiff',signature = "MetaboProfile", TICdat <- x %>% processedData() - if (!is.list(TICdat)){ + if (is.data.frame(TICdat)){ TICdat <- list(TICdat) } @@ -175,10 +175,10 @@ setMethod('detectBatchDiff',signature = "MetaboProfile", if (TICdat %>% names() %>% - is.na() %>% + {is.null(.) | is.na(.)} %>% any()) { names(TICdat) <- replace(names(TICdat), - is.na(names(TICdat)), + is.null(names(TICdat)) | is.na(names(TICdat)), 'NA') } diff --git a/R/summary.R b/R/summary.R index 0994949..e24aa92 100644 --- a/R/summary.R +++ b/R/summary.R @@ -42,7 +42,7 @@ setMethod('featureSummary',signature = 'MetaboProfile', featSummary <- function(x){ - if (!is.list(x)){ + if (is.data.frame(x)){ x <- list(x) }