Skip to content

Commit

Permalink
keep dimension when only 1 column left
Browse files Browse the repository at this point in the history
  • Loading branch information
nh3 committed Sep 23, 2019
1 parent 718bc14 commit 07c05b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
if (sum(k_singular) > 0)
warning(paste('Dropping single category variables:'),
paste(colnames(df)[k_singular], collapse=', '))
df <- df[, !k_singular]
df <- df[, !k_singular, drop=F]
return(df)
}

seurat2anndata <- function(
Expand Down Expand Up @@ -52,7 +53,7 @@ seurat2anndata <- function(
)

if (!is.null(outFile))
anndata$AnnData$write(adata, outFile, compression = 'gzip')
adata$write(outFile, compression = 'gzip')

adata
}
Expand Down

0 comments on commit 07c05b0

Please sign in to comment.