Skip to content

Commit 04fcd1b

Browse files
committed
v0.8.1 fix to qdecr_clusters
1 parent e86d2e1 commit 04fcd1b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Bug fixes
44
* If the estimated smoothness is below 1, we now increase it to 1 to avoid problems down the line.
5+
* Fixed a bug in qdecr_clusters where it assumes that there is always at least 1 cluster significant.
56

67
# QDECR 0.8.0: Momo
78

R/summarizing.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ summary.vw_fastlm <- function(vw, verbose = FALSE, annot = FALSE, file = "aparc.
122122
# Get cluster annotation information
123123
if (annot) {
124124
ca <- qdecr_clusters(vw, name = file)
125+
if (is.null(ca)) return(cs2)
125126
ca2 <- lapply(ca, function(x) {
126127
nr2 <- nrow(x)
127128
if (nr2 > regions) nr2 <- regions
@@ -156,6 +157,7 @@ qdecr_clusters <- function(vw, name = "aparc.annot") {
156157
if (any(ocn$x > 0)) annots <- lapply(seq_len(max(ocn$x)), function(i) annot$vd_label[ocn$x == i])
157158
})
158159
ocn_annot2 <- do.call(c, ocn_annot[!sapply(ocn_annot, is.null)])
160+
if(is.null(ocn_annot2)) return(NULL)
159161
ocn_annot3 <- lapply(ocn_annot2, table)
160162

161163
ta <- table(annot$vd_label)

0 commit comments

Comments
 (0)