Skip to content

Commit

Permalink
1.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
GEHoffman committed Feb 13, 2024
1 parent 392e264 commit 9fa8203
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dreamlet
Type: Package
Title: Scalable differential expression analysis of single cell transcriptomics datasets with complex study designs
Version: 1.0.1
Version: 1.1.17
Date: 2024-02-12
Authors@R: person("Gabriel", "Hoffman", role=c("aut", "cre"), email="gabriel.hoffman@mssm.edu", comment=c(ORCID="0000-0002-0957-0224"))
Description: Recent advances in single cell/nucleus transcriptomic technology has enabled collection of cohort-scale datasets to study cell type specific gene expression differences associated disease state, stimulus, and genetic regulation. The scale of these data, complex study designs, and low read count per cell mean that characterizing cell type specific molecular mechanisms requires a user-frieldly, purpose-build analytical framework. We have developed the dreamlet package that applies a pseudobulk approach and fits a regression model for each gene and cell cluster to test differential expression across individuals associated with a trait of interest. Use of precision-weighted linear mixed models enables accounting for repeated measures study designs, high dimensional batch effects, and varying sequencing depth or observed cells per biosample.
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# dreamlet 1.1.17
- bug fix in `plotPCA()`

# dreamlet 1.1.16
- Feb 8, 2024
- fix bug in `pbWeights()`
Expand Down
12 changes: 5 additions & 7 deletions R/plotPCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ setGeneric("plotPCA", BiocGenerics::plotPCA)
#' @param maxOutlierZ cap outlier z-scores at this value for plotting to maintain consistent color scale
#' @param nrow number of rows in plot
#' @param size size passed to \code{geom_point()}
#' @param fdr.cutoff FDR cutoff to determine outlier
#'
#' @name plotPCA
#' @rdname plotPCA
Expand All @@ -42,27 +43,24 @@ setGeneric("plotPCA", BiocGenerics::plotPCA)
#
#' @seealso \code{outlierByAssay()}
#' @export
setMethod("plotPCA", signature(object="dreamletProcessedData"), function(object, assays = assayNames(object), nPC=2, robust = FALSE, ..., maxOutlierZ=20, nrow=2, size=2){
setMethod("plotPCA", signature(object="dreamletProcessedData"), function(object, assays = assayNames(object), nPC=2, robust = FALSE, ..., maxOutlierZ=20, nrow=2, size=2, fdr.cutoff=0.05){

stopifnot(all(assays %in% assayNames(object)))

PC1 <- PC2 <- z <- pValue <- FDR <- NULL

outlierByAssay( object, assays, robust = robust, ...) %>%
outlierByAssay( object, assays, robust = robust, nPC=nPC,...) %>%
tibble(FDR = p.adjust(pValue, "fdr")) %>%
arrange(FDR) %>%
ggplot(aes(PC1, PC2,
color = pmin(z, maxOutlierZ),
shape = FDR < 0.05)) +
shape = FDR < fdr.cutoff)) +
geom_point(size=size) +
theme_classic() +
theme(aspect.ratio=1, plot.title = element_text(hjust = 0.5)) +
scale_color_gradient("Outlier z", limits=c(0, maxOutlierZ), low="grey60", high="red") +
scale_shape_discrete(bquote(FDR < .(fdr.cutoff))) +
facet_wrap( ~ assay, nrow=nrow, scales="free")
})






7 changes: 6 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/Rplot001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/plotPCA-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 12 additions & 7 deletions docs/reference/plotPCA.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/plotPCA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9fa8203

Please sign in to comment.