From 61d0004946afac3948b3b4d53b0ef597a0b04635 Mon Sep 17 00:00:00 2001 From: evanbiederstedt Date: Sun, 4 Sep 2022 00:23:00 -0400 Subject: [PATCH] updates, inherits changes --- CHANGELOG.md | 5 +++++ DESCRIPTION | 2 +- R/de_functions.R | 8 ++++---- README.md | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa02b74..0743c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Upcoming +## [1.4.7] - 2022-04-Sept +- Fixes for Matrix, updated versions 1.4.2, 1.5.0 +- Use `inherits()` for conditionals with class() + + ## [1.4.6] - 2022-30-March - Fixed bug with `snn` argument in `buildGraph()` due to the parameter `snn.k.self` diff --git a/DESCRIPTION b/DESCRIPTION index 8383d5f..62c8380 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: conos Title: Clustering on Network of Samples -Version: 1.4.6 +Version: 1.4.7 Authors@R: c(person("Viktor","Petukhov", email="viktor.s.petuhov@ya.ru", role="aut"), person("Nikolas","Barkas", email="nikolas_barkas@hms.harvard.edu", role="aut"), person("Peter", "Kharchenko", email = "peter_kharchenko@hms.harvard.edu", role = "aut"), person("Weiliang", "Qiu", email = "weiliang.qiu@gmail.com", role = c("ctb")), person("Evan", "Biederstedt", email="evan.biederstedt@gmail.com", role=c("aut", "cre"))) Description: Wires together large collections of single-cell RNA-seq datasets, which allows for both the identification of recurrent cell clusters and the propagation of information between datasets in multi-sample or atlas-scale collections. 'Conos' focuses on the uniform mapping of homologous cell types across heterogeneous sample collections. For instance, users could investigate a collection of dozens of peripheral blood samples from cancer patients combined with dozens of controls, which perhaps includes samples of a related tissue such as lymph nodes. This package interacts with data available through the 'conosPanel' package, which is available in a 'drat' repository. To access this data package, see the instructions at . The size of the 'conosPanel' package is approximately 12 MB. License: GPL-3 diff --git a/R/de_functions.R b/R/de_functions.R index b8713fd..0ff99fa 100644 --- a/R/de_functions.R +++ b/R/de_functions.R @@ -34,7 +34,7 @@ validatePerCellTypeParams <- function(con.obj, groups, sample.groups, ref.level, if (is.null(ref.level)) stop('reference level is not defined') ## todo: check samplegrousp are named if(is.null(names(sample.groups))) stop('sample.groups must be named') - if(class(groups) != 'factor') stop('groups must be a factor') + if(!inherits(groups,'factor')) stop('groups must be a factor') if(any(grepl(cluster.sep.chr, names(con.obj$samples),fixed=TRUE))) stop('cluster.sep.chr must not be part of any sample name') if(any(grepl(cluster.sep.chr,levels(groups),fixed=TRUE))) @@ -47,10 +47,10 @@ validateBetweenCellTypeParams <- function(con.obj, groups, sample.groups, refgro stop("You have to install DESeq2 package to use differential expression") } - if (class(con.obj) != 'Conos') stop('con.obj must be a conos object') + if (!inherits(con.obj,'Conos')) stop('con.obj must be a conos object') if (is.null(groups) ) stop('groups must be specified'); if (is.null(sample.groups) ) stop('sample.groups must be specified') - if (class(sample.groups) != 'list' ) stop('sample.groups must be a list'); + if (!inherits(sample.groups,'list')) stop('sample.groups must be a list'); #if ( length(sample.groups) != 2 ) stop('sample.groups must be of length 2'); if (!all(unlist(lapply(sample.groups, function(x) class(x) == 'character'))) ) stop('sample.groups must be a list of character vectors'); @@ -62,7 +62,7 @@ validateBetweenCellTypeParams <- function(con.obj, groups, sample.groups, refgro if (is.null(altgroup)) stop('altgroup is not defined') ## todo: check samplegrousp are named if(is.null(names(sample.groups))) stop('sample.groups must be named') - if(class(groups) != 'factor') stop('groups must be a factor') + if(!inherits(groups,'factor')) stop('groups must be a factor') if(any(grepl(cluster.sep.chr, names(con.obj$samples),fixed=TRUE))) stop('cluster.sep.chr must not be part of any sample name') if(any(grepl(cluster.sep.chr,levels(groups),fixed=TRUE))) diff --git a/README.md b/README.md index 0d691a8..e2c9c8e 100644 --- a/README.md +++ b/README.md @@ -238,5 +238,5 @@ The R package can be cited as: ``` Viktor Petukhov, Nikolas Barkas, Peter Kharchenko, and Evan Biederstedt (2021). conos: Clustering on Network of Samples. R -package version 1.4.6. +package version 1.4.7. ```