Minor fix in loom
authorPaul Hoffman <phoffman@nygenome.org>
Fri, 16 Mar 2018 20:29:24 +0000 (16:29 -0400)
committerPaul Hoffman <phoffman@nygenome.org>
Fri, 16 Mar 2018 20:29:24 +0000 (16:29 -0400)
R/loom.R

index bb8c8cb70efb39dc73df41b1711465de2303e415..a57b8a37e6b0c21477d8c977127a02339be54fd6 100644 (file)
--- a/R/loom.R
+++ b/R/loom.R
@@ -585,7 +585,7 @@ loom <- R6Class(
       if (display.progress) {
         catn("Running trial to determine class of dataset")
       }
-      trial <- if (grepl(pattern = 'layers', x = dataset.use)) {
+      trial <- if (grepl(pattern = 'layers', x = dataset.use) || dataset.use == 'matrix') {
         switch(
           EXPR = MARGIN,
           '1' = self[[dataset.use]][, 1],
@@ -647,7 +647,7 @@ loom <- R6Class(
           switch(
             EXPR = MARGIN,
             '1' = group[[results.basename]][, chunk.indices] <- chunk.data,
-            '2' = group[[results.basename]][, chunk.indices] <- chunk.data
+            '2' = group[[results.basename]][chunk.indices, ] <- chunk.data
           )
           if (!is.null(x = index.use)) {
             switch(