Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/bigomics/playbase
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokwee committed Oct 20, 2023
2 parents 1cb993c + 998ab3e commit b0930a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions R/pgx-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ pgxinfo.updateDatasetFolder <- function(pgx.dir,
del <- which(h5.files %in% h5.delete)
if (length(del)) {
## cn[del] <- paste("[DELETED]", sub(".*\\] ", "", cn[del]))
cn[del] <- paste("[DELETED]", cn[del])
cn[del] <- paste("[DELETED]", cn[del])
rhdf5::h5delete(sigdb.file, "data/colnames")
rhdf5::h5write(cn, sigdb.file, "data/colnames")
if (delete.old) {
Expand Down Expand Up @@ -826,8 +826,8 @@ pgxinfo.updateDatasetFolder <- function(pgx.dir,
}
if (fc.del) {
del <- which(!cn %in% colnames(allFC))
## cn[del] <- paste("[DELETED]", sub(".*\\] ", "", cn[del]))
cn[del] <- paste("[DELETED]", cn[del])
## cn[del] <- paste("[DELETED]", sub(".*\\] ", "", cn[del]))
cn[del] <- paste("[DELETED]", cn[del])
rhdf5::h5delete(sigdb.file, "data/colnames")
rhdf5::h5write(cn, sigdb.file, "data/colnames")
if (delete.old) {
Expand Down Expand Up @@ -917,8 +917,8 @@ pgxinfo.delete <- function(pgx.dir, pgxname, purge.h5 = FALSE) {
h5.files <- sub("[.]pgx$", "", h5.files) ## strip pgx
del <- which(h5.files == pgxname)
if (length(del)) {
## cn[del] <- paste("[DELETED]", sub(".*\\] ", "", cn[del]))
cn[del] <- paste("[DELETED]", cn[del])
## cn[del] <- paste("[DELETED]", sub(".*\\] ", "", cn[del]))
cn[del] <- paste("[DELETED]", cn[del])
rhdf5::h5delete(sigdb.file, "data/colnames")
rhdf5::h5write(cn, sigdb.file, "data/colnames")
}
Expand Down
5 changes: 2 additions & 3 deletions R/pgx-signature.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#' @export
pgx.computeConnectivityScores <- function(pgx, sigdb, ntop = 200, contrasts = NULL,
remove.le = FALSE) {

is.h5ref <- grepl("h5$", sigdb)
if (!is.h5ref) {
cat("[pgx.computeConnectivityScores] ERROR: must be H5 formatted file\n")
Expand All @@ -50,7 +49,7 @@ pgx.computeConnectivityScores <- function(pgx, sigdb, ntop = 200, contrasts = NU
return(NULL)
}

dbg("[pgx.computeConnectivityScores] computing connectivity scores for sigdb = ",sigdb)
dbg("[pgx.computeConnectivityScores] computing connectivity scores for sigdb = ", sigdb)
meta <- pgx.getMetaFoldChangeMatrix(pgx, what = "meta")

if (is.null(contrasts)) {
Expand Down Expand Up @@ -114,7 +113,7 @@ pgx.correlateSignatureH5 <- function(fc, h5.file, nsig = 100, ntop = 200, nperm
## if we have less than 100 genes, we should make smaller GMT sets!
nsig <- min(100, round(length(fc) / 5))
sel.idx <- 1:length(cn) ## all
sel.idx <- grep("DELETED", cn, invert=TRUE)
sel.idx <- grep("DELETED", cn, invert = TRUE)
idx <- list(1:nsig, sel.idx)
sig100.up <- rhdf5::h5read(h5.file, "signature/sig100.up", index = idx)
sig100.dn <- rhdf5::h5read(h5.file, "signature/sig100.dn", index = idx)
Expand Down

0 comments on commit b0930a6

Please sign in to comment.