Skip to content

Commit b825433

Browse files
author
Josh Campbell
committed
Merge remote-tracking branch 'compbiomed/devel' into devel
2 parents bbdef01 + 6bd11f6 commit b825433

29 files changed

+368
-269
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ exec/png
1717
^\.github$
1818
^vignettes/articles/*
1919
^images
20+
.dockerignore

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.RData
2+
.Rhistory
3+
.git
4+
.gitignore
5+
manifest.json
6+
rsconnect/
7+
.Rproj.user

DESCRIPTION

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ Imports:
118118
scuttle,
119119
utils,
120120
stats,
121-
zellkonverter
122-
RoxygenNote: 7.3.1
121+
zellkonverter,
122+
tidyr
123+
RoxygenNote: 7.3.2
123124
Suggests:
124125
testthat,
125126
Rsubread,

R/computeHeatmap.R

+7
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ computeHeatmap <- function(inSCE,
131131
features[[i]] <- .convertToHyphen(features[[i]])
132132
}
133133

134+
## temp fix
135+
# make sure the cell names are consistent
136+
# UPDATE THIS IN .convertSCEToSeurat function eventually
137+
rownames(object@reductions$pca@cell.embeddings) <-
138+
unlist(.convertToHyphen(rownames(object@reductions$pca@cell.embeddings)))
139+
##
140+
134141
object <- Seurat::ScaleData(object, features = features.all)
135142

136143
# get assay data with only selected features (all dims) and

R/doubletFinder_doubletDetection.R

+1
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
#' @seealso \code{\link{runCellQC}}, \code{\link{plotDoubletFinderResults}}
343343
#' @examples
344344
#' data(scExample, package = "singleCellTK")
345+
#' options(future.globals.maxSize = 786432000)
345346
#' sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
346347
#' sce <- runDoubletFinder(sce)
347348
#' @export

R/dropletUtils_emptyDrops.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#' @title Identify empty droplets using \link[DropletUtils]{emptyDrops}.
2828
#' @description Run \link[DropletUtils]{emptyDrops} on the count matrix in the
29-
#' provided \\linkS4class{SingleCellExperiment} object.
29+
#' provided \linkS4class{SingleCellExperiment} object.
3030
#' Distinguish between droplets containing cells and ambient RNA in a
3131
#' droplet-based single-cell RNA sequencing experiment.
3232
#' @param inSCE A \linkS4class{SingleCellExperiment} object. Must contain a raw

R/ggPlotting.R

+22-6
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,19 @@ plotSCEScatter <- function(inSCE,
852852
vcolor = "red",
853853
vsize = 1,
854854
vlinetype = 1) {
855+
856+
mult_modules <- FALSE
857+
855858
if (is.null(groupBy)) {
856-
groupBy <- rep("Sample", length(y))
859+
if (length(colnames(y)) > 1){
860+
mult_modules <- TRUE
861+
groupBy <- rep(colnames(y), each = dim(y)[1])
862+
y <- tidyr::pivot_longer(as.data.frame(y), cols = 1:dim(y)[2], cols_vary = "slowest")$value#
863+
}else{
864+
groupBy <- rep("Sample", length(y))
865+
}
857866
}
858867

859-
860868
if(!is.factor(groupBy)){
861869
if(is.null(plotOrder)){
862870
plotOrder = unique(groupBy)
@@ -920,6 +928,10 @@ plotSCEScatter <- function(inSCE,
920928
axis.title.x = ggplot2::element_blank())
921929
}
922930

931+
if (mult_modules){
932+
p <- p + xlab("Modules")
933+
}
934+
923935
if (gridLine == TRUE){
924936
p <- p + ggplot2::theme(panel.grid.major.y = ggplot2::element_line("grey"))
925937
}
@@ -1417,9 +1429,9 @@ plotSCEViolinAssayData <- function(inSCE,
14171429
#' @param feature Desired name of feature stored in assay of SingleCellExperiment
14181430
#' object. Only used when "assays" slotName is selected. Default NULL.
14191431
#' @param sample Character vector. Indicates which sample each cell belongs to.
1420-
#' @param dimension Desired dimension stored in the specified reducedDims.
1421-
#' Either an integer which indicates the column or a character vector specifies
1422-
#' column name. By default, the 1st dimension/column will be used.
1432+
#' @param dimension Desired dimension(s) stored in the specified reducedDims.
1433+
#' Either an integer which indicates the column(s) or a character vector specifies
1434+
#' column name(s). By default, the 1st dimension/column will be used.
14231435
#' Only used when "reducedDims" slotName is selected. Default NULL.
14241436
#' @param groupBy Groupings for each numeric value. A user may input a vector
14251437
#' equal length to the number of the samples in the SingleCellExperiment
@@ -1568,7 +1580,11 @@ plotSCEViolin <- function(inSCE,
15681580
samples <- unique(sample)
15691581
plotlist <- lapply(samples, function(x) {
15701582
sampleInd <- which(sample == x)
1571-
countSub <- counts[sampleInd]
1583+
if (length(colnames(counts)) > 1){
1584+
countSub <- counts[sampleInd,]
1585+
}else{
1586+
countSub <- counts[sampleInd]
1587+
}
15721588
if(!is.null(groupBy)){
15731589
groupbySub <- groupBy[sampleInd]
15741590
}else{

R/miscFunctions.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,18 @@ discreteColorPalette <- function(n, palette = c("random", "ggplot", "celda"),
191191
#' Adds '-1', '-2', ... '-i' to multiple duplicated rownames, and in place
192192
#' replace the unique rownames, store unique rownames in \code{rowData}, or
193193
#' return the unique rownames as character vecetor.
194-
#' @param x A matrix like or /linkS4class{SingleCellExperiment} object, on which
194+
#' @param x A matrix like or \linkS4class{SingleCellExperiment} object, on which
195195
#' we can apply \code{rownames()} to and has duplicated rownames.
196196
#' @param as.rowData Only applicable when \code{x} is a
197-
#' /linkS4class{SingleCellExperiment} object. When set to \code{TRUE}, will
197+
#' \linkS4class{SingleCellExperiment} object. When set to \code{TRUE}, will
198198
#' insert a new column called \code{"rownames.uniq"} to \code{rowData(x)}, with
199199
#' the deduplicated rownames.
200200
#' @param return.list When set to \code{TRUE}, will return a character vector
201201
#' of the deduplicated rownames.
202202
#' @export
203-
#' @return By default, a matrix or /linkS4class{SingleCellExperiment} object
203+
#' @return By default, a matrix or \linkS4class{SingleCellExperiment} object
204204
#' with rownames deduplicated.
205-
#' When \code{x} is a /linkS4class{SingleCellExperiment} and \code{as.rowData}
205+
#' When \code{x} is a \linkS4class{SingleCellExperiment} and \code{as.rowData}
206206
#' is set to \code{TRUE}, will return \code{x} with \code{rowData} updated.
207207
#' When \code{return.list} is set to \code{TRUE}, will return a character vector
208208
#' with the deduplicated rownames.

R/plotBubble.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @param ylab The y-axis label
1313
#' @param colorLow The color to be used for lowest value of mean expression
1414
#' @param colorHigh The color to be used for highest value of mean expression
15-
#' @param scale Option to scale the data. Default: /code{FALSE}. Selected assay will not be scaled.
15+
#' @param scale Option to scale the data. Default: \code{FALSE}. Selected assay will not be scaled.
1616
#' @return A ggplot of the bubble plot.
1717
#' @importFrom rlang .data
1818
#' @importFrom reshape2 melt

R/runBatchCorrection.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ integrated = integrated[:, orderIdx]
670670
#' variable genes identification. Default \code{"counts"}.
671671
#' @param kmeansK An integer vector. Indicating the kmeans' K-value for each
672672
#' batch (i.e. how many subclusters in each batch should exist), in order to
673-
#' construct pseudo-replicates. The length of code{kmeansK} needs to be the same
673+
#' construct pseudo-replicates. The length of \code{kmeansK} needs to be the same
674674
#' as the number of batches. Default \code{NULL}, and this value will be
675675
#' auto-detected by default, depending on \code{cellType}.
676676
#' @param cellType A single character. A string indicating a field in

R/runClusterSummaryMetrics.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' @param featureNames A string or vector of strings with each gene to aggregate.
88
#' @param displayName A string that is the name of the column used for genes.
99
#' @param groupNames The name of a colData entry that can be used as groupNames.
10-
#' @param scale Option to scale the data. Default: /code{FALSE}. Selected assay will not be scaled.
10+
#' @param scale Option to scale the data. Default: \code{FALSE}. Selected assay will not be scaled.
1111
#' @return A dataframe with mean expression and percent of cells in cluster that
1212
#' express for each cluster.
1313
#' @examples

R/runDimReduce.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ runDimReduce <- function(inSCE,
7676
seed = seed, ...)
7777
} else if (method == "scaterUMAP") {
7878
inSCE <- runUMAP(inSCE = inSCE, useAssay = useAssay, useAltExp = useAltExp,
79-
useReducedDim = useReducedDim, initialDims = 25,
79+
useReducedDim = useReducedDim,
8080
useFeatureSubset = useFeatureSubset, scale = scale,
8181
reducedDimName = reducedDimName, seed = seed, ...)
8282
} else if (method == "scanpyPCA"){

0 commit comments

Comments
 (0)