Skip to content
Snippets Groups Projects
Commit 8b076378 authored by Arnaud Duvermy's avatar Arnaud Duvermy
Browse files

add check for <countMatrix> and <metadata> dimensions

Former-commit-id: f66936e5b1ee6ea63b9b15054f87b2916494c8e8
Former-commit-id: 3eedbea70438a57a7828338fdabc6909be139092
Former-commit-id: 3ba2e32df23e2849a7e2cd1bd6bd82f6dfc3f198
parent 54db8373
No related branches found
No related tags found
No related merge requests found
...@@ -142,6 +142,8 @@ custom_matrix_transform <- function(count_matrix, custom_expression) { ...@@ -142,6 +142,8 @@ custom_matrix_transform <- function(count_matrix, custom_expression) {
prepareData2fit <- function(countMatrix, metadata, response_name = "kij", prepareData2fit <- function(countMatrix, metadata, response_name = "kij",
groupID = "geneID", row_threshold = 0, transform = NULL , groupID = "geneID", row_threshold = 0, transform = NULL ,
normalization = NULL) { normalization = NULL) {
## -- first check
stopifnot("<countMatrix> and <metadata> dimensions do not match!" = dim(countMatrix)[2] == dim(metadata)[1] )
stopifnot( length(row_threshold) == 1 && is.numeric(row_threshold) && row_threshold >= 0 ) stopifnot( length(row_threshold) == 1 && is.numeric(row_threshold) && row_threshold >= 0 )
if (row_threshold > 0){ if (row_threshold > 0){
......
...@@ -2801,6 +2801,8 @@ custom_matrix_transform <- function(count_matrix, custom_expression) { ...@@ -2801,6 +2801,8 @@ custom_matrix_transform <- function(count_matrix, custom_expression) {
prepareData2fit <- function(countMatrix, metadata, response_name = "kij", prepareData2fit <- function(countMatrix, metadata, response_name = "kij",
groupID = "geneID", row_threshold = 0, transform = NULL , groupID = "geneID", row_threshold = 0, transform = NULL ,
normalization = NULL) { normalization = NULL) {
## -- first check
stopifnot("<countMatrix> and <metadata> dimensions do not match!" = dim(countMatrix)[2] == dim(metadata)[1] )
stopifnot( length(row_threshold) == 1 && is.numeric(row_threshold) && row_threshold >= 0 ) stopifnot( length(row_threshold) == 1 && is.numeric(row_threshold) && row_threshold >= 0 )
if (row_threshold > 0){ if (row_threshold > 0){
......
...@@ -15,7 +15,6 @@ knitr::opts_chunk$set( ...@@ -15,7 +15,6 @@ knitr::opts_chunk$set(
``` ```
```{r setup} ```{r setup}
devtools::load_all()
library(HTRfit) library(HTRfit)
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment