Skip to content

Commit

Permalink
edit dbg messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokwee committed Oct 20, 2023
1 parent 0a3ad32 commit 1cb993c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/pgx-signature.R
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,14 @@ sigdb.getConnectivityContrasts <- function(sigdb, path = NULL) {
#' @export
sigdb.getConnectivityMatrix <- function(sigdb, select = NULL, genes = NULL, path = NULL) {
if (sigdb == "" || is.null(sigdb)) {
warning("[getConnectivityMatrix] ***WARNING*** sigdb=", sigdb)
warning("[getConnectivityMatrix] WARNING missing H5 file: sigdb=", sigdb)
return(NULL)
}
if (!is.null(path)) {
sigdb <- file.path(path, sigdb)
}
if (!file.exists(sigdb)) {
warning("[getConnectivityMatrix] ***WARNING*** file ", sigdb, "not found")
warning("[getConnectivityMatrix] WARNING file ", sigdb, "not found")
return(NULL)
}

Expand All @@ -654,7 +654,7 @@ sigdb.getConnectivityMatrix <- function(sigdb, select = NULL, genes = NULL, path
if (!is.null(select)) colidx <- match(intersect(select, cn), cn)
nr <- length(rowidx)
nc <- length(colidx)
dbg("[sigdb.getConnectivityMatrix] *WARNING* reading large H5 file:", nr, "x", nc, "")
dbg("[sigdb.getConnectivityMatrix] reading large H5 file:", nr, "x", nc, "")
X <- rhdf5::h5read(sigdb, "data/matrix", index = list(rowidx, colidx))
rownames(X) <- rn[rowidx]
colnames(X) <- cn[colidx]
Expand All @@ -674,7 +674,7 @@ sigdb.getConnectivityMatrix <- function(sigdb, select = NULL, genes = NULL, path
sigdb.getEnrichmentMatrix <- function(sigdb, select = NULL, path = NULL,
which = c("gsea", "rankcor")[1]) {
if (sigdb == "" || is.null(sigdb)) {
dbg("[getEnrichmentMatrix] *WARNING* could not find sigdb=", sigdb)
dbg("[getEnrichmentMatrix] WARNING empty sigdb =", sigdb)
return(NULL)
}
if (!grepl("h5$", sigdb)) {
Expand All @@ -685,7 +685,7 @@ sigdb.getEnrichmentMatrix <- function(sigdb, select = NULL, path = NULL,
sigdb <- file.path(path, sigdb)
}
if (!file.exists(sigdb)) {
warning("[sigdb.getEnrichmentMatrix] *WARNING* file ", sigdb, "not found")
warning("[sigdb.getEnrichmentMatrix] WARNING H5 file", sigdb, "not found")
return(NULL)
}

Expand Down

0 comments on commit 1cb993c

Please sign in to comment.