Skip to content

Commit a734661

Browse files
committed
Merge branch 'release/v0.0.4'
2 parents e098dfc + 4ed4773 commit a734661

File tree

14 files changed

+426
-414
lines changed

14 files changed

+426
-414
lines changed

DESCRIPTION

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
Package: scone
2-
Version: 0.0.3
2+
Version: 0.0.4
33
Title: Single Cell Overview of Normalized Expression data
44
Description: scone is a package to compare and rank the performance of different normalization schemes in real single-cell RNA-seq datasets.
55
Authors@R: c(person("Michael", "Cole", email = "mbeloc@gmail.com",
66
role = c("aut", "cre", "cph")),
77
person("Davide", "Risso", email = "risso.davide@gmail.com",
88
role = c("aut")))
9-
Author: Michael Cole [aut, cre, cph] and Davide Risso [aut]
9+
Author: Michael Cole [aut, cre, cph], Davide Risso [aut]
1010
Maintainer: Michael Cole <mbeloc@gmail.com>
11-
Date: 2016-02-14
11+
Date: 2016-05-12
1212
License: Artistic-2.0
1313
Depends:
14-
R (>= 3.1)
14+
R (>= 3.3)
1515
Imports:
1616
BiocParallel,
17-
clusterCells,
17+
cluster,
1818
DESeq,
1919
EDASeq,
2020
MASS,
@@ -28,7 +28,7 @@ Imports:
2828
limma,
2929
matrixStats,
3030
mixtools,
31-
scde
31+
grDevices
3232
Suggests:
3333
knitr,
3434
rmarkdown,

NAMESPACE

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
export(DESEQ_FN)
44
export(DESEQ_FN_POS)
5+
export(FQT_FN)
56
export(FQ_FN)
67
export(FQ_FN_POS)
78
export(TMM_FN)
@@ -26,12 +27,13 @@ importFrom(MASS,glm.nb)
2627
importFrom(RUVSeq,RUVg)
2728
importFrom(aroma.light,normalizeQuantileRank.matrix)
2829
importFrom(class,knn)
29-
importFrom(clusterCells,subsampleClustering)
30+
importFrom(cluster,silhouette)
3031
importFrom(diptest,dip.test)
3132
importFrom(edgeR,calcNormFactors)
3233
importFrom(fpc,pamk)
3334
importFrom(grDevices,colorRampPalette)
3435
importFrom(limma,lmFit)
36+
importFrom(matrixStats,colIQRs)
37+
importFrom(matrixStats,colMedians)
3538
importFrom(matrixStats,rowMedians)
3639
importFrom(mixtools,normalmixEM)
37-
importFrom(scde,bwpca)

R/SCONE_DEFAULTS.R

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ uq_f <- function(which="upper", round = FALSE){
2020
# exprs(x) <- UQ_FN(exprs(x))
2121
# return(x)
2222
# })
23-
#
23+
#
2424
# setMethod(f="UQ_FN",
2525
# signature="matrix",
2626
# definition= function(ei){
@@ -52,15 +52,23 @@ FQ_FN = function(ei){
5252
return(eo)
5353
}
5454

55+
#' @rdname FQ_FN
56+
#' @details FQT_FN handles ties carefully (see \code{\link[limma]{normalizeQuantiles}}).
57+
#' @export
58+
FQT_FN = function(ei){
59+
eo = normalizeQuantileRank.matrix(ei, ties = TRUE)
60+
return(eo)
61+
}
62+
5563
#' Full-Quantile normalization applied to positive data.
5664
#' @export
5765
#' @param ei = Numerical matrix. (rows = genes, cols = samples). Unique row.names are required.
5866
#' @return FQ (positive) normalized matrix.
5967
FQ_FN_POS = function(ei){
60-
68+
6169
# Vector of integers used for computation
6270
base_rank = 1:nrow(ei)
63-
71+
6472
# Quantile Index Matrix: Values between 0 and 1 corresponding to quantile
6573
quant_mat = NULL
6674
# Re-ordered Data Matrix
@@ -75,7 +83,7 @@ FQ_FN_POS = function(ei){
7583
quant[quant > 1] = NA
7684
quant_mat = cbind(quant_mat,quant)
7785
}
78-
86+
7987
# Vector form of quantile index matrix
8088
quant_out = as.numeric(as.vector(quant_mat))
8189
# Interpolation Matrix (Values of all quantiles)
@@ -95,7 +103,7 @@ FQ_FN_POS = function(ei){
95103

96104
# Average over the interpolated values from all samples
97105
inter_mean = inter_mat/ob_counts
98-
106+
99107
## Substituting Mean Interpolated Values for Expression Values and Return
100108
eo = matrix(inter_mean,ncol = dim(ei)[2])
101109
eo[is.na(eo)] = 0
@@ -136,7 +144,7 @@ DESEQ_FN_POS = function(ei){
136144
}
137145
if(!any(geom_mean > 0)){
138146
stop("Geometric mean non-positive for all genes.")
139-
}
147+
}
140148
ratios = ei / geom_mean # Divide each Expression Value by Geometric Mean of Corresponding Gene
141149
if(any(is.infinite(geom_mean))){
142150
stop("Infinite mean! This should never happen :-<")

R/biplot.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ biplot_colored <- function(x, y, choices=1:2, expand=1, ...) {
4646

4747
text(yy/ratio, labels=labs, col=2)
4848
arrows(0, 0, yy[, 1] * 0.8/ratio, yy[, 2] * 0.8/ratio, col = 2, length = 0.1)
49+
50+
invisible(xx)
4951
}

0 commit comments

Comments
 (0)