Skip to content

Commit f4da9c6

Browse files
committed
swap MetaDE for metap, remove NMF dependency
1 parent 2385378 commit f4da9c6

8 files changed

+56
-40
lines changed

DESCRIPTION

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Seurat
2-
Version: 2.2.0
3-
Date: 2018-01-10
2+
Version: 2.2.1
3+
Date: 2018-02-14
44
Title: Tools for Single Cell Genomics
55
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, and Butler A and Satija R (2017) <doi:10.1101/164889> for more details.
66
Authors@R: c(
@@ -47,14 +47,14 @@ Imports:
4747
Rcpp,
4848
tclust,
4949
ranger,
50-
NMF,
5150
dtw,
5251
SDMTools,
5352
plotly,
5453
diffusionMap,
5554
Hmisc,
5655
tidyr,
57-
ggridges
56+
ggridges,
57+
metap
5858
LinkingTo: Rcpp, RcppEigen, RcppProgress
5959
License: GPL-3 | file LICENSE
6060
LazyData: true
@@ -95,5 +95,4 @@ Suggests:
9595
testthat,
9696
SummarizedExperiment,
9797
MAST,
98-
DESeq2,
99-
MetaDE
98+
DESeq2

NAMESPACE

+6-1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ import(fpc)
263263
import(ggplot2)
264264
import(gridExtra)
265265
import(lars)
266+
import(metap)
266267
import(methods)
267268
import(parallel)
268269
import(pbapply)
@@ -277,7 +278,6 @@ importFrom(Matrix,colSums)
277278
importFrom(Matrix,readMM)
278279
importFrom(Matrix,rowSums)
279280
importFrom(Matrix,sparseMatrix)
280-
importFrom(NMF,aheatmap)
281281
importFrom(RColorBrewer,brewer.pal.info)
282282
importFrom(ROCR,performance)
283283
importFrom(ROCR,prediction)
@@ -306,6 +306,7 @@ importFrom(dplyr,top_n)
306306
importFrom(dplyr,ungroup)
307307
importFrom(dtw,dtw)
308308
importFrom(gdata,drop.levels)
309+
importFrom(gdata,interleave)
309310
importFrom(ggridges,geom_density_ridges)
310311
importFrom(ggridges,theme_ridges)
311312
importFrom(gplots,heatmap.2)
@@ -317,9 +318,11 @@ importFrom(graphics,abline)
317318
importFrom(graphics,axis)
318319
importFrom(graphics,contour)
319320
importFrom(graphics,hist)
321+
importFrom(graphics,lines)
320322
importFrom(graphics,locator)
321323
importFrom(graphics,mtext)
322324
importFrom(graphics,par)
325+
importFrom(graphics,plot)
323326
importFrom(graphics,points)
324327
importFrom(graphics,rect)
325328
importFrom(graphics,smoothScatter)
@@ -348,6 +351,7 @@ importFrom(stats,coef)
348351
importFrom(stats,complete.cases)
349352
importFrom(stats,cor)
350353
importFrom(stats,cov)
354+
importFrom(stats,density)
351355
importFrom(stats,dist)
352356
importFrom(stats,dnorm)
353357
importFrom(stats,glm)
@@ -366,6 +370,7 @@ importFrom(stats,poisson)
366370
importFrom(stats,predict)
367371
importFrom(stats,prop.test)
368372
importFrom(stats,qqplot)
373+
importFrom(stats,quantile)
369374
importFrom(stats,qunif)
370375
importFrom(stats,relevel)
371376
importFrom(stats,reorder)

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to Seurat will be documented in this file.
33
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
44

5+
## [2.2.1] - 2018-02-14
6+
### Changed
7+
- MetaDE replaced with metap for combining p-values (MetaDE was removed from CRAN)
8+
- NMF heatmaps replaced (NMF to be archived by CRAN)
9+
510
## [2.2.0] - 2018-01-10
611
### Added
712
- Multiple alignment functionality with RunMultiCCA and AlignSubspace extended to multiple datasets

R/differential_expression.R

+13-12
Original file line numberDiff line numberDiff line change
@@ -613,15 +613,16 @@ FindAllMarkersNode <- function(
613613
#' use all other cells for comparison.
614614
#' @param grouping.var grouping variable
615615
#' @param assay.type Type of assay to fetch data for (default is RNA)
616-
#' @param meta.method method for combining p-values. See MetaDE::MetaDE.pvalue
617-
#' for details.
616+
#' @param meta.method method for combining p-values. Should be a function from
617+
#' the metap package (NOTE: pass the function, not a string)
618618
#' @param \dots parameters to pass to FindMarkers
619619
#'
620620
#' @return Matrix containing a ranked list of putative conserved markers, and
621621
#' associated statistics (p-values within each group and a combined p-value
622622
#' (such as Fishers combined p-value or others from the MetaDE package),
623623
#' percentage of cells expressing the marker, average differences)
624624
#'
625+
#' @import metap
625626
#' @export
626627
#'
627628
#' @examples
@@ -632,19 +633,19 @@ FindAllMarkersNode <- function(
632633
#' size = length(x = [email protected]),
633634
#' replace = TRUE
634635
#' )
635-
#' FindConservedMarkers(pbmc_small, ident.1 = 1, ident.2 = 2, grouping.var = "groups")
636+
#' FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
636637
#'
637638
FindConservedMarkers <- function(
638639
object,
639640
ident.1,
640641
ident.2 = NULL,
641642
grouping.var,
642643
assay.type = "RNA",
643-
meta.method = "minP",
644+
meta.method = minimump,
644645
...
645646
) {
646-
if (!'MetaDE' %in% rownames(x = installed.packages())) {
647-
stop("Please install MetaDE (note Bioconductor dependencies) - learn more at https://cran.r-project.org/web/packages/MetaDE/index.html")
647+
if(class(meta.method) != "function") {
648+
stop("meta.method should be a function from the metap package. Please see https://cran.r-project.org/web/packages/metap/metap.pdf for a detail description of the available functions.")
648649
}
649650
object.var <- FetchData(object = object, vars.all = grouping.var)
650651
object <- SetIdent(
@@ -716,12 +717,12 @@ FindConservedMarkers <- function(
716717
MARGIN = 1,
717718
FUN = max
718719
)
719-
combined.pval <- MetaDE::MetaDE.pvalue(x = list(p = markers.combined[, pval.codes]),
720-
meta.method = meta.method)$meta.analysis
721-
combined.pval <- cbind(combined.pval$pval, combined.pval$FDR)
722-
colnames(combined.pval) <- paste0(colnames(combined.pval), c(rep("_p_val", length(meta.method)), rep("_FDR", length(meta.method))))
723-
markers.combined$combined_pval <- combined.pval
724-
markers.combined <- markers.combined[order(markers.combined$combined_pval[,1]), ]
720+
combined.pval <- data.frame(cp = apply(X = markers.combined[, pval.codes],
721+
MARGIN = 1,
722+
FUN = function(x) meta.method(x)$p))
723+
colnames(combined.pval) <- paste0(as.character(formals()$meta.method), "_p_val")
724+
markers.combined <- cbind(markers.combined, combined.pval)
725+
markers.combined <- markers.combined[order(markers.combined[, paste0(as.character(formals()$meta.method), "_p_val")]), ]
725726
return(markers.combined)
726727
}
727728

R/plotting_utilities.R

+4
Original file line numberDiff line numberDiff line change
@@ -278,3 +278,7 @@ BlackAndWhite <- function(...) {
278278
PurpleAndYellow <- function(...) {
279279
return(CustomPalette(low = "magenta", high = "yellow", mid = "black", ...))
280280
}
281+
282+
BlueAndRed <- function(...) {
283+
return(CustomPalette(low = "#313695" , high = "#A50026", mid = "#FFFFBF", ...))
284+
}

R/spatial_internal.R

+18-17
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ slimdmvnorm <- function (x, mean = rep(0, p), sigma = diag(p), log = FALSE) {
5555
###############
5656
#Internal, not documented for now
5757
#
58-
#' @importFrom NMF aheatmap
5958
#' @importFrom utils write.table
6059
#
6160
CalcInsitu <- function(
@@ -129,13 +128,12 @@ CalcInsitu <- function(
129128
)
130129
}
131130
if (do.plot) {
132-
aheatmap(
133-
x = insilico.stain,
134-
Rowv = NA,
135-
Colv = NA,
136-
color = col.use,
137-
main = title.use
138-
)
131+
heatmap2NoKey(x = insilico.stain,
132+
Rowv = NA,
133+
Colv = NA,
134+
trace = "none",
135+
col = col.use,
136+
dimTitle = title.use)
139137
}
140138
if (do.return) {
141139
return(as.vector(x = insilico.stain))
@@ -172,8 +170,6 @@ map.cell.score <- function(gene, gene.value, insitu.bin, mu, sigma, alpha) {
172170

173171
#Internal, not documented for now
174172
#
175-
#' @importFrom NMF aheatmap
176-
#
177173
MapCell <- function(
178174
object,
179175
cell.name,
@@ -246,14 +242,19 @@ MapCell <- function(
246242
)
247243
), ]
248244
}
249-
aheatmap(
250-
x = matrix(data = total.prob, nrow=8, ncol=8),
251-
Rowv = NA,
252-
Colv = NA,
253-
txt = txt.matrix,
254-
color = BlackAndWhite()
245+
heatmap2NoKey(x = matrix(data = total.prob, nrow=8, ncol=8),
246+
Rowv = NA,
247+
Colv = NA,
248+
col = BlackAndWhite(),
249+
trace = "none"
250+
)
251+
heatmap2NoKey(x = scale.probs,
252+
Rowv = NA,
253+
Colv = NA,
254+
col = BlueAndRed(),
255+
trace = "none",
256+
symbreaks = FALSE
255257
)
256-
aheatmap(x = scale.probs, Rowv = NA, Colv = NA)
257258
ResetPar()
258259
}
259260
return(total.prob)

R/zfRenderSeurat.R

+1
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ zf.insitu.ventral <- function(seuratObject, gene, label=TRUE, ...) {
539539
}
540540

541541
#' @export
542+
#' @importFrom gdata interleave
542543
zf.insitu.side <- function(expressionMatrix, nonmirror = TRUE, mirror = TRUE) {
543544
# Determine geometry
544545
tierBins <- 30 # 1 bin per cell tier.

man/FindConservedMarkers.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)