diff --git a/R/pgx-contrasts.R b/R/pgx-contrasts.R index 69b8f6ea..3b565d25 100644 --- a/R/pgx-contrasts.R +++ b/R/pgx-contrasts.R @@ -842,7 +842,7 @@ contrasts.convertToLabelMatrix <- function(contrasts, samples) { all(apply(contrasts, 2, class) %in% c("integer", "numeric")) is.numeric.contrast <- is.numeric.matrix | is.numeric.df if (is.numeric.contrast) { - has.negpos <- any(contrasts < 0, na.rm=TRUE) && any(contrasts > 0, na.rm=TRUE) + has.negpos <- any(contrasts < 0, na.rm = TRUE) && any(contrasts > 0, na.rm = TRUE) if (has.negpos) { contrasts[contrasts %in% c(NA, "NA", "na", "")] <- 0 contrasts <- sign(contrasts) diff --git a/R/pgx-read.R b/R/pgx-read.R index e746b6f1..d073071b 100644 --- a/R/pgx-read.R +++ b/R/pgx-read.R @@ -258,9 +258,9 @@ read_files <- function(dir = ".", pattern = NULL) { file2 <- head(grep("sample", ff, value = TRUE), 1) file3 <- head(grep("contrast|comparison", ff, value = TRUE), 1) counts <- samples <- contrasts <- NULL - if (length(file1)) counts <- read_counts(file.path(dir,file1)) - if (length(file2)) samples <- read_samples(file.path(dir,file2)) - if (length(file3)) contrasts <- read_contrasts(file.path(dir,file3)) + if (length(file1)) counts <- read_counts(file.path(dir, file1)) + if (length(file2)) samples <- read_samples(file.path(dir, file2)) + if (length(file3)) contrasts <- read_contrasts(file.path(dir, file3)) list( counts = counts,