diff --git a/DESCRIPTION b/DESCRIPTION index 5567433..09d1a35 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: CytoPipelineUtils Title: Utils for use with CytoPipeline -Version: 0.99.5 +Version: 0.99.6 Authors@R: c(person(given = "Philippe", family = "Hauchamps", diff --git a/NEWS.md b/NEWS.md index cdcd9f3..759c702 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # CytoPipelineUtils 0.99 +## CytoPipelineUtils 0.99.6 +- anonymizeMarkers() can now work with no marker anonymization +(only keyword changes) + ## CytoPipelineUtils 0.99.5 - in applyFlowJoGate(): try to avoid using 'All Samples' generic sample group to query flowjo workspace (in order to avoid CytoML warning when using diff --git a/R/CytoProcessingStepImplementations.R b/R/CytoProcessingStepImplementations.R index 227bd4b..b25c12a 100644 --- a/R/CytoProcessingStepImplementations.R +++ b/R/CytoProcessingStepImplementations.R @@ -1237,12 +1237,12 @@ anonymizeMarkers <- function(ff, stopifnot(inherits(ff, "flowFrame")) - if (!is.character(oldMarkerNames) || length(oldMarkerNames) == 0) { - stop("oldMarkerNames should be character of length > 0!") + if (!is.character(oldMarkerNames) && length(oldMarkerNames) > 0) { + stop("oldMarkerNames should be a character!") } - if (!is.character(newMarkerNames) || length(newMarkerNames) == 0) { - stop("oldMarkerNames should be character of length > 0!") + if (!is.character(newMarkerNames) && length(newMarkerNames) > 0) { + stop("oldMarkerNames should be character!") } if (length(oldMarkerNames) != length(newMarkerNames)) { diff --git a/man/CytoPipelineUtils-package.Rd b/man/CytoPipelineUtils-package.Rd new file mode 100644 index 0000000..ad9fa92 --- /dev/null +++ b/man/CytoPipelineUtils-package.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/CytoPipelineUtils-package.R +\docType{package} +\name{CytoPipelineUtils-package} +\alias{CytoPipelineUtils} +\alias{CytoPipelineUtils-package} +\title{CytoPipelineUtils: Utils for use with CytoPipeline} +\description{ +This package is meant to be used in conjunction of CytoPipeline package, which provides support for automation and visualization of flow cytometry data analysis pipelines. CytoPipelineUtils provides a series of wrapper implementations that can in turn be defined as CytoProcessingSteps in CytoPipeline. It is therefore a helper package, which is aimed at hosting wrapper implementations of various functions of various packages. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://uclouvain-cbio.github.io/CytoPipeline} + \item Report bugs at \url{https://github.com/UCLouvain-CBIO/CytoPipelineUtils/issues} +} + +} +\author{ +\strong{Maintainer}: Philippe Hauchamps \email{philippe.hauchamps@uclouvain.be} (\href{https://orcid.org/0000-0003-2865-1852}{ORCID}) + +Authors: +\itemize{ + \item Laurent Gatto \email{laurent.gatto@uclouvain.be} (\href{https://orcid.org/0000-0002-1520-2268}{ORCID}) +} + +Other contributors: +\itemize{ + \item Dan Lin \email{dan.8.lin@gsk.com} [contributor] +} + +} +\keyword{internal} diff --git a/tests/testthat/test-CytoProcessingStepImplementations.R b/tests/testthat/test-CytoProcessingStepImplementations.R index c846e9c..37e487e 100644 --- a/tests/testthat/test-CytoProcessingStepImplementations.R +++ b/tests/testthat/test-CytoProcessingStepImplementations.R @@ -354,12 +354,14 @@ test_that("applyFlowJoGate works", { }) test_that("anonymizeMarkers works", { - retFF <- anonymizeMarkers(OMIP021UTSamples[[1]], - oldMarkerNames = c("FSC-A","BV785 - CD3"), - newMarkerName = c("Fwd Scatter-A", "CD3"), - toUpdateKeywords = list( - "EXPERIMENT NAME" = "My experiment", - "FILENAME" = NULL)) + retFF <- anonymizeMarkers( + OMIP021UTSamples[[1]], + oldMarkerNames = c("FSC-A","BV785 - CD3"), + newMarkerName = c("Fwd Scatter-A", "CD3"), + toUpdateKeywords = list( + "EXPERIMENT NAME" = "My experiment", + "FILENAME" = NULL) + ) checkMkName <- getChannelNamesFromMarkers(retFF, markers = "Fwd Scatter-A") expect_equal(checkMkName, "FSC-A") @@ -374,5 +376,21 @@ test_that("anonymizeMarkers works", { retFF, "EXPERIMENT NAME")[["EXPERIMENT NAME"]], "My experiment") expect_null( flowCore::keyword(retFF, "FILENAME")[["FILENAME"]]) + + # without anonymization of marker names, only keywords update + retFF2 <- anonymizeMarkers( + OMIP021UTSamples[[1]], + oldMarkerNames = c(), + newMarkerName = c(), + toUpdateKeywords = list( + "EXPERIMENT NAME" = "My experiment", + "FILENAME" = NULL)) + + expect_equal( + flowCore::keyword( + retFF2, "EXPERIMENT NAME")[["EXPERIMENT NAME"]], "My experiment") + expect_null( + flowCore::keyword(retFF2, "FILENAME")[["FILENAME"]]) + })